tg loop
This commit is contained in:
parent
2750cea9c4
commit
5b4db31b68
|
@ -27,7 +27,7 @@ SECRET_KEY = "django-insecure-ruo!wst&sb8(f9)j5u4rda-w!673lj_-c0a%gx_t@)ff*q*2ze
|
|||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
NGROK_TEMP = "af14-193-228-134-167.ngrok-free.app"
|
||||
NGROK_TEMP = "5f4c-193-228-134-167.ngrok-free.app"
|
||||
ALLOWED_HOSTS = [
|
||||
"localhost",
|
||||
NGROK_TEMP,
|
||||
|
|
|
@ -26,10 +26,15 @@ class TgBotClass(AppConfig):
|
|||
return app
|
||||
|
||||
async def some_function(self=None):
|
||||
# await TgBotClass.app.bot.get_me()
|
||||
while True:
|
||||
if not TgBotClass.my_queue.empty():
|
||||
item = TgBotClass.my_queue.get()
|
||||
await TgBotClass.app.process_update(item)
|
||||
try:
|
||||
await TgBotClass.app.process_update(item)
|
||||
except Exception as e:
|
||||
print('err')
|
||||
await TgBotClass.app.process_update(item)
|
||||
TgBotClass.my_queue.task_done()
|
||||
time.sleep(3)
|
||||
|
||||
|
|
Loading…
Reference in New Issue