Changes in helper_functions.delete_message
Removed checking if sleep_time is 0 Moved sleeping outside of try block
This commit is contained in:
parent
fdbed91512
commit
e29eefe40b
@ -40,9 +40,8 @@ async def delete_message(
|
|||||||
*,
|
*,
|
||||||
sleep_time: int = 0,
|
sleep_time: int = 0,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
|
await asyncio.sleep(sleep_time)
|
||||||
try:
|
try:
|
||||||
if sleep_time != 0:
|
|
||||||
await asyncio.sleep(sleep_time)
|
|
||||||
await bot.delete_message(mes.chat.id, mes.id)
|
await bot.delete_message(mes.chat.id, mes.id)
|
||||||
except telebot.apihelper.ApiException:
|
except telebot.apihelper.ApiException:
|
||||||
return False
|
return False
|
||||||
|
Reference in New Issue
Block a user