app icon
Discord
0.0.8

Discord Webhook and Bot API

langgenius/discord11180 installs

Discord Tool

Overview

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 .

Configuration

1. Get Discord webhook url

Please follow this site to create a webhook and get its url.

2. Get Discord tools from Plugin Marketplace

The Discord tools could be found at the Plugin Marketplace, please install it first.

3. Use the tool

You can use the Discord tool in the following application types.

Chatflow / Workflow applications

Both Chatflow and Workflow applications support adding a tool node.

Agent applications

Add the Discord tool in the Agent application, then fill in the to call this tool.

Examples

Plain text message

Set:

  • : your Discord webhook URL
  • :

Optional fields:

  • : override the webhook username
  • : override the webhook avatar
  • : send as text-to-speech

Embed message

Set to a JSON array:

Discord allows up to 10 embeds in one webhook message.

Controlled mentions

Use to prevent accidental user, role, or everyone mentions:

To allow only user mentions:

Poll message

Set to a Discord poll object:

Send to an existing thread

Set:

  • : the Discord thread ID
  • : the message text

The tool sends as an Execute Webhook query parameter.

Create a forum or media thread

For webhooks in forum or media channels, set:

  • : the new thread name
  • , , , or
  • : optional JSON array of tag IDs, for example

Return the created message

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.

Get Channel Messages (Bot API)

Bot setup

  1. Create or select an application in the Discord Developer Portal, then open Bot and create a bot.
  2. Copy its token and configure it as the optional provider credential in Dify. Keep the token secure. If it is exposed or lost, reset it in the Developer Portal.
  3. Under Privileged Gateway Intents, enable MESSAGE CONTENT INTENT.
  4. In OAuth2 > URL Generator, select the scope and grant and ; use the generated URL to add the bot to your server.
  5. Enable Developer Mode in Discord, right-click the channel, and copy its channel ID.

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.

Pagination and output

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.

CATEGORY
Tool
TAGS
PRODUCTIVITYSOCIAL
VERSION
0.0.8
langgenius·08/13/2026 02:07 PM
REQUIREMENTS
LLM invocation
Tool invocation
Maximum memory
1MB