Discord icon

Discord

Interact with Discord API - Full Bot Features

Overview

This node interacts with the Discord API to perform various operations related to Discord webhooks, specifically sending messages via webhooks. It allows users to send messages to Discord channels using webhooks, supporting additional fields such as embeds, text-to-speech, and message attachments. This node is useful for automating message sending in Discord channels, for example, sending notifications, alerts, or updates via webhooks.

Use Case Examples

  1. Sending a message to a Discord channel via a webhook with an embed object to format the message content.
  2. Sending a text-to-speech message through a webhook to a Discord channel.
  3. Attaching a file to a webhook message either from binary data or a URL.

Properties

Name Meaning
additionalFields Optional additional fields to customize the webhook message, including embed JSON, TTS flag, reason for action, and other Discord-specific message options.

Output

JSON

  • id - ID of the sent webhook message.
  • content - Content text of the sent message.
  • channelId - ID of the channel where the message was sent.
  • createdTimestamp - Timestamp when the message was created.
  • author
    • id - ID of the author (webhook) who sent the message.
    • username - Username of the author (webhook).

Dependencies

  • Discord API accessed via discord.js library
  • An API key credential for Discord bot authentication

Troubleshooting

  • Invalid embed JSON error: Ensure the embed JSON is correctly formatted and valid JSON syntax is used.
  • 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 input binary data property.
  • Authentication errors: Check that the Discord bot token credential is valid and has necessary permissions.

Links

Discussion