Automation library · Chat assistants

Automated Discord spam moderation with OpenAI

Started by a clock, and works across Discord. It hands the judgement calls to OpenAI. 23 steps, 2 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

23 stepsLarge: read it before trusting it with anything live
2Branches: places the flow splits
1Loop or waits
1Service it connects to

The flow

Starts it 2Model 2Logic 14Service 5

The steps in the order they run, from what starts it.

  1. 1ModelLm Chat Open AiModel
  2. 2When Executed by Another WorkflowExecute Workflow triggerStarts it
  3. 3Schedule TriggerSchedule triggerStarts it
  4. 4Spam DetectionText ClassifierModel
  5. 5Notify Moderators with Send & WaitDiscordService
  6. 6Get Recent MessagesDiscordService
  7. 7Flag as SpamSetLogic
  8. 8Flag as Not SpamSetLogic
  9. 9Receive InstructionsSwitchLogic
  10. 10Only OnceRemove DuplicatesLogic
  11. 11MergeMergeLogic
  12. 12Get Message IDsCodeLogic
  13. 13Warn User OnlyDiscordService
  14. 14No Action TakenNo OpLogic
  15. 15Group By UserCodeLogic
  16. 16Spam Messages OnlyFilterLogic
  17. 17Delete MessagesDiscordService
  18. 18Split OutSplit OutLogic
  19. 19Has Flagged Messages?IfLogic
  20. 20Warn UserDiscordService
  21. 21For Each User...Split In BatchesLogic
  22. 22Moderation SubworkflowExecute WorkflowLogic
  23. 23Message to ListCodeLogic

How it's built

Starts on
A clock
Steps
23, with 2 branches, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Discord
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Discord account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 23 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 23 steps before you point it at anything that matters.