aboutsummaryrefslogtreecommitdiff
path: root/commands.py
diff options
context:
space:
mode:
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}")