diff --git a/heroku/inline/utils.py b/heroku/inline/utils.py index 7b8d627..6216de2 100644 --- a/heroku/inline/utils.py +++ b/heroku/inline/utils.py @@ -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 \ No newline at end of file diff --git a/heroku/modules/executor.py b/heroku/modules/executor.py index e42f994..1739264 100644 --- a/heroku/modules/executor.py +++ b/heroku/modules/executor.py @@ -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))) \ No newline at end of file diff --git a/heroku/modules/heroku_info.py b/heroku/modules/heroku_info.py index ab3d5c9..2ec17a1 100644 --- a/heroku/modules/heroku_info.py +++ b/heroku/modules/heroku_info.py @@ -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