Edit Channel Message
Edits the content of an existing message in a Discord channel.
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 containing the message.
- Message Id - The ID of the message to edit.
- Message Text - The new text content for the message.
Options
- Bot Token - Discord bot token credential (optional if using Client ID from Connect node).
How It Works
The Edit Channel Message node modifies the content of an existing message. When executed, the node:
- Authenticates using either Client ID or direct bot token
- Validates the channel ID, message ID, and new message text
- Constructs the edit request with the new content
- Sends the edit request to Discord API
- Updates the message with the new text
Requirements
- Active Discord bot session (Client ID) or bot token credentials
- Valid channel ID and message ID
- The message must have been sent by the bot (cannot edit other users' messages)
- New message text must not be empty
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 ID is empty
- ErrInvalidArg - Message text is empty
- Discord API errors (message not found, not bot's message, etc.)
Bots can only edit their own messages. Attempting to edit another user's message will result in an error.
Example: Update Status Message
Flow:
1. Send Channel Message → status_msg
- Message Text: "Processing: 0%"
2. Process task (10%)
3. Edit Channel Message
- Message Id: {{status_msg.ID}}
- Message Text: "Processing: 10%"
4. Process task (50%)
5. Edit Channel Message
- Message Text: "Processing: 50%"
6. Process complete
7. Edit Channel Message
- Message Text: "Processing: Complete ✓"
Result: A message that updates to show progress.
Example: Fix Typo
Flow:
1. Send Channel Message → msg
- Message Text: "Helo world"
2. Delay 1 second
3. Edit Channel Message
- Message Id: {{msg.ID}}
- Message Text: "Hello world"
Result: Correct a typo in a previously sent message.
Example: Dynamic Information Board
Flow:
1. Send Channel Message → info_board
- Message Text: "Server Status: Checking..."
2. Loop every 5 minutes:
- Check server status
- Edit Channel Message
- Message Id: {{info_board.ID}}
- Message Text: "Server Status: {{status}}"
Result: A message that continuously updates with current information.
Example: Interactive Bot Response
Flow:
1. Receive Message (command)
2. Send Channel Message → response
- Message Text: "Searching..."
3. Perform search
4. Edit Channel Message
- Message Id: {{response.ID}}
- Message Text: "Results: {{search_results}}"
Result: Bot shows "Searching..." then edits to show actual results.
Use Cases
- Status updates - Show progress of long-running tasks
- Information boards - Maintain current information in a pinned message
- Error correction - Fix typos or mistakes
- Dynamic content - Update messages with real-time data
- Bot responses - Update placeholder messages with actual content
- Countdowns - Update countdown messages periodically
- Leaderboards - Keep leaderboard messages up-to-date
Message Edit Behavior
When a message is edited:
- The message shows an "(edited)" indicator
- Original timestamp remains unchanged
- Message ID stays the same
- Embed and attachment changes require different API calls
- Only text content can be edited with this node
Limitations
- Can only edit messages sent by the bot
- Cannot edit other users' messages
- Cannot edit system messages
- Edited messages show an "(edited)" indicator
- Message must not be empty after editing
Bot Permissions Required
- Send Messages - Basic permission (bot needs to have sent the original message)
- View Channel - To see the channel
Rate Limits
Discord has rate limits for message editing:
- Rapid edits may hit rate limits
- Consider adding small delays between edits
- Avoid editing the same message too frequently
Best Practices for Progress Messages
1. Send initial message with placeholder
2. Store message ID
3. Update periodically with meaningful intervals
4. Include timestamp or completion estimate
5. Final edit should indicate completion
Example intervals:
- Very fast operations: Every 10-20%
- Medium operations: Every 25%
- Long operations: Time-based (every minute)
Tips and Best Practices
- Store message IDs - Save the message object when sending to edit later
- Meaningful updates - Only edit when there's significant change
- Rate limiting - Don't edit too frequently
- Final state - Ensure the final edit represents completion
- Error handling - Handle cases where message was deleted
- User experience - Edits should improve clarity, not confuse
- Testing - Test edit sequences before deploying