admin管理员组文章数量:1335871
i was trying to solve this problem in telethon from a few days ,
when i run this code
@client.on(events.NewMessage(chats=channel_to_listen())) async def all_messages_handler(event): run(event.raw_text) return 0 client.start()
it work but after a while , it print a lot of this line because the client wait for the result of the fucntion , and there is a new message to handle , so the creation of wrong session ID
Security error while unpacking a received message: Server replied with a wrong session ID (see FAQ for details)
and the solution is to run it whith async loops as you see in this example
import asyncio
@client.on(events.NewMessage(chats=channel_to_listen()))
async def all_messages_handler(event):
# Create task to run the function in background
loop = asyncio.get_event_loop()
# Just create the task directly from run_in_executor
loop.run_in_executor(None, run, event.raw_text)
have a good day.
making the telethon client run smoothly without blockage, and i get a lot of this message
Security error while unpacking a received message: Server replied with a wrong session ID (see FAQ for details)
so i fix it using async
本文标签:
版权声明:本文标题:asynchronous - Security error while unpacking a received message: Server replied with a wrong session ID (see FAQ for details) - 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742397502a2467221.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论