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
| Name | Required | Description | Default |
|---|---|---|---|
| channelId | Yes | The Discord channel ID | |
| emoji | Yes | Emoji to remove (Unicode or custom emoji format) | |
| messageId | Yes | The message ID to remove reaction from | |
| userId | No | User 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
- src/core/AutomationManager.ts:106-108 (handler)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);
- src/types.ts:50-54 (schema)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)") });
- src/core/DiscordController.ts:69-80 (helper)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`); }
- src/core/DiscordController.ts:43-67 (handler)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); } }