Send Channel Message
Sends a message to a Discord channel with support for rich content including embeds, file attachments, buttons, and message replies.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Client Id - The Discord bot client identifier from the Connect node (optional if Bot Token provided).
- Channel Id - The ID of the Discord channel where the message will be sent.
- Message Text - The text content of the message to send.
Options
- Bot Token - Discord bot token credential (optional if using Client ID from Connect node).
- Reply Server Id - The server (guild) ID if replying to a message.
- Reply Message Id - The message ID to reply to (creates a threaded reply).
- Files - An array of file paths to attach to the message.
- Embed - An embed object for rich content (structured formatted messages).
- Buttons - An array of button objects to add interactive components.
Output
- Message - The sent message object containing message details, ID, timestamp, and other metadata.
How It Works
The Send Channel Message node sends messages to Discord channels with various content types. When executed, the node:
- Authenticates using either Client ID or direct bot token
- Validates the channel ID and message text
- Constructs the message with optional components (files, embeds, buttons)
- Processes file attachments if provided
- Adds reply reference if replying to another message
- Sends the message to Discord via the API
- Returns the complete message object
Requirements
- Active Discord bot session (Client ID) or bot token credentials
- Valid channel ID (enable Developer Mode in Discord to copy IDs)
- Send Messages permission in the target channel
- Attach Files permission (if sending files)
- Embed Links permission (if sending embeds)
Error Handling
The node will return specific errors in the following cases:
- ErrInvalidArg - Client ID or bot token missing/invalid
- ErrInvalidArg - Channel ID is empty
- ErrInvalidArg - Message text is empty
- ErrInternal - File processing errors
- ErrInternal - Invalid embed or button structure
- Discord API errors (missing permissions, invalid channel, etc.)
Message Text
The basic message content:
- Can contain up to 2000 characters
- Supports Discord markdown formatting
- Can include mentions (@user, @role, #channel)
- Can include emojis (standard and custom)
File Attachments
The Files option accepts an array of file paths:
[
"/path/to/image.png",
"/path/to/document.pdf",
"/path/to/data.xlsx"
]
File requirements:
- Must be valid file paths accessible by the automation
- Discord has a file size limit (8MB for regular users, 50MB for Nitro servers)
- Multiple files can be attached in a single message
Embed Objects
Embeds allow rich formatted messages with titles, descriptions, fields, images, and more:
{
"title": "Automation Alert",
"description": "Process completed successfully",
"color": 3447003,
"fields": [
{
"name": "Status",
"value": "Completed",
"inline": true
},
{
"name": "Duration",
"value": "5 minutes",
"inline": true
}
],
"thumbnail": {
"url": "https://example.com/icon.png"
},
"timestamp": "2024-01-15T10:30:00Z"
}
Embed properties:
- title - Embed title (up to 256 characters)
- description - Main text content (up to 4096 characters)
- color - Decimal color code (e.g., 3447003 for blue)
- fields - Array of field objects with name, value, and inline properties
- thumbnail - Small image in top right
- image - Large image at bottom
- footer - Footer text and icon
- author - Author name, icon, and URL
- timestamp - ISO 8601 timestamp
Button Components
Add interactive buttons to messages:
[
{
"Label": "Approve",
"Style": 3,
"CustomID": "approve_btn"
},
{
"Label": "Reject",
"Style": 4,
"CustomID": "reject_btn"
}
]
Button properties:
- Label - Button text (up to 80 characters)
- Style - Button color: 1=Primary (blue), 2=Secondary (gray), 3=Success (green), 4=Danger (red), 5=Link
- CustomID - Unique identifier for handling interactions (required except for link buttons)
- URL - Link URL (only for Style 5)
- Disabled - Boolean to disable the button
Message Replies
To reply to an existing message:
- Set Reply Server Id to the guild/server ID
- Set Reply Message Id to the message you want to reply to
- The sent message will appear as a threaded reply
Example: Simple Text Message
Inputs:
- Client Id: (from Connect node)
- Channel Id: "123456789012345678"
- Message Text: "Hello from Robomotion!"
Result: A simple text message in the channel.
Example: Rich Notification with Embed
Inputs:
- Channel Id: "123456789012345678"
- Message Text: "@everyone New alert!"
- Embed:
{
"title": "System Status",
"description": "All systems operational",
"color": 3066993,
"fields": [
{"name": "CPU", "value": "45%", "inline": true},
{"name": "Memory", "value": "62%", "inline": true}
]
}
Example: Message with Files
Inputs:
- Channel Id: "123456789012345678"
- Message Text: "Here's the daily report:"
- Files: ["/reports/daily-report.pdf", "/reports/chart.png"]
Example: Interactive Message
Inputs:
- Channel Id: "123456789012345678"
- Message Text: "Please select an option:"
- Buttons:
[
{"Label": "Yes", "Style": 3, "CustomID": "yes_btn"},
{"Label": "No", "Style": 4, "CustomID": "no_btn"}
]
Use the Interaction In node to handle button clicks.
Bot Permissions Required
Ensure your bot has these permissions in the target channel:
- View Channel - Required to access the channel
- Send Messages - Required to send messages
- Embed Links - Required for embeds
- Attach Files - Required for file attachments
- Mention Everyone - Required to mention @everyone or @here
Rate Limits
Discord enforces rate limits:
- 5 messages per 5 seconds per channel (for most bots)
- Respect rate limit headers to avoid being temporarily banned
- Consider adding delays between messages in loops
Tips and Best Practices
- Keep messages concise - Discord users prefer short, scannable content
- Use embeds for structured data - They're more visually appealing than plain text
- Test your bot - Send messages to a test channel first
- Handle errors gracefully - Check permissions before sending
- Cache channel IDs - Store frequently used channel IDs as variables
- Use buttons sparingly - Discord limits 5 action rows per message, 5 buttons per row