Compare commits

..

No commits in common. "c7675c231fbacfb7c4e308d01d4a5878ce7b2e38" and "fdbed915126b5066e51a5e3c21a86f27b056a4e6" have entirely different histories.

2 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@ states: dict[tuple[int, int], Handler] = {}
def register_state(
message: Message,
handler: Handler,
handler: Callable[[Message], Any],
) -> None:
states[(message.chat.id, message.from_user.id)] = handler
@ -40,8 +40,9 @@ async def delete_message(
*,
sleep_time: int = 0,
) -> bool:
await asyncio.sleep(sleep_time)
try:
if sleep_time != 0:
await asyncio.sleep(sleep_time)
await bot.delete_message(mes.chat.id, mes.id)
except telebot.apihelper.ApiException:
return False

View File

@ -650,12 +650,11 @@ async def _import3(
failed.append(account.name)
if failed:
await send_deleteable_message(
bot, mes.chat.id, "Не удалось добавить:\n" + "\n".join(failed)
)
mes_text = "Не удалось добавить:\n" + "\n".join(failed)
else:
await send_tmp_message(bot, mes.chat.id, "Успех")
mes_text = "Успех"
await send_tmp_message(bot, mes.chat.id, mes_text, 10)
del text, mes, accounts
gc.collect()