Skip to main content
Glama

discord_remove_reaction

Remove a specific reaction from a Discord message by specifying the channel ID, message ID, and emoji. Optionally target a specific user's reaction for precise moderation and cleanup.

Instructions

Remove a reaction from a message

Input Schema

NameRequiredDescriptionDefault
channelIdYesThe Discord channel ID
emojiYesEmoji to remove (Unicode or custom emoji format)
messageIdYesThe message ID to remove reaction from
userIdNoUser ID to remove reaction from (defaults to self)

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "channelId": { "description": "The Discord channel ID", "type": "string" }, "emoji": { "description": "Emoji to remove (Unicode or custom emoji format)", "type": "string" }, "messageId": { "description": "The message ID to remove reaction from", "type": "string" }, "userId": { "description": "User ID to remove reaction from (defaults to self)", "type": "string" } }, "required": [ "channelId", "messageId", "emoji" ], "type": "object" }

Implementation Reference

  • The handler function that implements the core logic for the 'discord_remove_reaction' tool. Validates parameters using RemoveReactionSchema and delegates to DiscordService.removeReaction(channelId, messageId, emoji).
    async removeReaction(channelId: string, messageId: string, emoji: string): Promise<string> { const parsed = schemas.RemoveReactionSchema.parse({ channelId, messageId, emoji }); return await this.discordService.removeReaction(parsed.channelId, parsed.messageId, parsed.emoji);
  • Zod schema defining the input parameters for the discord_remove_reaction tool: channelId, messageId, and emoji.
    export const RemoveReactionSchema = z.object({ channelId: z.string().describe("Discord channel ID"), messageId: z.string().describe("Discord message ID"), emoji: z.string().describe("Emoji (Unicode or string)") });
  • Helper method in DiscordController that dynamically invokes AutomationManager methods based on snake_case action names (e.g., 'remove_reaction' -> 'removeReaction'). This is how the tool is dispatched.
    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`); }
  • Entry point for executing actions/tools like 'discord_remove_reaction'. Performs permission checks, logging, rate limiting, and delegates to specific handler via callAutomationMethod.
    async executeAction(action: string, params: any): Promise<string> { try { // Check if action is allowed if (!this.configManager.isActionAllowed(action)) { throw ErrorHandler.createPermissionError(`Action '${action}' is not allowed`); } // Log the operation this.logger.logOperation(action, params); // Wait for rate limits if needed if (this.configManager.getConfig().rateLimitProtection) { await this.rateLimiter.waitForRateLimit(action); } // Execute the action using reflection-like approach const result = await this.callAutomationMethod(action, params); this.logger.info(`Action '${action}' executed successfully`); return result; } catch (error) { this.logger.logError(`Action '${action}' failed`, error); ErrorHandler.handle(error); } }

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