T
T
tostera2020-01-14 11:06:21
Python
tostera, 2020-01-14 11:06:21

How to make the bot respond to commands of any case?

I have a command in the bot, for example "/question"
How can I make the bot react to "/Question", "/Question", "/QUESTION", etc. Or do you have to enter everything manually? ._.

if "/вопрос" in event.text or "/Вопрос" in event.text or ... :

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Shubin, 2020-01-14
@tostera

Convert everything to the same case, e.g. lowercase: More on string methods (including lower): https://docs.python.org/3/library/stdtypes.html#st...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question