fix blocking async bug, add private message text handler

This commit is contained in:
Rykov7
2024-03-27 23:24:02 +03:00
parent 3231d8c263
commit ba256a7456
2 changed files with 9 additions and 1 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
import asyncio
import logging
import telebot
@@ -15,6 +16,6 @@ async def webhook(update: dict):
"""Parse POST requests from Telegram."""
if update:
update = telebot.types.Update.de_json(update)
await bot.process_new_updates([update])
asyncio.ensure_future(bot.process_new_updates([update]))
else:
return None