Discord
Description
Section titled “Description”This module allows interaction with the Discord API v10 through two mechanisms: Webhooks and Bot Token. Webhook operations (sending messages and embeds) do not require bot credentials, only the webhook URL. Bot operations require a bot token configured in the credentials and allow managing channel messages, direct messages, reactions, threads, roles, members and servers.
The operation is determined by the operation field or by the node name (node_name_alias). The module supports over 20 different operations organized into: webhook, channel messages, direct messages, server (guild) management, users and threads.
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | No | Discord bot credentials (not required for webhooks) |
| operation | select | Yes | Operation to perform: webhookSend, webhookEmbed, sendMessage, sendEmbed, sendDM, getMessages, addReaction, getGuild, getMembers, addRole, removeRole, etc. |
| webhookUrl | text | Conditional | Discord webhook URL (required for webhook operations) |
| channelId | text | Conditional | Discord channel ID |
| guildId | text | Conditional | Discord server ID |
| userId | text | Conditional | Discord user ID |
| messageId | text | Conditional | Message ID |
| content | text | Conditional | Text message content |
| embed | json | No | Complete embed object or individual fields (embedTitle, embedDescription, embedColor, etc.) |
| threadName | text | Conditional | Thread name (for createThread) |
| roleId | text | Conditional | Role ID (for addRole/removeRole) |
Credentials
Section titled “Credentials”Service type: discord. Stored in the servicecredentials table.
Configuration fields:
- botToken: Discord bot token (required for bot operations)
- defaultGuildId: Default server ID (optional)
For webhook operations only the webhook URL is needed, no credentials are required.
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": { "sentMessage": { "id": "1234567890", "channel_id": "9876543210", "content": "Hola desde Floogos", "timestamp": "2025-01-15T10:30:00.000Z" } }, "_meta_": { "operation": "sendMessage", "service": "discord" }}Usage Example
Section titled “Usage Example”Basic case - Webhook
Section titled “Basic case - Webhook”{ "webhookUrl": "https://discord.com/api/webhooks/123/abc", "content": "Alerta: nuevo pedido recibido", "username": "Bot de Pedidos"}Basic case - Bot
Section titled “Basic case - Bot”{ "credentials_id": 1, "operation": "sendMessage", "channelId": "123456789", "content": "Mensaje desde el workflow"}API Used
Section titled “API Used”- Discord API v10:
https://discord.com/api/v10 - Documentation: https://discord.com/developers/docs
- Webhook operations do not require bot credentials
- Embeds can be built field by field (embedTitle, embedDescription, embedColor) or as a complete JSON object
- The embed color is specified in hexadecimal (e.g.: “5865F2”) and is converted to an integer internally
- Title buttons are limited to 20 characters by Discord
- The
continueOnErrorparameter allows the workflow to continue even if the operation fails - Direct messages (DM) automatically create a DM channel with the user before sending
Related Nodes
Section titled “Related Nodes”- Discord Webhook Send (parentNode: discord)
- Discord Webhook Embed (parentNode: discord)
- Discord Send Message, Send Embed, Send DM, Edit Message, Delete Message
- Discord Get Messages, Add Reaction, Get Guild Info, Get Channels, Get Members
- Discord Add Role, Remove Role, Ban User, Kick User, Create Thread, Get User