add_reaction
Add an emoji reaction to a message by providing the message ID and emoji type.
Instructions
[Official API] Add an emoji reaction to a message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | Message ID (om_xxx) | |
| emoji_type | Yes | Emoji type string, e.g. "THUMBSUP", "SMILE", "HEART" |
Implementation Reference
- src/tools/messaging-bot.js:80-91 (schema)Schema definition for the 'add_reaction' tool, describing input (message_id and emoji_type).
{ name: 'add_reaction', description: '[Official API] Add an emoji reaction to a message.', inputSchema: { type: 'object', properties: { message_id: { type: 'string', description: 'Message ID (om_xxx)' }, emoji_type: { type: 'string', description: 'Emoji type string, e.g. "THUMBSUP", "SMILE", "HEART"' }, }, required: ['message_id', 'emoji_type'], }, }, - src/tools/messaging-bot.js:142-144 (handler)Handler function for 'add_reaction' that calls ctx.getOfficialClient().addReaction() and returns a text response with the reactionId.
async add_reaction(args, ctx) { return text(`Reaction added: ${(await ctx.getOfficialClient().addReaction(args.message_id, args.emoji_type)).reactionId}`); }, - src/clients/official/im.js:190-199 (helper)Low-level helper method 'addReaction' on the official IM client. Calls the Feishu SDK im.messageReaction.create API.
async addReaction(messageId, emojiType) { const res = await this._safeSDKCall( () => this.client.im.messageReaction.create({ path: { message_id: messageId }, data: { reaction_type: { emoji_type: emojiType } }, }), 'addReaction' ); return { reactionId: res.data.reaction_id }; }, - src/server.js:47-57 (registration)Registration: src/tools/messaging-bot.js is required in TOOL_MODULES list (line 47), then its schemas are flattened into TOOLS and handlers into HANDLERS (lines 56-57).
require('./tools/messaging-bot'), require('./tools/messaging-user'), require('./tools/okr'), require('./tools/profile'), require('./tools/tasks'), require('./tools/uploads'), require('./tools/wiki'), ]; const TOOLS = TOOL_MODULES.flatMap((m) => m.schemas); const HANDLERS = Object.fromEntries(TOOL_MODULES.flatMap((m) => Object.entries(m.handlers)));