Discord

Discord uses the bot token from the application's Bot page. The Public Key is not the bot token.

Configure the bot

  1. Create an application in the Discord Developer Portal.
  2. Open Bot, generate the token, and enable Message Content Intent.
  3. Install the bot into a server with View Channels, Send Messages, and Read Message History.
  4. Enable Developer Mode in Discord, right-click a channel, and copy its 17–20 digit ID.
Terminal
woml secrets set DISCORD_BOT_TOKEN
woml discord doctor --destination <channelId>

Use app-mention,direct-message for triggers and numeric channel IDs for filters or notifications. If message text is empty, enable Message Content Intent and restart WOML.

Build a Discord trigger

WOML
<discord
  id="agentMessage"
  events="app-mention,direct-message"
  channels="200000000000000001"
  bot-token="{{secrets.DISCORD_BOT_TOKEN}}"
/>

Run the workflow, mention the bot in the configured channel, and inspect context.payload.text, conversationId, and messageId. WOML uses a shared resumable Gateway connection and ignores bot-authored messages.

Send a reply

JavaScript
return services.discord.send({
  botToken: secrets.DISCORD_BOT_TOKEN,
  conversationId: context.payload.conversationId,
  text: "Hello from WOML",
  replyToMessageId: context.payload.messageId
}, { name: "discord-reply" });

Configure approvals and notifications

Use numeric channel IDs inside the Discord notification tag. Enable Developer Mode to copy an ID; a channel name is not accepted as a stable destination.

The application's Public Key is used by some Discord interaction integrations, but it is not the bot token WOML needs for Gateway and messaging access. Generate and protect the token from the Bot page.

After changing intents or bot permissions, restart the runtime and reinstall the bot when necessary.