C
C
Cyril2020-04-22 21:31:26
Python
Cyril, 2020-04-22 21:31:26

How to filter text by character in python-telegram-bot?

The user enters a question and I process it like this:

updater.dispatcher.add_handler(MessageHandler(Filters.text, question_update))


But the next handler returns to the previous one, because, as I understand it, there is a filter for any text there.
updater.dispatcher.add_handler(MessageHandler(Filters.regex("Добавить вариант ответа"), votes)


How to set a filter so that there is some text that necessarily contains a question mark?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-04-22
@shabelski89

standard means of python?

if message.text.find('?') != -1:
   print('ok')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question