You are helping me build the following AI agent workflow. ## Goal Discord AI: Monitors Discord messages, uses AI to categorize requests, and routes them to the correct channels automatically. ## Specification - What it does: You get your Discord requests sorted instantly as AI analyzes messages and routes them directly to the correct channels. This keeps your server organized by automatically sending responses to the right groups without manual sorting. - Trigger: Triggered by an event (Event ยท on new message) - Autonomy: Fully hands-off - Expected setup effort: under an hour - Tools/services involved: - Discord: User interaction and routing messages to channels - OpenAI: Analyzing and categorizing user requests via prompt ## Known pitfalls, handle each one explicitly in your implementation 1. The bot will trigger on its own messages if not filtered, so check msg.author.bot before processing. 2. Discord permissions may block channel routing, ensure the bot has Manage Channels and Send Messages rights in target channels. 3. Long messages might exceed token limits, truncate input text to fit within the model's context window safely. ## Reference implementation https://n8n.io/workflows/1938 (workflow template) Fetch and inspect this before building. If it matches my stack, adapt it; if not, rebuild the pattern with my tools. ## Process requirements 1. Before building: ask me which of the listed tools I actually use and what my platform is (n8n / Make / code / other). Do not assume. 2. Adapt the pattern to my answers; do not force the reference stack. 3. Address every pitfall above; tell me how you handled each. 4. Provide a test plan I can run before letting this touch real data. 5. Ask before any step that sends messages, modifies data, or spends money. Source: https://usecasesforagents.com/use-case/discord-ai-bot/ via usecasesforagents.com