This is an n8n community node package that provides nodes to interact with the Discord API via a Discord bot, allowing you to automate Discord workflows.
This package provides two nodes:
- Discord Trigger DND: Triggers workflows based on Discord events
- Discord Action DND: Performs actions in Discord channels and conversations
The Discord Trigger node allows you to start n8n workflows when specific Discord events occur. It supports a wide range of trigger types:
- Message: Listen for message-related events like message creation, deletion, updates, and reactions
- Guild: Events related to servers, channels, and threads
- Moderation: Ban events and audit log entries
- Emoji & Sticker: Track emoji and sticker changes in a server
- Integration & Webhook: Monitor integration and webhook updates
- Invite: Track creation and deletion of invites
- Voice: Monitor voice channel activities
- Presence: Track user presence status changes
- Scheduled Event: Listen for scheduled events in servers
- Interaction: Handle interactions like slash commands
- Bot Status: Get bot-related events like ready status
- User: User updates and guild member events
- Auto Moderation: Auto-moderation rule events
- Poll: Discord poll events
For message triggers, you can filter based on:
- Bot mentions
- Message content (contains, starts with, ends with, equals, regex)
- Direct messages
- Server, channel, role, and user filters
The Discord Action node allows you to perform actions in Discord:
- Send typing indicator
- Send messages (with text, embeds, and files)
- Delete messages
- Edit messages
- React to messages
- Remove reactions
- Pin/unpin messages
npm install n8n-nodes-discord-dnd
In your n8n installation:
- Go to Settings > Community Nodes
- Click Install a node
- Enter
n8n-nodes-discord-dnd
and click Install
- Create a Discord bot on the Discord Developer Portal
- Create a new Discord API DND credential in n8n
- Enter your Bot Token and Application ID
- Enable necessary Privileged Intents for your bot (Message Content)
- Invite the bot to your server with appropriate permissions
- Add a Discord Trigger DND node
- Set trigger type to "Message"
- Set event to "Message Create"
- Configure pattern (e.g., "Bot Mention" or "Starts With" with a command prefix)
- Connect to a Discord Action DND node
- Set action type to "Message"
- Set action to "Send Message"
- Configure the message content
- Add a Discord Trigger DND node
- Set trigger type to "Guild"
- Set event to "Channel Update"
- Connect to nodes that process and store the channel update data
Source code: https://github.com/nguyendanhda98/n8n-nodes-discord-dnd
-
Bot not responding to messages
- Make sure you've enabled the "Message Content Intent" in the Discord Developer Portal
- Verify the bot has proper permissions in the Discord server
- Check if the pattern configuration matches your message format
-
Missing events
- Some events require specific intents to be enabled on your bot
- Make sure the bot has the necessary permissions in the server
-
Authentication errors
- Verify your Bot Token and Application ID are correct
- Make sure your bot hasn't been reset or regenerated in the Discord Developer Portal
If you encounter any issues not covered here, please create an issue on GitHub.
If you want to contribute, please fork the repository and submit a pull request.
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature/your-feature
) - Create a new Pull Request
- Initial public release
- Added Discord Trigger node with multiple event types
- Added Discord Action node with message actions
- Setup documentation and repository information