Step 1: Set-up the Member Fields

  1. Go to your BotDisco Dashboard

  2. Click on the Member Fields tab on your left

  3. Now create 3 Member Fields as follows:






To store the last message of the user



To store the 2nd last message of the user



To store the 3rd last message of the user

Step 2: Create a Trigger for Channel Message on BotDisco's Dashboard

Create a New Flow in the BotDisco's Dashboard. Trigger that flow by selecting new message in the channel.

Step 3: Update values in the Member Fields of the user

Next, update the member fields that you created in Step 1 each time a message is send in a channel.

Click "Add Action" and then select "Set Member Field" option. You'll need to do this 3 times as there are 3 member fields to be updated.

Step 4: Check if the last 3 messages of the user is same, if yes then send a warning

Now since all the member fields are updated, you'll need to check if all those 3 Member Fields are same or not.

  1. Click "Add Action" and select "Filter".

  2. Check if member field last_msg is equal to 2nd_last_msg

  3. Add another condition as "AND" and check if, 2nd_last_msg is equal to 3rd_last_msg

  4. If they are same, the message is a spam. So send a warning in the channel to the user who sent the spam message.

Step 5: Finally, test the trigger in your server

Did this answer your question?