So, I'm trying to make my bot respond whenever a certain word is said in a sentence (the language is Serbian), so I made this code:
"Popio sam lav"
it responds as it should.
But, the problem is that the word "lav" is also part in other words, for example:
"Nebo je plavo"
so the bot responds here as well and I want to block that.
I am just starting to play with python, so I would really appreciate help, tnx :)
if (message.text.lower().find('lav') != -1): bot.send_message(message.chat.id, "Najgore pivo...")Now, the bot is doing what I would like, when some somebody says:
"Popio sam lav"
it responds as it should.
But, the problem is that the word "lav" is also part in other words, for example:
"Nebo je plavo"
so the bot responds here as well and I want to block that.
I am just starting to play with python, so I would really appreciate help, tnx :)