Answer the question
In order to leave comments, you need to log in
How to answer a word from a sentence?
Tell me please.
I have a bot that reacts to certain words and then sends the text.
But the problem is that if a person writes a keyword in a sentence, then the bot will not respond.
Example:
Member: test
Bot: test - is in the list!
Participant: I'll go test
Bot: Doesn't react, but I wanted to.
How can this be fixed?
Thank you.
reac_words = [ 'test', 'test1']
slovo = None
@client.event
async def on_message(message):
msg = message.content.lower()
if msg in reac_words:
slovo = msg
await message.channel.send('{} - есть в списке!'.format(slovo))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question