fix: infra
This commit is contained in:
@ -10,8 +10,9 @@ services:
|
||||
POSTGRES_DB: bdbot
|
||||
ports:
|
||||
- "5432:5432"
|
||||
# Persist data in a local folder ./postgres_data
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 10s
|
||||
@ -32,6 +33,3 @@ services:
|
||||
env_file:
|
||||
- .env
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
@ -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