Discord icon

Discord

Interact with Discord API - Full Bot Features

Overview

This node allows sending messages to Discord channels or direct messages (DMs) using a Discord bot. It supports sending plain text messages, messages with embedded rich content (embeds), and attachments either as binary data or via URLs. The node is useful for automating communication in Discord servers or with individual users, such as sending notifications, alerts, or interactive content.

Use Case Examples

  1. Sending a simple text message to a specific Discord channel.
  2. Sending a message with an embed object to enhance message appearance.
  3. Sending a file attachment from binary data or a URL along with the message content.

Properties

Name Meaning
Channel ID The ID of the Discord channel where the message will be sent.
Message Content The textual content of the message to send.
Embed (JSON) A JSON string representing a Discord embed object to include rich content in the message.
Attachment Type Specifies the type of attachment to send with the message: none, binary data, or URL.
Binary Property The name of the binary property containing the file data to attach when attachment type is binary.
File URL The URL of the file to attach when attachment type is URL.
File Name Optional custom name for the attached file.
Additional Fields Additional optional fields such as TTS (text-to-speech), embed JSON, and other message-related options.

Output

JSON

  • id - The ID of the sent message.
  • content - The content of the sent message.
  • channelId - The ID of the channel where the message was sent.
  • createdTimestamp - Timestamp when the message was created.
  • author
    • id - ID of the message author (bot user).
    • username - Username of the message author.

Dependencies

  • Discord API accessed via discord.js library
  • Requires a Discord bot token credential for authentication

Troubleshooting

  • Invalid embed JSON error: Ensure the embed JSON string is correctly formatted and valid JSON.
  • Channel not found or not text-based error: Verify the channel ID is correct and the channel supports text messages.
  • No binary data property found error: Confirm the binary property name matches the binary data available in the workflow item.
  • Authentication errors: Ensure the Discord bot token credential is valid and has necessary permissions in the target server.

Links

Discussion