🤖 Discord message proxy: Bot mentions → AI actions
Need help? Want access to this workflow + many more paid workflows + live Q&A sessions with a top verified n8n creator?
🔍 What It Does
Listens for @mentions of your bot in Discord channels (without a native trigger).
Filters noise: Only processes messages:
From authorized users (configurable).
That mention your bot.
Sent today (skips old messages).
Forwards cleaned messages to any webhook (e.g., your AI agent, like the GitHub MCP Server).
Replies in Discord with the webhook’s response.
🛠️ Key Features
⚡ No Community Nodes: Uses official n8n nodes only (security-first!).
🔒 Role-Based Access: Restrict bot usage to specific users.
🗑️ Deduplication: Avoids processing the same message twice.
🔄 Scheduled Checks: Runs every X minutes (adjustable in the Schedule Trigger).
🚀 Use Cases
Chat with your AI bot via Discord mentions.
Moderate channels: Auto-flag messages or ping moderators.
Build custom commands: Trigger workflows by mentioning your bot.
⚙️ Setup Guide
🤖 Update Credentials: Ensure your Discord bot has Read Messages and Send Messages permissions.
🔧 Configure Variables: In the "Set Values" node:
discordServerId: Your server’s ID.
botId: Your bot’s user ID.
authorizedUser: Who can trigger the bot (user ID).
🌐 Webhook Target: Point the HTTP Request node to your AI/webhook endpoint.
⏱️ Adjust Polling: Change the Schedule Trigger interval (default: every minute).
Note: This polls channels instead of true event-based triggers—tradeoffs time for security!
Discord Message Proxy Bot Mentions & AI Actions
This n8n workflow acts as a sophisticated proxy for Discord messages, specifically designed to process messages where a bot is mentioned. It filters out duplicate mentions, extracts relevant information, and sets up a framework for potential AI-driven actions or further processing.
What it does
This workflow automates the following steps:
- Triggers on a Schedule: The workflow is set to run at regular intervals, checking for new messages or events.
- Fetches Discord Messages: It makes an HTTP request to a Discord API endpoint to retrieve messages. This is likely configured to fetch messages from a specific channel or server.
- Filters for Bot Mentions: It processes the fetched messages and filters them, presumably to only include messages where a bot (or a specific user/role) has been mentioned.
- Removes Duplicate Mentions: To prevent redundant processing, the workflow identifies and removes any duplicate messages or mentions that might have been captured.
- Edits Fields for Processing: It transforms and sets specific fields from the Discord message data, preparing it for subsequent steps. This could involve extracting the message content, author, channel ID, etc.
- Prepares for AI Actions (Code Node): A "Code" node is included, indicating a place where custom JavaScript logic can be added. This is a placeholder for integrating AI models, natural language processing, or other custom computations based on the Discord message content.
- Sends Message to Discord: Finally, it uses the Discord node to send a message back to Discord. This could be a response from an AI, a confirmation, or a forwarded message.
Prerequisites/Requirements
- Discord Bot Token: A Discord bot account and its token are required to fetch messages and post responses.
- Discord API Endpoint: Knowledge of the specific Discord API endpoint for fetching messages.
- n8n Instance: An active n8n instance to run the workflow.
- Custom AI/Logic (Optional): If the "Code" node is to be utilized for AI actions, access to an AI service (e.g., OpenAI, custom ML model) or specific JavaScript logic will be needed.
Setup/Usage
- Import the Workflow: Import the provided JSON into your n8n instance.
- Configure Discord Credentials:
- Open the "HTTP Request" node and ensure it's configured with the correct Discord API endpoint and any necessary authentication headers (e.g., your bot token).
- Open the "Discord" node and configure your Discord bot credentials.
- Adjust Schedule Trigger: Modify the "Schedule Trigger" node to your desired interval for checking new messages.
- Customize Filter Logic: Review the "Filter" node to ensure its conditions correctly identify bot mentions or the specific messages you want to process.
- Implement AI/Custom Logic:
- Open the "Code" node.
- Add your custom JavaScript code to process the Discord message data. This is where you would integrate calls to AI services or implement specific business logic.
- Activate the Workflow: Once configured, activate the workflow to start processing Discord messages.
Related Templates
🛠️ Nextcloud tool MCP server 💪 all 17 operations
Need help? Want access to this workflow + many more paid workflows + live Q&A sessions with a top verified n8n creator? Join the community Complete MCP server exposing all Nextcloud Tool operations to AI agents. Zero configuration needed - all 17 operations pre-built. ⚡ Quick Setup Import this workflow into your n8n instance Activate the workflow to start your MCP server Copy the webhook URL from the MCP trigger node Connect AI agents using the MCP URL 🔧 How it Works • MCP Trigger: Serves as your server endpoint for AI agent requests • Tool Nodes: Pre-configured for every Nextcloud Tool operation • AI Expressions: Automatically populate parameters via $fromAI() placeholders • Native Integration: Uses official n8n Nextcloud Tool tool with full error handling 📋 Available Operations (17 total) Every possible Nextcloud Tool operation is included: 📄 File (6 operations) • Copy a file • Delete a file • Download a file • Move a file • Share a file • Upload a file 📁 Folder (6 operations) • Copy a folder • Create a folder • Delete a folder • List a folder • Move a folder • Share a folder 👤 User (5 operations) • Create a user • Delete a user • Get a user • Get many users • Update a user 🤖 AI Integration Parameter Handling: AI agents automatically provide values for: • Resource IDs and identifiers • Search queries and filters • Content and data payloads • Configuration options Response Format: Native Nextcloud Tool API responses with full data structure Error Handling: Built-in n8n error management and retry logic 💡 Usage Examples Connect this MCP server to any AI agent or workflow: • Claude Desktop: Add MCP server URL to configuration • Custom AI Apps: Use MCP URL as tool endpoint • Other n8n Workflows: Call MCP tools from any workflow • API Integration: Direct HTTP calls to MCP endpoints ✨ Benefits • Complete Coverage: Every Nextcloud Tool operation available • Zero Setup: No parameter mapping or configuration needed • AI-Ready: Built-in $fromAI() expressions for all parameters • Production Ready: Native n8n error handling and logging • Extensible: Easily modify or add custom logic > 🆓 Free for community use! Ready to deploy in under 2 minutes.
Control your discord server with natural language via GPT4o and MCP Client
What it is- Very simple connection to your Discord MCP Server and 4o. How to set it up- Just specify your MCP Server's url, select your OpenAI credential, and you're set! How to use it- You can now send a chat message to the production URL from anywhere and the actions will occur on discord! It really is that easy. Note: If you don't yet have a Discord MCP server set up, there is a template called "Discord MCP Server" to get you a jumpstart! Need help? Want access to more workflows and even live Q&A sessions with a top verified n8n creator.. All 100% free? Join the community
Control Discord bot with natural language via MCP server
What it is- I wanted to create a simple, easy-to-use, MCP server for your Discord bot(s). How to set up- Literally all you do is select your bot auth (or crease a new Discord Bot auth if you havn't entered your key in n8n before) and that's IT! How to use it- You can now ask your bot to do things via any MCP client, including from within N8N workflows! Note: If you need an example, you can check out my simple quickstart Discord MCP Server that uses 4o to send messages to channels on your server and users who are members of the server the bot is in. Need help? Want access to more workflows and even live Q&A sessions with a top verified n8n creator.. All 100% free? Join the community