IMPORTANT: This tutorial expects that you’ve already done the ping command tutorial so you can understand the basics of making flows, placing blocks, and inserting variables.
In this tutorial, we will be building a simple flow that replies to a message if it contains a specific word.
Step 1 - Enable Message Content Intent
If the intent is already enabled for your bot, this step may not be required.
This flow uses the content of messages to conditionally send replies, which requires the Message Content intent to be enabled on your bot.
If you haven’t already, please enable the intent on the Discord Developer Portal, then go to the Intent Settings page on Inventor and enable the intent.
Step 2 - Set Message Sent Trigger
Flow triggers decide what action will start your flow. In this case, because we’re making a conditional reply, we want to trigger our flow when a message is sent.
Pick Message Sent from the trigger list.
Step 3 - Add If Statement Block
Now that we have the Message Create trigger, we need to check if the message contains a specific word. To do this, we’ll use the If Statement block.
Click the Add Block button, and select If Statement.
Step 4 - Fill in If Statement
On the left side of the if statement, use the insert variable menu to insert the Message Content variable from the Message Sent trigger.
For this example, we’ll check if the message contains the word hello, but you can write in any word on the right side that you want to check for.
In the middle of the if statement, pick the comparison operator contains from the dropdown.
Step 5 - Add Send Message Block
Now that we have the If Statement block, we need to send a message if the message contains the word hello. To do this, we’ll use the Send Message block.
Click the Add Block button, and select Send Message.
Once you add the block, you can customize the message that will be sent and the channel that it will be sent in. For this example, we used the channel from the original Message Sent trigger, and set the new message to reply to the old one.
Step 6 - Move Send Message Block into If Statement
Now that we have the Send Message block, we need to move it into the If Statement block. To do this, click and drag the Send Message block into the Drag area under the If Statement block.
Once the Send Message block is nested inside the If Statement block, it will only run if the if statement passes (which happens when the message contains the word hello).
Step 7 - You’re Done!
Go over to Discord to test it out. It should reply to any message that contains the word hello.
If you’re confused or have any issues, ask in Support. We’re happy to help!