Python Forum

Full Version: discord bot (detect when someone types certain words)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hello,
I am currently working on a discord bot and i have a question. how do i detect when someone in the discord chat types certain word combinations and then execute command? Anyone who knows how to make discord bot here?
Thanks!
Without seeing any code, it'd probably look something like this:
class Bot(DiscordBotBase):
    def on_message(self, message):
        if "spammity spam" in message:
            self.send("Would you like spam with your Spam, Spam, Eggs, Bacon and Spam?")