diff options
| author | huker667 <huker@tuta.io> | 2026-08-04 22:18:25 +0300 |
|---|---|---|
| committer | huker667 <huker@tuta.io> | 2026-08-04 22:18:25 +0300 |
| commit | 0b09d32d47734cabf357601dd76cfbd30402063d (patch) | |
| tree | a5ce0f22ae663305f61c0753d57fe2bb00cca9e6 | |
| parent | 3e6b137bf360c5d8856de656d26f1f26d0c78190 (diff) | |
| download | uzbekgpt-0b09d32d47734cabf357601dd76cfbd30402063d.tar.gz uzbekgpt-0b09d32d47734cabf357601dd76cfbd30402063d.tar.bz2 uzbekgpt-0b09d32d47734cabf357601dd76cfbd30402063d.zip | |
фикс фикс прошлого коммита
| -rw-r--r-- | commands.py | 2 | ||||
| -rw-r--r-- | main.py | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/commands.py b/commands.py index c41bb45..08fb4b3 100644 --- a/commands.py +++ b/commands.py @@ -338,7 +338,7 @@ async def start_handler(message: Message, command: CommandObject): ] ) else: - InlineKeyboardMarkup( + keyboard = InlineKeyboardMarkup( inline_keyboard=[ [InlineKeyboardButton(text="✅ добавить", callback_data=f"ap%{user_id}%{prompt_user_id}%{prompt_id}")], [InlineKeyboardButton(text="✅🔗 доб. + установить", callback_data=f"sp%{user_id}%{prompt_user_id}%{prompt_id}%2")], @@ -113,6 +113,22 @@ async def guest_middleware(handler, event, data): elif alo_command[user_id]["action"] == "p_prompt": alo_command[user_id]["action"] = None alo_command[user_id]["prompt"] = message.text + + if len(config["prompts"]) >= MAX_PROMPTS: + return await bot.edit_message_text( + text=f"невозможно создать новый промпт так как ты превысил лимит промптов da.", + chat_id=alo_command[user_id]["chat_id"], + message_id=alo_command[user_id]["message_id"], + reply_markup=InlineKeyboardMarkup( + inline_keyboard=[ + [ + InlineKeyboardButton( + text=f"ок", callback_data=f"user_prompts%{user_id}" + ), + ], + ] + ) + ) while 1: alo_command[user_id]["id"] = ''.join(choices(string.ascii_letters, k=10)) |