raise other exceptions in antiflood

This commit is contained in:
orocane 2022-09-10 21:46:16 +08:00
parent 783beb165b
commit a06b4a1e9c
1 changed files with 3 additions and 7 deletions

View File

@ -647,19 +647,15 @@ def antiflood(function: Callable, *args, **kwargs):
"""
from telebot.apihelper import ApiTelegramException
from time import sleep
msg = None
try:
msg = function(*args, **kwargs)
return function(*args, **kwargs)
except ApiTelegramException as ex:
if ex.error_code == 429:
sleep(ex.result_json['parameters']['retry_after'])
msg = function(*args, **kwargs)
return function(*args, **kwargs)
else:
raise
except:
raise
finally:
return msg
def parse_web_app_data(token: str, raw_init_data: str):