Skip to main content
Glama

discord_delete_message

Delete Discord messages by specifying channel and message IDs to remove unwanted content or manage conversations.

Instructions

Delete a message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYesThe Discord channel ID
messageIdYesThe message ID to delete

Implementation Reference

  • The core handler function that executes the Discord message deletion logic. Validates parameters using DeleteMessageSchema and forwards to DiscordService.
    async deleteMessage(channelId: string, messageId: string): Promise<string> { const parsed = schemas.DeleteMessageSchema.parse({ channelId, messageId }); return await this.discordService.deleteMessage(parsed.channelId, parsed.messageId); }
  • Zod validation schema defining the required inputs (channelId and messageId) for the discord_delete_message tool.
    export const DeleteMessageSchema = z.object({ channelId: z.string().describe("Discord channel ID"), messageId: z.string().describe("Specific message ID") });
  • Dynamic registration/dispatch mechanism that maps tool names like 'discord_delete_message' to camelCase methods (e.g., 'deleteMessage') in AutomationManager.
    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`); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/drvova/discord-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server