Discord Webhook and Bot API
Discord is a communication platform designed for communities. It offers features like text and voice channels, direct messaging, and server-based organization. In Dify, Discord tools allow users to create a random bot with random username and avatar to send messages.
This tool uses Discord Incoming Webhooks and supports the current Discord Execute Webhook API, including plain text messages, embeds, controlled mentions, polls, message components, and thread options.
To receive events from Discord instead of sending messages to Discord, use the Discord trigger plugin under .
Please follow this site to create a webhook and get its url.
The Discord tools could be found at the Plugin Marketplace, please install it first.
You can use the Discord tool in the following application types.
Both Chatflow and Workflow applications support adding a tool node.
Add the Discord tool in the Agent application, then fill in the to call this tool.
Set:
Optional fields:
Set to a JSON array:
Discord allows up to 10 embeds in one webhook message.
Use to prevent accidental user, role, or everyone mentions:
To allow only user mentions:
Set to a Discord poll object:
Set:
The tool sends as an Execute Webhook query parameter.
For webhooks in forum or media channels, set:
Set to when you need Discord to return the created message object. The tool will return both a success text message and a JSON message with Discord's response.
Without MESSAGE CONTENT Intent, Discord may return empty , , , and fields. Applications that meet Discord's verification threshold may need approval for this privileged intent; smaller applications can enable it directly in the Developer Portal.
This plugin only actively fetches messages through the REST API. For Gateway real-time listening, use the separate Discord trigger plugin described above.
Each call reads at most 100 messages. To read more, pass the returned value as in the next call, or use to fetch newer messages. and cannot be used together.
Discord returns messages from newest to oldest. The result makes this explicit through and includes , , , and normalized . Each message includes author details, content, timestamps, and attachments.