aboutsummaryrefslogtreecommitdiff
path: root/commands.py
diff options
context:
space:
mode:
authorhuker667 <huker@tuta.io>2026-08-04 22:06:18 +0300
committerhuker667 <huker@tuta.io>2026-08-04 22:06:18 +0300
commitd0c2cfc6b862443393e97715b9a2e6e43536e5a8 (patch)
tree161a481005cfba3cc6cc4fdba36ff314f97f6f73 /commands.py
parent6d389abce9cc505298cce2a0b1bf68deab1eb8d1 (diff)
downloaduzbekgpt-d0c2cfc6b862443393e97715b9a2e6e43536e5a8.tar.gz
uzbekgpt-d0c2cfc6b862443393e97715b9a2e6e43536e5a8.tar.bz2
uzbekgpt-d0c2cfc6b862443393e97715b9a2e6e43536e5a8.zip
доб проверку на макс промпты в ap и sp калбеке
Diffstat (limited to 'commands.py')
-rw-r--r--commands.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/commands.py b/commands.py
index beecfd1..d50f605 100644
--- a/commands.py
+++ b/commands.py
@@ -331,15 +331,23 @@ async def start_handler(message: Message, command: CommandObject):
)
)
elif prompt_pub:
- return await message.reply(
- f"✅ вот `{prompt.get('name', 'говно')}` промпт крутой da:"
- f"```\n{prompt.get('text')}\n```",
- reply_markup=InlineKeyboardMarkup(
+ if len(config["prompts"]) => MAX_PROMPTS:
+ keyboard = InlineKeyboardMarkup(
+ inline_keyboard=[
+ [InlineKeyboardButton(text="достигнут лимит промптов", callback_data=f"hamza")],
+ ]
+ )
+ else:
+ 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")],
]
)
+ return await message.reply(
+ f"✅ вот `{prompt.get('name', 'говно')}` промпт крутой da:"
+ f"```\n{prompt.get('text')}\n```",
+ reply_markup=keyboard
)
except Exception as e:
print(f"{YELLOW} -- prompt - {e}{RESET}")