last hotfix

pull/148/head
Who? 2025-06-11 07:56:12 +00:00
parent ec45afc4e8
commit 32de61f83a
3 changed files with 23 additions and 23 deletions

View File

@ -487,27 +487,8 @@ class Utils(InlineUnit):
else unit.get("buttons", [])
),
)
except TelegramAPIError as e:
if True: # TODO "" in e.message
if query:
with contextlib.suppress(Exception):
await query.answer()
elif True: # TODO "" in e.message
with contextlib.suppress(Exception):
await query.answer(
"I should have edited some message, but it is deleted :("
)
return False
except TelegramRetryAfter as e:
logger.info("Sleeping %ss on aiogram FloodWait...", e.retry_after)
await asyncio.sleep(e.retry_after)
return await self._edit_unit(**utils.get_kwargs())
return False
except TelegramBadRequest as e:
if "There is no text in the message to edit" not in str(e):
if "there is no text in the message to edit" not in str(e):
raise
try:
@ -528,6 +509,25 @@ class Utils(InlineUnit):
return False
else:
return True
except TelegramAPIError as e:
if True: # TODO "" in e.message
if query:
with contextlib.suppress(Exception):
await query.answer()
elif True: # TODO "" in e.message
with contextlib.suppress(Exception):
await query.answer(
"I should have edited some message, but it is deleted :("
)
return False
except TelegramRetryAfter as e:
logger.info("Sleeping %ss on aiogram FloodWait...", e.retry_after)
await asyncio.sleep(e.retry_after)
return await self._edit_unit(**utils.get_kwargs())
return False
else:
return True
@ -776,4 +776,4 @@ class Utils(InlineUnit):
)
return None
return buttons
return buttons

View File

@ -122,6 +122,6 @@ class Executor(loader.Module):
result = self.strings["result_error"].format(result={result})
if res or res == 0 or res == False and res is not None:
result += self.string["res_return"].format(res={res})
result += self.strings["res_return"].format(res={res})
return await utils.answer(message, self.strings["result"].format(code={code}, result={result}, time=round({stop_time} - {start_time}, 5)))

View File

@ -276,7 +276,7 @@ class HerokuInfoMod(loader.Module):
if self._get_info_photo(start) is None:
await utils.answer(
message,
self.strings["incorrate_img_format"]
self.strings["incorrect_img_format"]
)
return