Changeset 6623428 in python-cinema-club-bot for main.py


Ignore:
Timestamp:
Oct 9, 2024, 10:46:19 PM (5 weeks ago)
Author:
Mikhail Kirillov <w96k@…>
Branches:
master
Children:
9be02d9
Parents:
0d48ea2
git-author:
Mikhail Kirillov <w96k@…> (10/09/24 04:53:26)
git-committer:
Mikhail Kirillov <w96k@…> (10/09/24 22:46:19)
Message:

Add movies commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.py

    r0d48ea2 r6623428  
    1717import logging
    1818
    19 from strings import INVALID_COMMAND
     19from strings import INVALID_COMMAND, UNDEFINED_ERROR
    2020from persistence import Persistence
    2121import commands
     
    3939    logging.error("Exception:", exc_info=context.error)
    4040
     41    error_message = context.error.message \
     42        if hasattr(context.error, "message") else UNDEFINED_ERROR
     43
    4144    await context.bot.send_message(
    4245        chat_id=update.effective_chat.id,
    43         text=context.error.message
     46        text=error_message
    4447    )
    4548
     
    5356
    5457    # Movie commands
     58    app.add_handler(CommandHandler("movie", commands.movie))
     59    app.add_handler(CommandHandler("movies", commands.movies))
     60    app.add_handler(CommandHandler("movies_remove", commands.remove_movies))
     61   
     62    # Users commands
    5563    app.add_handler(CommandHandler("set", commands.set_users))
    5664    app.add_handler(CommandHandler("add", commands.add_users))
     
    5866    app.add_handler(CommandHandler("remove", commands.remove_users))
    5967    app.add_handler(CommandHandler("chooser", commands.chooser_user))
     68    app.add_handler(CommandHandler("next", commands.who_is_next))
    6069
    6170    app.add_handler(MessageHandler(filters.COMMAND, unknown))
Note: See TracChangeset for help on using the changeset viewer.