fix: infra
This commit is contained in:
@ -265,13 +265,26 @@ def ask_preference_theme(bot: telebot.TeleBot, user_id: int) -> None:
|
||||
"""Ask user to select preference theme."""
|
||||
keyboard = types.InlineKeyboardMarkup(row_width=2)
|
||||
|
||||
for theme in THEMES:
|
||||
emoji = get_theme_emoji(theme)
|
||||
button = types.InlineKeyboardButton(
|
||||
text=f"{emoji} {theme}",
|
||||
callback_data=f'theme_{theme}'
|
||||
# Show hobbies (themes) in 2 buttons per row
|
||||
for i in range(0, len(THEMES), 2):
|
||||
theme1 = THEMES[i]
|
||||
emoji1 = get_theme_emoji(theme1)
|
||||
btn1 = types.InlineKeyboardButton(
|
||||
text=f"{emoji1} {theme1}",
|
||||
callback_data=f'theme_{theme1}'
|
||||
)
|
||||
keyboard.add(button)
|
||||
|
||||
# Optional second button in the same row
|
||||
if i + 1 < len(THEMES):
|
||||
theme2 = THEMES[i + 1]
|
||||
emoji2 = get_theme_emoji(theme2)
|
||||
btn2 = types.InlineKeyboardButton(
|
||||
text=f"{emoji2} {theme2}",
|
||||
callback_data=f'theme_{theme2}'
|
||||
)
|
||||
keyboard.add(btn1, btn2)
|
||||
else:
|
||||
keyboard.add(btn1)
|
||||
|
||||
bot.send_message(
|
||||
user_id,
|
||||
|
||||
Reference in New Issue
Block a user