fix: infra

This commit is contained in:
2026-01-28 12:40:49 +03:00
parent c4abcbdfa9
commit 0ceb92b3be
2 changed files with 21 additions and 10 deletions

View File

@ -10,8 +10,9 @@ services:
POSTGRES_DB: bdbot POSTGRES_DB: bdbot
ports: ports:
- "5432:5432" - "5432:5432"
# Persist data in a local folder ./postgres_data
volumes: volumes:
- postgres_data:/var/lib/postgresql/data - ./postgres_data:/var/lib/postgresql/data
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"] test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s interval: 10s
@ -32,6 +33,3 @@ services:
env_file: env_file:
- .env - .env
restart: unless-stopped restart: unless-stopped
volumes:
postgres_data:

View File

@ -265,13 +265,26 @@ def ask_preference_theme(bot: telebot.TeleBot, user_id: int) -> None:
"""Ask user to select preference theme.""" """Ask user to select preference theme."""
keyboard = types.InlineKeyboardMarkup(row_width=2) keyboard = types.InlineKeyboardMarkup(row_width=2)
for theme in THEMES: # Show hobbies (themes) in 2 buttons per row
emoji = get_theme_emoji(theme) for i in range(0, len(THEMES), 2):
button = types.InlineKeyboardButton( theme1 = THEMES[i]
text=f"{emoji} {theme}", emoji1 = get_theme_emoji(theme1)
callback_data=f'theme_{theme}' 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( bot.send_message(
user_id, user_id,