Код: Выделить всё
from pyrogram import Client, filters
import asyncio
app = Client("Myapi")
async def heart_beat():
while True:
await asyncio.sleep(30)
await beat_function()
async def beat_function():
await app.send_message("@my_bot_test_grou_p", "I am Alive..!")
@app.on_message(filters.chat(-1001798384649))
async def joining(client, message):
print("triggering")
if message.entities:
for entity in message.entities:
if entity.type.URL:
if entity.url:
try:
await app.join_chat(entity.url)
except:
pass
if not entity.url:
try:
await app.join_chat(message.text[entity.offset : entity.offset + entity.length])
except:
pass
async def main():
await asyncio.gather(heart_beat(), app.start())
asyncio.run(main())
Проблема в том, что функция heart_beat() работает, а функция joining() не работает вообще. Помогите пожалуйста, если кто знает
Подробнее здесь: https://stackoverflow.com/questions/791 ... cio-gather
Мобильная версия