discord_add_multiple_reactions
Enable adding multiple emoji reactions to a Discord message in one step by specifying the channel ID, message ID, and desired emojis through the MCP-Discord server.
Instructions
Adds multiple emoji reactions to a Discord message at once
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channelId | Yes | ||
| emojis | Yes | ||
| messageId | Yes |
Input Schema (JSON Schema)
{
"properties": {
"channelId": {
"type": "string"
},
"emojis": {
"items": {
"type": "string"
},
"type": "array"
},
"messageId": {
"type": "string"
}
},
"required": [
"channelId",
"messageId",
"emojis"
],
"type": "object"
}
Implementation Reference
- src/tools/reactions.ts:56-101 (handler)The addMultipleReactionsHandler function that executes the tool: fetches channel and message, then sequentially adds each emoji reaction with a delay to avoid rate limits.export async function addMultipleReactionsHandler( args: unknown, context: ToolContext ): Promise<ToolResponse> { const { channelId, messageId, emojis } = AddMultipleReactionsSchema.parse(args); try { if (!context.client.isReady()) { return { content: [{ type: "text", text: "Discord client not logged in." }], isError: true }; } const channel = await context.client.channels.fetch(channelId); if (!channel || !channel.isTextBased() || !('messages' in channel)) { return { content: [{ type: "text", text: `Cannot find text channel with ID: ${channelId}` }], isError: true }; } const message = await channel.messages.fetch(messageId); if (!message) { return { content: [{ type: "text", text: `Cannot find message with ID: ${messageId}` }], isError: true }; } // Add each reaction sequentially for (const emoji of emojis) { await message.react(emoji); // Small delay to prevent rate limiting await new Promise(resolve => setTimeout(resolve, 300)); } return { content: [{ type: "text", text: `Successfully added ${emojis.length} reactions to message ID: ${messageId}` }] }; } catch (error) { return handleDiscordError(error); } }
- src/toolList.ts:183-198 (schema)MCP tool definition including name, description, and input schema (JSON Schema).{ name: "discord_add_multiple_reactions", description: "Adds multiple emoji reactions to a Discord message at once", inputSchema: { type: "object", properties: { channelId: { type: "string" }, messageId: { type: "string" }, emojis: { type: "array", items: { type: "string" } } }, required: ["channelId", "messageId", "emojis"] } },
- src/server.ts:148-151 (registration)Switch case in server that registers and dispatches tool calls to the addMultipleReactionsHandler.case "discord_add_multiple_reactions": this.logClientState("before discord_add_multiple_reactions handler"); toolResponse = await addMultipleReactionsHandler(args, this.toolContext); return toolResponse;