Discord
connector.discord · connector.discord_trigger · communication
Send and manage messages, channels, members, roles and reactions with a Discord bot, post through channel webhooks, and poll channels for new messages.
Vendor API documentation: https://docs.discord.com/developers/reference
Authentication
| Method | Credential kind | Auth kind | Fields | Test request |
|---|---|---|---|---|
| Bot token | discord/bot_token | bearer | token (secret) | yes |
| OAuth2 (user access) | discord/oauth2 | oauth2_auth_code | client_id, client_secret (secret) | yes |
| Webhook URL | discord/webhook | api_key | webhook_url (secret) | yes |
| No credential (webhook URL parameter) | discord/none | none |
Actions
Node type connector.discord. Choose a resource and an operation; each operation has its own parameters.
Message
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Send a message | message.send | writes | 3 | |
| Send a message with a file | message.send_file | writes | 1 | |
| Get a message | message.get | reads | 2 | |
| List messages | message.list | reads | yes | 1 |
| Edit a message | message.update | writes | 1 | |
| Delete a message | message.delete | writes | 1 | |
| Delete many messages | message.bulk_delete | writes | 1 | |
| Add a reaction | message.react | writes | 2 | |
| Remove own reaction | message.remove_reaction | writes | 1 | |
| Pin a message | message.pin | writes | 1 | |
| Unpin a message | message.unpin | writes | 1 | |
| List pinned messages | message.list_pins | reads | yes | 1 |
Send a message
Operation message.send.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Server whose channels are listed in the channel picker. Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
content | string | Message text (up to 2000 characters). | |||
embeds | json | Array of up to 10 embed objects. | |||
components | json | Array of action rows (buttons, select menus). | |||
reply_to | string | ID of a message to reply to. | |||
tts | boolean | false | |||
suppress_embeds | boolean | false | |||
silent | boolean | false | Send without a push notification. | ||
flags | multi_options | Message flags by name (same effect as the switches above). One of SUPPRESS_EMBEDS, SUPPRESS_NOTIFICATIONS. | |||
allowed_mentions | json | Allowed mentions object, for example {“parse”: [“users”]}. | |||
sticker_ids | json | Up to 3 sticker IDs. |
Send a message with a file
Operation message.send_file.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
binary_property | binary_property | "data" | yes | ||
file_name | string | Defaults to the binary file name. | |||
file_description | string | Alt text for the attachment. | |||
content | string | ||||
embeds | json | ||||
reply_to | string | ||||
silent | boolean | false |
Get a message
Operation message.get.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
message | resource_locator | yes | Depends on channel. Values from lookup messages. |
List messages
Operation message.list. Lists channel messages, newest first.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
before | string | Only messages older than this message ID. | |||
return_all | boolean | false | |||
limit | number | 50 | return_all = false |
Edit a message
Operation message.update.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
message | resource_locator | yes | Depends on channel. Values from lookup messages. | ||
content | string | ||||
embeds | json | ||||
components | json | ||||
suppress_embeds | boolean |
Delete a message
Operation message.delete.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
message | resource_locator | yes | Depends on channel. Values from lookup messages. |
Delete many messages
Operation message.bulk_delete. Deletes 2 to 100 messages younger than two weeks from a server channel.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
messages | string | yes | Message IDs as an array or a comma-separated list (2 to 100). |
Add a reaction
Operation message.react.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
message | resource_locator | yes | Depends on channel. Values from lookup messages. | ||
emoji | string | yes | Unicode emoji, or name:id for a custom emoji. |
Remove own reaction
Operation message.remove_reaction.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
message | resource_locator | yes | Depends on channel. Values from lookup messages. | ||
emoji | string | yes |
Pin a message
Operation message.pin.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
message | resource_locator | yes | Depends on channel. Values from lookup messages. |
Unpin a message
Operation message.unpin.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
message | resource_locator | yes | Depends on channel. Values from lookup messages. |
List pinned messages
Operation message.list_pins.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
return_all | boolean | false | |||
limit | number | 50 | return_all = false |
Channel
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Create a channel | channel.create | writes | 1 | |
| Get a channel | channel.get | reads | 1 | |
| List server channels | channel.list | reads | 1 | |
| Update a channel | channel.update | writes | 1 | |
| Delete a channel | channel.delete | writes | 1 |
Create a channel
Operation channel.create.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. | ||
name | string | yes | |||
type | options | 0 | One of 0, 2, 4, 5, 13, 15. | ||
topic | string | ||||
parent_id | string | ID of the category to place the channel in. | |||
nsfw | boolean | ||||
rate_limit_per_user | number | Slow mode in seconds (0-21600). | |||
position | number |
Get a channel
Operation channel.get.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. |
List server channels
Operation channel.list.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. | ||
types | multi_options | Only these channel types. Leave empty for all. One of 0, 2, 4, 5, 13, 15. | |||
return_all | boolean | true | |||
limit | number | 50 | return_all = false |
Update a channel
Operation channel.update.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. | ||
name | string | ||||
topic | string | ||||
parent_id | string | ID of the category to move the channel to. | |||
nsfw | boolean | ||||
rate_limit_per_user | number | ||||
position | number |
Delete a channel
Operation channel.delete.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. |
Member
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| List server members | member.list | reads | yes | 1 |
| Search server members | member.search | reads | 1 | |
| Get a member | member.get | reads | 1 | |
| Add roles to a member | member.add_role | writes | 1 | |
| Remove roles from a member | member.remove_role | writes | 1 | |
| Remove a member from the server | member.kick | writes | 1 | |
| Ban a user | member.ban | writes | 1 | |
| Remove a ban | member.unban | writes | 1 |
List server members
Operation member.list. Needs the Server Members privileged intent enabled for the bot.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. | ||
return_all | boolean | false | |||
limit | number | 50 | return_all = false |
Search server members
Operation member.search.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. | ||
query | string | yes | Matches the start of usernames and nicknames. | ||
limit | number | 50 |
Get a member
Operation member.get.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. | ||
user | resource_locator | yes | Depends on guild. Values from lookup members. |
Add roles to a member
Operation member.add_role.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. | ||
user | resource_locator | yes | Depends on guild. Values from lookup members. | ||
roles | multi_options | yes | Depends on guild. Values from lookup roles. |
Remove roles from a member
Operation member.remove_role.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. | ||
user | resource_locator | yes | Depends on guild. Values from lookup members. | ||
roles | multi_options | yes | Depends on guild. Values from lookup roles. |
Remove a member from the server
Operation member.kick.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. | ||
user | resource_locator | yes | Depends on guild. Values from lookup members. | ||
reason | string | Shown in the audit log. |
Ban a user
Operation member.ban.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. | ||
user | resource_locator | yes | Depends on guild. Values from lookup members. | ||
delete_message_seconds | number | 0 | Delete their messages from this many seconds back (max 604800). | ||
reason | string |
Remove a ban
Operation member.unban.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. | ||
user | string | yes | ID of the banned user. |
Server
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| List the bot’s servers | guild.list | reads | yes | 1 |
| Get a server | guild.get | reads | 1 |
List the bot’s servers
Operation guild.list.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
return_all | boolean | true | |||
limit | number | 50 | return_all = false |
Get a server
Operation guild.get.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. | ||
with_counts | boolean | true | Include approximate member and presence counts. |
Role
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| List server roles | role.list | reads | 1 |
List server roles
Operation role.list.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | yes | Values from lookup guilds. |
User
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Get the current user or bot | user.get_me | reads | 2 | |
| Get a user | user.get | reads | 1 | |
| Send a direct message | user.send_dm | writes | 1 |
Get the current user or bot
Operation user.get_me.
This node has no parameters.
Get a user
Operation user.get.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
user | string | yes | User ID. |
Send a direct message
Operation user.send_dm. Opens (or reuses) the DM channel with a user and posts a message to it.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Server whose members are listed in the user picker. Values from lookup guilds. | |||
user | resource_locator | yes | Depends on guild. Values from lookup members. | ||
content | string | ||||
embeds | json | ||||
components | json |
Webhook
Posts through a channel webhook URL; no bot needed.
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Send a message | webhook.send | writes | 2 | |
| Send a message with a file | webhook.send_file | writes | 1 | |
| Get a webhook message | webhook.get_message | reads | 1 | |
| Edit a webhook message | webhook.edit_message | writes | 1 | |
| Delete a webhook message | webhook.delete_message | writes | 1 |
Send a message
Operation webhook.send.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
webhook_url | string | Overrides the URL stored in the webhook credential. | |||
content | string | ||||
username | string | Override the webhook’s name. | |||
avatar_url | string | ||||
embeds | json | ||||
components | json | Only for webhooks owned by an application. | |||
tts | boolean | false | |||
allowed_mentions | json | ||||
thread_id | string | Post into this thread of the webhook’s channel. | |||
thread_name | string | Create a forum post with this name (forum channels). | |||
silent | boolean | false | |||
suppress_embeds | boolean | false | |||
flags | multi_options | Message flags by name (same effect as the switches above). One of SUPPRESS_EMBEDS, SUPPRESS_NOTIFICATIONS. |
Send a message with a file
Operation webhook.send_file.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
webhook_url | string | ||||
binary_property | binary_property | "data" | yes | ||
file_name | string | ||||
content | string | ||||
username | string | ||||
avatar_url | string | ||||
thread_id | string |
Get a webhook message
Operation webhook.get_message.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
webhook_url | string | ||||
message | string | yes | |||
thread_id | string |
Edit a webhook message
Operation webhook.edit_message.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
webhook_url | string | ||||
message | string | yes | |||
content | string | ||||
embeds | json | ||||
thread_id | string |
Delete a webhook message
Operation webhook.delete_message.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
webhook_url | string | ||||
message | string | yes | |||
thread_id | string |
Lookups
Lookups fill dropdowns and resource pickers in the editor from the vendor API.
| Lookup | Depends on | Search | Description |
|---|---|---|---|
guilds | client-side | ||
channels | guild | client-side | |
messages | channel | client-side | |
roles | guild | client-side | |
members | guild | client-side | @{{ item.user.username }} |
Triggers
Node type connector.discord_trigger.
| Trigger | ID | Kind | Deduplication key | Signature | Webhook registration | Cassette tests |
|---|---|---|---|---|---|---|
| New message in channel (polling) | new_message | poll | {{ item.id }} | 0 |
Trigger: New message in channel (polling)
Checks a channel for new messages on the poll schedule (up to 100 per poll). Reading message text requires the Message Content privileged intent. Messages from bots, including this one, are emitted too; check author.bot to skip them.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
guild | resource_locator | Values from lookup guilds. | |||
channel | resource_locator | yes | Depends on guild. Values from lookup channels. |
Import
Exported workflows that use these node types import to this node. Unverified ranges import with a parameter warning until parity fixtures confirm them; see Migrating.
| Source type | Version range | Status | Fixtures |
|---|---|---|---|
n8n-nodes-base.discord | 1 | unverified | |
n8n-nodes-base.discord | >=2 <3 | unverified |
Provenance
Written from the vendor’s documentation:
- https://docs.discord.com/developers/reference
- https://docs.discord.com/developers/resources/message
- https://docs.discord.com/developers/resources/channel
- https://docs.discord.com/developers/resources/guild
- https://docs.discord.com/developers/resources/user
- https://docs.discord.com/developers/resources/webhook
- https://docs.discord.com/developers/topics/oauth2
- https://docs.discord.com/developers/topics/rate-limits
- https://docs.discord.com/developers/topics/permissions
- https://docs.discord.com/developers/topics/opcodes-and-status-codes
- https://docs.discord.com/developers/reference#uploading-files
- https://docs.discord.com/developers/reference#snowflakes