доб проверку на макс промпты в ap и sp калбеке
This commit is contained in:
1 parent
6d389abce9
commit
d0c2cfc6b8
2 files changed
+20
-5
No files matched your search
+12
-4
@@ -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}")
|
||||
|
||||
Reference in new issue
Block a user