From 965a22e0c556b291f3e5564c1c7d9f51c1190909 Mon Sep 17 00:00:00 2001 From: huker667 Date: Sun, 5 Jul 2026 17:41:22 +0300 Subject: fix edit mode and block --- helpers.py | 3 +++ main.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/helpers.py b/helpers.py index eff4c81..8618187 100644 --- a/helpers.py +++ b/helpers.py @@ -24,6 +24,9 @@ def is_blocked(user_id): alo = "🚫 *файл не вошёл.* я ещё не сгенерировал прошлое сообщение.\n" \ f"подожди {round(10 - time_diff, 3)} секунд, чтобы я закрыл глаза " \ "на это da." + elif len(last_command_time[user_id][2]) > 1 and time_diff > 5: + last_command_time = [current_time, False, []] + return "", False elif len(last_command_time[user_id][2]) > 1: alo = "🚫 *файл не вошёл.* хватит так быстро слать свои сообщения." else: diff --git a/main.py b/main.py index 7a8a221..c9594ce 100644 --- a/main.py +++ b/main.py @@ -282,7 +282,11 @@ async def guest_middleware(handler, event, data): return if stream == "edit": - message_id = msg.message_id + if msg: + message_id = msg.message_id + else: + msg = await message.reply("💬") + message_id = msg.message_id else: message_id = None -- cgit v1.3.1