Merge pull request #1707 from S1RANN/master

raise other exceptions in antiflood function
This commit is contained in:
Badiboy 2022-09-13 17:59:30 +03:00 committed by GitHub
commit 8d9dfcfac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -647,15 +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)
finally:
return msg
return function(*args, **kwargs)
else:
raise
def parse_web_app_data(token: str, raw_init_data: str):