B
B
bybacapitan2022-04-16 00:57:29
Python
bybacapitan, 2022-04-16 00:57:29

How to make the bot react to messages inside the text?

Hello, I ran into such a problem: I have a telegram bot that responds to messages and sends a text.
And it can only respond to a message with one given word, like

if message.text.lower() == "ясно":
await bot.send_message(message.chat.id, "погода ясная")


And here is the question, how to make the bot pull the word "clear" out of context, for example, "it was clear today on the street, right?"
and answered the same
await bot.send_message(message.chat.id, "погода ясная")

Help me please)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Krostelev, 2022-04-16
@bybacapitan

if "ясно" in message.text.lower():
    ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question