I was planning to make a grammar bot for fun, and I want it to find certain keywords inside a message, rather than just asking if it is ONLY that keyword. I haven't found anything close to what I want. Help?
Assuming you want to check each message that is sent, you can check message.content
in the on_message
event for the keywords using normal Python. Example code below, where the code will check if FOO is in the message.
@bot.event
async def on_message(message):
if 'FOO' in message.content:
print('Keyword found in message')
# Do stuff here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With