from telethon import TelegramClient, types
file = 'photo.png'
uploaded_file = await client.upload_file(file)
await client.send_file(chat, types.InputMediaUploadedPhoto(
uploaded_file, spoiler=True))
import threading
def flask_func():
#ЗДЕСЬ КОД ФЛЯСКА И ЗАПУСК APP
def pyrogram_func():
#ЗДЕСЬ КОД PYROGRAM И ЕГО ИНИЦИАЛИЗАЦИЯ
thread1=threading.Thread(target=flask_func).start()
thread2=threading.Thread(target=pyrogram_func).start()
from pyrogram import Client
app1 = Client("first account")
app2 = Client("second account")
# You can either stack decorators ...
@app1.on_message()
@app2.on_message()
async def m_func(_, message):
pass
# ... or use multiple add_handler calls
app1.add_handler(MessageHandler(m_func))
app2.add_handler(MessageHandler(m_func))
# Then start all Clients and call idle() to keep them running
app1.start()
app2.start()
Client.idle()
app1.stop()
app2.stop()
def get_bios_id():
result = subprocess.run(['wmic', 'bios', 'get', 'serialnumber'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
output = result.stdout.decode('utf-8').strip().split('\n')[-1]
return output
def do_gpt(text,history):
messages_do_gpt=history.copy()
messages_do_gpt.append({"role": "user", "content": text})
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=messages_do_gpt,
)
result=response.choices[0].message.content.strip()
#ДЕЙСТВИЯ С result
role = ctx.guild.get_role(1077647661521448962)
await bot.add_roles(member, role)
driver.execute_script("arguments[0].scrollTop = arguments[0].scrollHeight", element)