Actions30
- Message Actions
- User Actions
- Channel Actions
- Guild Actions
- Emoji Actions
- Analytics Actions
- Moderation Actions
- Backup Actions
- DM Actions
Overview
This node operation sends a message to a specified Discord channel within a guild (server). It supports sending plain text messages, messages with embedded JSON content, and messages with attachments either as binary data or via a URL. This is useful for automating communication in Discord servers, such as posting announcements, alerts, or any custom messages programmatically.
Use Case Examples
- Sending a simple text message to a channel to notify users about an event.
- Sending a message with an embedded rich content JSON object to enhance message appearance.
- Sending a file attachment from binary data or a URL along with a message.
Properties
| Name | Meaning |
|---|---|
| Guild ID | The ID of the Discord server (guild) where the message will be sent. |
| Channel ID | The ID of the text-based channel within the guild where the message will be sent. |
| Message Content | The text content of the message to send. |
| Embed (JSON) | A JSON string representing an 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 (required if attachment type is binary). |
| File URL | The URL of the file to attach (required if attachment type is URL). |
| File Name | Optional custom name for the attached file. |
Output
JSON
id- ID of the sent message.content- Text content of the sent message.channelId- ID of the channel where the message was sent.createdTimestamp- Timestamp when the message was created.authorid- ID of the message author (bot user).username- Username of the message author (bot user).
Dependencies
- Discord API via discord.js library
- An API key credential for Discord bot authentication
Troubleshooting
- Ensure the provided Guild ID and Channel ID are correct and the bot has access to the channel.
- Verify the channel is text-based; voice or category channels are not supported for sending messages.
- If sending an embed, ensure the JSON is valid and correctly formatted.
- When sending binary attachments, confirm the binary property exists in the input data.
- For URL attachments, verify the URL is accessible and correct.
- Common errors include 'Channel not found', 'Invalid channel type', and 'No binary data property found', which indicate configuration or permission issues.
Links
- Discord API - Create Message - Official Discord API documentation for sending messages to channels.