Skip to content

Commit 32de61f

Browse files
committed
last hotfix
1 parent ec45afc commit 32de61f

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

heroku/inline/utils.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -487,27 +487,8 @@ async def _edit_unit(
487487
else unit.get("buttons", [])
488488
),
489489
)
490-
except TelegramAPIError as e:
491-
if True: # TODO "" in e.message
492-
if query:
493-
with contextlib.suppress(Exception):
494-
await query.answer()
495-
elif True: # TODO "" in e.message
496-
with contextlib.suppress(Exception):
497-
await query.answer(
498-
"I should have edited some message, but it is deleted :("
499-
)
500-
501-
return False
502-
except TelegramRetryAfter as e:
503-
logger.info("Sleeping %ss on aiogram FloodWait...", e.retry_after)
504-
await asyncio.sleep(e.retry_after)
505-
return await self._edit_unit(**utils.get_kwargs())
506-
507-
508-
return False
509490
except TelegramBadRequest as e:
510-
if "There is no text in the message to edit" not in str(e):
491+
if "there is no text in the message to edit" not in str(e):
511492
raise
512493

513494
try:
@@ -528,6 +509,25 @@ async def _edit_unit(
528509
return False
529510
else:
530511
return True
512+
except TelegramAPIError as e:
513+
if True: # TODO "" in e.message
514+
if query:
515+
with contextlib.suppress(Exception):
516+
await query.answer()
517+
elif True: # TODO "" in e.message
518+
with contextlib.suppress(Exception):
519+
await query.answer(
520+
"I should have edited some message, but it is deleted :("
521+
)
522+
523+
return False
524+
except TelegramRetryAfter as e:
525+
logger.info("Sleeping %ss on aiogram FloodWait...", e.retry_after)
526+
await asyncio.sleep(e.retry_after)
527+
return await self._edit_unit(**utils.get_kwargs())
528+
529+
530+
return False
531531
else:
532532
return True
533533

@@ -776,4 +776,4 @@ def _validate_markup(
776776
)
777777
return None
778778

779-
return buttons
779+
return buttons

heroku/modules/executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ async def execcmd(self, message):
122122
result = self.strings["result_error"].format(result={result})
123123

124124
if res or res == 0 or res == False and res is not None:
125-
result += self.string["res_return"].format(res={res})
125+
result += self.strings["res_return"].format(res={res})
126126

127127
return await utils.answer(message, self.strings["result"].format(code={code}, result={result}, time=round({stop_time} - {start_time}, 5)))

heroku/modules/heroku_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ async def infocmd(self, message: Message):
276276
if self._get_info_photo(start) is None:
277277
await utils.answer(
278278
message,
279-
self.strings["incorrate_img_format"]
279+
self.strings["incorrect_img_format"]
280280
)
281281
return
282282

0 commit comments

Comments
 (0)