discord_edit_message
Update or modify previously sent Discord messages by specifying the channel ID, message ID, and new content. Ideal for correcting errors or revising information quickly within a server.
Instructions
Edit a previously sent message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channelId | Yes | The Discord channel ID | |
| content | Yes | New message content | |
| messageId | Yes | The message ID to edit |
Implementation Reference
- src/core/AutomationManager.ts:61-64 (handler)Handler function for editing Discord channel messages. Validates input using EditMessageSchema and delegates to DiscordService.editMessage(channelId, messageId, newMessage). This is the core execution logic for the message editing tool.async editMessage(channelId: string, messageId: string, newMessage: string): Promise<string> { const parsed = schemas.EditMessageSchema.parse({ channelId, messageId, newMessage }); return await this.discordService.editMessage(parsed.channelId, parsed.messageId, parsed.newMessage); }
- src/types.ts:28-32 (schema)Zod schema for validating input parameters to the discord_edit_message tool: channelId, messageId, newMessage.export const EditMessageSchema = z.object({ channelId: z.string().describe("Discord channel ID"), messageId: z.string().describe("Specific message ID"), newMessage: z.string().describe("New message content") });
- src/core/DiscordController.ts:69-80 (registration)Dynamic registration and dispatch mechanism. Converts snake_case tool names (e.g., 'discord_edit_message' -> 'discordEditMessage' or 'edit_message' -> 'editMessage') to camelCase method names on AutomationManager and executes them with parsed params. Entry point for tool execution.private async callAutomationMethod(action: string, params: any): Promise<string> { // Convert action name to method name (snake_case to camelCase) const methodName = action.replace(/_([a-z])/g, (g) => g[1].toUpperCase()); // Check if method exists if (typeof (this.automationManager as any)[methodName] === 'function') { // Call the method with params return await (this.automationManager as any)[methodName](...Object.values(params)); } throw new Error(`Method '${methodName}' not found in AutomationManager`); }