Automated discord spam moderation with AI and human-in-the-loop
Ready for 3.0What this workflow does
This AI workflow has 23 nodes and runs on a schedule (every hour) (plus 1 other trigger). Along the way it connects Discord and OpenAI Chat Model.
How it runs
Trigger: On a schedule (every hour) (plus 1 other trigger).
- Get Recent Messages (Discord): get many (message)
- Notify Moderators with Send & Wait (Discord): send and wait for a reply (message)
- Only Once (Remove Duplicates): removes duplicate items
- Receive Instructions (Switch): routes items into 3 branches
- Group By User (Code): runs custom JavaScript code
- Get Message IDs (Code): runs custom JavaScript code
- Warn User Only (Discord): work with message
- Split Out: splits a list into separate items
- Delete Messages (Discord): delete message
- For Each User... (Loop Over Items (Split in Batches)): loops over the items in batches
…plus 9 more steps. See the full node list below.
Services it uses
Other OpenAI + Discord templates (89)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (16)
- Text Classifier
@n8n/n8n-nodes-langchain.textClassifier - Discord
n8n-nodes-base.discord - Remove Duplicates
n8n-nodes-base.removeDuplicates - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Code
n8n-nodes-base.code - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Split Out
n8n-nodes-base.splitOut - Edit Fields (Set)
n8n-nodes-base.set - Merge
n8n-nodes-base.merge - Filter
n8n-nodes-base.filter - If
n8n-nodes-base.if - Switch
n8n-nodes-base.switch - Execute Sub-workflow
n8n-nodes-base.executeWorkflow - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - No Operation, do nothing
n8n-nodes-base.noOp - Schedule Trigger
n8n-nodes-base.scheduleTrigger
From the author
This n8n template demonstrates how you can automate community moderation using human-in-the-loop functionality for Discord. The use-case is for detecting and dealing with spam messages in a predefined and consistent way. Human-in-the-loop allows for a balance…