Discord Trigger
Receive Discord messages and interactions as workflow triggers.
Use Discord Trigger when:
- You want to run a workflow when a message is posted in a channel
- You need to handle slash commands or button interactions
- Discord is the event source and your workflow runs asynchronously
For sending messages back to Discord, pair this with Discord Send Message.
| Handle | Type | Description |
|---|---|---|
payload | object | Normalized Discord event payload |
The payload (accessed as {{ discord.* }}) shape:
| Field | Type | Description |
|---|---|---|
author | object | Message author object (username, id, etc.) |
channel_id | string | Channel ID where the event occurred |
guild_id | string | Server (guild) ID |
content | string | Message text content |
message_id | string | Discord message ID |
attachments | array | File attachments on the message |
event_type | string | Event type (e.g. MESSAGE_CREATE, INTERACTION_CREATE) |
raw_event | object | Full Discord event object for advanced use cases |
| Setting | Type | Default | Description |
|---|---|---|---|
event_types | multi-select | MESSAGE_CREATE | Discord event types to listen for: MESSAGE_CREATE, INTERACTION_CREATE |
| Setting | Type | Default | Description |
|---|---|---|---|
guild_filter | string | — | Only trigger for events in this guild (server) ID |
channel_filter | string | — | Only trigger for events in this channel ID |
| Setting | Type | Default | Description |
|---|---|---|---|
mockPayload | code editor (JSON) | Sample Discord event JSON | JSON body to inject when running this workflow locally for testing. |
Configure these on the Env Vars page:
| Env Var | Description |
|---|---|
DISCORD_BOT_TOKEN | Bot token from your Discord application |
DISCORD_PUBLIC_KEY | Application public key used for Ed25519 signature verification |
React to new messages in a specific channel:
- Create a Discord Application and Bot at discord.com/developers/applications
- Copy the Bot Token and Public Key from the application settings
- Set the Interactions Endpoint URL to your deployed trigger endpoint on
triggers.tensorify.io - Enable the Message Content Intent if you need to read message text
- Add
DISCORD_BOT_TOKENandDISCORD_PUBLIC_KEYas env vars - Set
event_typestoMESSAGE_CREATEandchannel_filterto your target channel ID - Add a Discord Send Message node to post a response
Access event data in downstream nodes:
{{ discord.author.username }}
{{ discord.content }}
{{ discord.channel_id }}
{{ discord.guild_id }}
{{ discord.event_type }}
The plugin handles Discord's PING verification automatically.
import discord from @tensorify/discord-trigger:1.0.0
import discord_send from @tensorify/discord-send-message:1.0.0
node trigger @tensorify/discord-trigger:1.0.0 {
event_types = ["MESSAGE_CREATE"]
channel_filter = "123456789012345678"
}
node reply @tensorify/discord-send-message:1.0.0 {
content = "Hello {{ discord.author.username }}!"
}
trigger.payload -> reply.input
- Message Content Intent: Discord requires the Message Content Intent to be enabled in the Developer Portal for bots to read message text.
- Interactions vs. messages:
INTERACTION_CREATEcovers slash commands and component interactions. UseMESSAGE_CREATEfor regular channel messages. - Public key verification: Requests without a valid Ed25519 signature are rejected. Ensure
DISCORD_PUBLIC_KEYmatches your application settings exactly. - Guild and channel filters: Use numeric Discord IDs, not names. Enable Developer Mode in Discord to copy IDs from the context menu.
- Discord Send Message — send messages via webhook
- Webhook Trigger — generic HTTP webhook receiver
- Deploying Workflows — get your trigger URL and deploy to production
- Environment Variables — store Discord credentials
