Pyrogram 消息处理程序在与 uvloop 一起使用时不工作
Pyrogram Message Handler Not Working when used with uvloop
我是 Python 的新手,也是编程新手,如果我做错了什么请告诉我
我已经使用 Pyrogram 创建了一个电报机器人(Simple Echo Bot),它工作正常当我使用 uvloop 时,机器人不会响应任何消息,但我可以调用一个函数
这是我创建的代码:https://github.com/DeekshithSH/TelegramBot
这里是 main.py 文件:
from pyrogram import idle
from Test.Bot import TelegramBot
import uvloop
uvloop.install()
if sys.version_info[1] > 9:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
else:
loop = asyncio.get_event_loop()
async def main():
await TelegramBot.start()
print('Bot Started')
await idle()
loop.run_until_complete(main())
loop.close```
when i remove `uvloop.install()` the Bot work's fine
can anyone please help me
if you think the question badly writen you can edit it to improve it
the uvloop https://github.com/MagicStack/uvloop readme only show's single Example so i don't understand how to use it
我是 Python 的新手,也是编程新手,如果我做错了什么请告诉我
我已经使用 Pyrogram 创建了一个电报机器人(Simple Echo Bot),它工作正常当我使用 uvloop 时,机器人不会响应任何消息,但我可以调用一个函数
这是我创建的代码:https://github.com/DeekshithSH/TelegramBot
这里是 main.py 文件:
from pyrogram import idle
from Test.Bot import TelegramBot
import uvloop
uvloop.install()
if sys.version_info[1] > 9:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
else:
loop = asyncio.get_event_loop()
async def main():
await TelegramBot.start()
print('Bot Started')
await idle()
loop.run_until_complete(main())
loop.close```
when i remove `uvloop.install()` the Bot work's fine
can anyone please help me
if you think the question badly writen you can edit it to improve it
the uvloop https://github.com/MagicStack/uvloop readme only show's single Example so i don't understand how to use it