Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions bot/handlers/subscription_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@
def start_task_subscription(update: Update, context: CallbackContext):
context.user_data[states.SUBSCRIPTION_FLAG] = user_db.change_subscription(update.effective_user.id)
user_db.archive_reason_cancelling(update.effective_user.id)
user_categories = [
category['name'] for category in user_db.get_categories(update.effective_user.id)
if category['user_selected']
]
user_categories = ', '.join(
[category['name'] for category
in user_db.get_categories(update.effective_user.id)
if category['user_selected']]
)
if not user_categories:
user_categories = 'Категории ещё не выбраны'
answer = f'Отлично! Теперь я буду присылать тебе уведомления о ' \
f'новых заданиях в ' \
f'категориях: *{", ".join(user_categories)}*.\n\n' \
f'категориях: *{user_categories}*.\n\n' \
f'А пока можешь посмотреть открытые задания.'

update.callback_query.edit_message_text(
Expand Down