Overview
This n8n node retrieves messages from a specified Discord channel using the Discord API. It can also optionally provide a list of unique usernames (excluding bots) who have posted messages in that channel. This node is useful for workflows that need to analyze, archive, or process Discord conversations, or to extract participant lists for reporting or moderation purposes.
Example scenarios:
- Archiving recent messages from a Discord channel.
- Generating a report of all unique users who participated in a discussion.
- Triggering actions based on message content or user activity in a Discord server.
Properties
| Name | Meaning |
|---|---|
| Channel ID | The ID of the Discord channel from which to retrieve messages. |
| Limit | Max number of results to return. Controls how many messages are fetched from the channel (default: 50). |
| Authorization Bot Token | The authorization token for the Discord API. Required for authenticating as a bot. |
| Unique Users | If true, includes a row with all unique message author usernames (excluding bots) in the output. |
Output
- Each message retrieved from the Discord channel is output as an individual item in the
jsonfield, containing the full message object as returned by the Discord API. - If Unique Users is enabled, an additional item is included with the structure:
This array contains all unique, non-bot usernames found among the message authors.{ "username": ["user1", "user2", ...] }
Dependencies
- Requires a valid Discord Bot Token with permission to read messages in the target channel.
- Internet access to connect to the Discord API (
https://discord.com/api/v8/channels/{channelId}/messages).
Troubleshooting
Invalid Bot Token / Unauthorized:
Error if the provided Authorization Bot Token is invalid or lacks permissions.
Resolution: Ensure the token is correct and the bot has access to the channel.Channel Not Found / Forbidden:
Error if the Channel ID is incorrect or the bot does not have access.
Resolution: Double-check the Channel ID and bot permissions.API Rate Limits:
Discord may rate-limit excessive requests.
Resolution: Reduce frequency or number of requests.Common error messages:
401: Unauthorized: Invalid or missing bot token.403: Forbidden: Bot lacks permission to access the channel.404: Not Found: Channel ID is incorrect.