Answer the question
In order to leave comments, you need to log in
How to search for multiple words in a sentence?
Hello! I am writing a second bot based on pyTelegramBotApi (telebot), it should respond to stop words that can be set by the command, but the problem is that I need to somehow search for these words, and it would be logical to use the method message.text.lower().find([stopwords])
with the template used 'word ', 'word', 'word', but this is not supported in the .find() function. How to search for multiple words in a sentence?
Thanks in advance
Answer the question
In order to leave comments, you need to log in
It seems that even those who do not know how to program rushed to write bots. I hope this wave does not come to medicine.
Write your own function, where you pass the text and a set of words, and inside the loop, look for each one until you find the first one that comes across.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question