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
6 changes: 4 additions & 2 deletions opds_catalog/management/commands/sopds_telebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,13 @@ def start(self):
updater = Updater(token=config.SOPDS_TELEBOT_API_TOKEN)
start_command_handler = CommandHandler('start', self.startCommand)
getBook_handler = MessageHandler(Filters.text, self.getBooks)
download_handler = RegexHandler('^/download\d+$',self.downloadBooks)
#fix deprecated RegexHandler See https://git.io/fxJuV for more info
download_handler = MessageHandler(Filters.regex('^/download\d+$'),self.downloadBooks)

updater.dispatcher.add_handler(start_command_handler)
updater.dispatcher.add_handler(getBook_handler)
#change order of handlers, to handle download(regexp) before common text(book name)
updater.dispatcher.add_handler(download_handler)
updater.dispatcher.add_handler(getBook_handler)
updater.dispatcher.add_handler(CallbackQueryHandler(self.botCallback))

updater.start_polling(clean=True)
Expand Down