Changeset 69dd60c in python-cinema-club-bot for commands/announce.py


Ignore:
Timestamp:
Oct 11, 2024, 1:53:24 AM (5 weeks ago)
Author:
Mikhail Kirillov <w96k@…>
Branches:
master
Children:
ac7b16a
Parents:
694d823
Message:

Task #30. Allow anyone create or edit upcoming event

File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands/announce.py

    r694d823 r69dd60c  
    1313from telegram.ext import ContextTypes
    1414
    15 from strings import ANNOUNCEMENT_TEMPLATE, ANNOUNCEMENT_FINISHED_EVENT
     15from strings import ANNOUNCEMENT_TEMPLATE, ANNOUNCEMENT_FINISHED_EVENT, \
     16    ANNOUNCEMENT_EVENT_NEEDS_EDITING
    1617from utils import context_init, create_users_string, choose_next_user
    1718from predicates import has_unfinished_event
     
    3233        last_movie = movies[-1]
    3334
    34         genres = " #".join(last_movie["genres"])
     35        if last_event["when"] is None or last_event["where"] is None or last_event["movie"] is None:
     36            raise error.TelegramError(ANNOUNCEMENT_EVENT_NEEDS_EDITING)
     37
     38        genres ="#" + " #".join(last_movie["genres"])
    3539
    3640        await update.message.reply_markdown(
Note: See TracChangeset for help on using the changeset viewer.