aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/main.py b/main.py
index 504b2e0..2c2593e 100644
--- a/main.py
+++ b/main.py
@@ -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))