Compare commits
3 Commits
fdbed91512
...
c7675c231f
Author | SHA1 | Date | |
---|---|---|---|
c7675c231f | |||
ae88fccf13 | |||
e29eefe40b |
@ -18,7 +18,7 @@ states: dict[tuple[int, int], Handler] = {}
|
||||
|
||||
def register_state(
|
||||
message: Message,
|
||||
handler: Callable[[Message], Any],
|
||||
handler: Handler,
|
||||
) -> None:
|
||||
states[(message.chat.id, message.from_user.id)] = handler
|
||||
|
||||
@ -40,9 +40,8 @@ async def delete_message(
|
||||
*,
|
||||
sleep_time: int = 0,
|
||||
) -> bool:
|
||||
try:
|
||||
if sleep_time != 0:
|
||||
await asyncio.sleep(sleep_time)
|
||||
try:
|
||||
await bot.delete_message(mes.chat.id, mes.id)
|
||||
except telebot.apihelper.ApiException:
|
||||
return False
|
||||
|
@ -650,11 +650,12 @@ async def _import3(
|
||||
failed.append(account.name)
|
||||
|
||||
if failed:
|
||||
mes_text = "Не удалось добавить:\n" + "\n".join(failed)
|
||||
await send_deleteable_message(
|
||||
bot, mes.chat.id, "Не удалось добавить:\n" + "\n".join(failed)
|
||||
)
|
||||
else:
|
||||
mes_text = "Успех"
|
||||
await send_tmp_message(bot, mes.chat.id, "Успех")
|
||||
|
||||
await send_tmp_message(bot, mes.chat.id, mes_text, 10)
|
||||
del text, mes, accounts
|
||||
gc.collect()
|
||||
|
||||
|
Reference in New Issue
Block a user