Skip to content

Commit

Permalink
Revert filters
Browse files Browse the repository at this point in the history
  • Loading branch information
annndruha committed Sep 7, 2023
1 parent 046750e commit cbb909c
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,12 @@ def filter(self, message):

if __name__ == '__main__':
application = ApplicationBuilder().token(settings.BOT_TOKEN).build()
only_text = filters.UpdateType.MESSAGE & filters.TEXT
only_caption = filters.UpdateType.MESSAGE & filters.ATTACHMENT & filters.CAPTION

application.add_handler(CommandHandler('start', handler_start, filters=only_text))
application.add_handler(CommandHandler('help', handler_help, filters=only_text))
application.add_handler(CommandHandler('md_guide', handler_md_guide, filters=only_text))
application.add_handler(CommandHandler('issue', handler_message, filters=only_text | only_caption))
application.add_handler(CommandHandler('start', handler_start))
application.add_handler(CommandHandler('help', handler_help))
application.add_handler(CommandHandler('md_guide', handler_md_guide))
application.add_handler(CommandHandler('issue', handler_message))
application.add_handler(CallbackQueryHandler(handler_button))
application.add_handler(MessageHandler(StartWithBotMention() & only_text, handler_message))
application.add_handler(MessageHandler(StartWithBotMention() & only_caption, handler_message))
application.add_handler(MessageHandler(filters.ChatType.PRIVATE & only_text, handler_message))
application.add_handler(MessageHandler(filters.ChatType.PRIVATE & only_caption, handler_message))
application.add_handler(MessageHandler(StartWithBotMention(), handler_message))
application.add_handler(MessageHandler(filters.ChatType.PRIVATE, handler_message))
application.add_error_handler(native_error_handler)
application.run_polling()

0 comments on commit cbb909c

Please sign in to comment.