discord_add_reaction
Add emoji reactions to Discord messages by specifying channel, message ID, and emoji. This tool enables interactive message responses within Discord servers.
Instructions
Add a reaction to a message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channelId | Yes | The Discord channel ID | |
| messageId | Yes | The message ID to react to | |
| emoji | Yes | Emoji to react with (Unicode or custom emoji format) |
Implementation Reference
- src/core/AutomationManager.ts:101-104 (handler)The core handler function that executes the discord_add_reaction tool logic. Validates input parameters using AddReactionSchema and delegates the actual Discord API call to DiscordService.addReaction.async addReaction(channelId: string, messageId: string, emoji: string): Promise<string> { const parsed = schemas.AddReactionSchema.parse({ channelId, messageId, emoji }); return await this.discordService.addReaction(parsed.channelId, parsed.messageId, parsed.emoji); }
- src/types.ts:44-48 (schema)Zod schema defining the input parameters and validation for the discord_add_reaction tool: channelId, messageId, and emoji.export const AddReactionSchema = 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 (registration)Dynamic registration/dispatch mechanism in DiscordController that maps tool names like 'add_reaction' (or 'discord_add_reaction') to camelCase method names (e.g., 'addReaction') on AutomationManager for 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`); }
- src/core/AutomationManager.ts:11-22 (helper)Helper method in AutomationManager for dynamic execution of actions, supporting snake_case tool names converted to camelCase methods.async executeAction(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 as any)[methodName] === 'function') { // Call the method with params return await (this as any)[methodName](...Object.values(params)); } throw new Error(`Method '${methodName}' not found in AutomationManager`); }