From 16d031d90ec1d447836a1de27d3b4273375a4892 Mon Sep 17 00:00:00 2001 From: Capybara-z Date: Fri, 29 Aug 2025 10:35:12 +0300 Subject: [PATCH] fix hooks --- hooks/hook_buttons.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hooks/hook_buttons.py b/hooks/hook_buttons.py index adac313b..52e3f4c0 100644 --- a/hooks/hook_buttons.py +++ b/hooks/hook_buttons.py @@ -70,9 +70,11 @@ def insert_hook_buttons(builder: InlineKeyboardBuilder, buttons: list) -> Inline else: new_rows.append([button]) - regular_buttons = [b for b in flat_buttons if isinstance(b, dict) and "button" in b and "insert_at" not in b and "after" not in b] - for module in regular_buttons: - button = module["button"] - new_rows.append([button]) + for module in flat_buttons: + if isinstance(module, dict) and "button" in module and "insert_at" not in module and "after" not in module: + button = module["button"] + new_rows.append([button]) + elif module and not isinstance(module, dict): + new_rows.append([module]) return InlineKeyboardBuilder.from_markup(InlineKeyboardMarkup(inline_keyboard=new_rows))