mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-17 04:39:55 +01:00
Refine Filters in examples (#2027)
This commit is contained in:
parent
d6f8077a50
commit
2789fd2bff
5 changed files with 15 additions and 15 deletions
|
@ -130,7 +130,7 @@ def main():
|
|||
LOCATION: [MessageHandler(Filters.location, location),
|
||||
CommandHandler('skip', skip_location)],
|
||||
|
||||
BIO: [MessageHandler(Filters.text, bio)]
|
||||
BIO: [MessageHandler(Filters.text & ~Filters.command, bio)]
|
||||
},
|
||||
|
||||
fallbacks=[CommandHandler('cancel', cancel)]
|
||||
|
|
|
@ -116,13 +116,13 @@ def main():
|
|||
custom_choice)
|
||||
],
|
||||
|
||||
TYPING_CHOICE: [MessageHandler(Filters.text,
|
||||
regular_choice)
|
||||
],
|
||||
TYPING_CHOICE: [
|
||||
MessageHandler(Filters.text & ~(Filters.command | Filters.regex('^Done$')),
|
||||
regular_choice)],
|
||||
|
||||
TYPING_REPLY: [MessageHandler(Filters.text,
|
||||
received_information),
|
||||
],
|
||||
TYPING_REPLY: [
|
||||
MessageHandler(Filters.text & ~(Filters.command | Filters.regex('^Done$')),
|
||||
received_information)],
|
||||
},
|
||||
|
||||
fallbacks=[MessageHandler(Filters.regex('^Done$'), done)]
|
||||
|
|
|
@ -58,7 +58,7 @@ def main():
|
|||
dp.add_handler(CommandHandler("help", help_command))
|
||||
|
||||
# on noncommand i.e message - echo the message on Telegram
|
||||
dp.add_handler(MessageHandler(Filters.text, echo))
|
||||
dp.add_handler(MessageHandler(Filters.text & ~Filters.command, echo))
|
||||
|
||||
# Start the Bot
|
||||
updater.start_polling()
|
||||
|
|
|
@ -284,7 +284,7 @@ def main():
|
|||
states={
|
||||
SELECTING_FEATURE: [CallbackQueryHandler(ask_for_input,
|
||||
pattern='^(?!' + str(END) + ').*$')],
|
||||
TYPING: [MessageHandler(Filters.text, save_input)],
|
||||
TYPING: [MessageHandler(Filters.text & ~Filters.command, save_input)],
|
||||
},
|
||||
|
||||
fallbacks=[
|
||||
|
|
|
@ -126,13 +126,13 @@ def main():
|
|||
custom_choice),
|
||||
],
|
||||
|
||||
TYPING_CHOICE: [MessageHandler(Filters.text,
|
||||
regular_choice),
|
||||
],
|
||||
TYPING_CHOICE: [
|
||||
MessageHandler(Filters.text & ~(Filters.command | Filters.regex('^Done$')),
|
||||
regular_choice)],
|
||||
|
||||
TYPING_REPLY: [MessageHandler(Filters.text,
|
||||
received_information),
|
||||
],
|
||||
TYPING_REPLY: [
|
||||
MessageHandler(Filters.text & ~(Filters.command | Filters.regex('^Done$')),
|
||||
received_information)],
|
||||
},
|
||||
|
||||
fallbacks=[MessageHandler(Filters.regex('^Done$'), done)],
|
||||
|
|
Loading…
Add table
Reference in a new issue