Skip to main content
Glama

discord_add_reaction

Add custom or Unicode emoji reactions to messages in Discord channels using channel and message IDs. Simplifies bot interaction for enhanced Discord server management.

Instructions

Add a reaction to a message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYesThe Discord channel ID
emojiYesEmoji to react with (Unicode or custom emoji format)
messageIdYesThe message ID to react to

Implementation Reference

  • Handler function for the discord_add_reaction tool. Validates input parameters using AddReactionSchema and delegates execution to DiscordService.addReaction method.
    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); }
  • Zod schema defining the input parameters 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)") });
  • Dynamic registration/dispatch mechanism in DiscordController that converts tool names like 'add_reaction' to camelCase method names (addReaction) and invokes the corresponding handler on 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`); }
  • Helper method in AutomationManager for executing actions by name, providing fallback dynamic dispatch.
    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`); }

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