remove_reaction
Remove a bot's reaction from a Discord message by specifying channel, message ID, and emoji to manage message interactions.
Instructions
Remove the bot's reaction from a message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| message_id | Yes | ||
| emoji | Yes |
Implementation Reference
- The core handler function that implements the remove_reaction tool logic. Fetches the Discord channel and message, removes the specified reaction added by the bot, and returns a confirmation message.@staticmethod async def handle_remove_reaction(discord_client, arguments: Dict[str, Any]) -> List[TextContent]: """Remove a reaction from a message""" channel = await discord_client.fetch_channel(int(arguments["channel_id"])) message = await channel.fetch_message(int(arguments["message_id"])) emoji = arguments["emoji"] await message.remove_reaction(emoji, discord_client.user) return [TextContent( type="text", text=f"Removed reaction {emoji} from message in #{channel.name}" )]
- Input schema definition for the remove_reaction tool, specifying required parameters: channel_id, message_id, and emoji with their types and descriptions.inputSchema={ "type": "object", "properties": { "channel_id": { "type": "string", "description": "Channel containing the message" }, "message_id": { "type": "string", "description": "Message to remove reaction from" }, "emoji": { "type": "string", "description": "Emoji to remove (Unicode or custom emoji ID)" } }, "required": ["channel_id", "message_id", "emoji"] }
- src/discord_mcp/integrated_server.py:1021-1031 (registration)Registration and dispatch logic for core tools including remove_reaction. Checks if the tool name is in core_tool_names and dynamically calls the corresponding handler method on CoreToolHandlers.core_tool_names = [ "get_server_info", "list_servers", "get_channels", "list_members", "get_user_info", "send_message", "read_messages", "add_reaction", "add_multiple_reactions", "remove_reaction", "moderate_message", "create_text_channel", "delete_channel", "add_role", "remove_role" ] if name in core_tool_names: handler_method = f"handle_{name}" if hasattr(CoreToolHandlers, handler_method): return await getattr(CoreToolHandlers, handler_method)(discord_client, arguments)
- src/discord_mcp/integrated_server.py:821-842 (registration)Tool object creation for remove_reaction, defining name, description, and input schema for MCP registration.Tool( name="remove_reaction", description="Remove a reaction from a message", inputSchema={ "type": "object", "properties": { "channel_id": { "type": "string", "description": "Channel containing the message" }, "message_id": { "type": "string", "description": "Message to remove reaction from" }, "emoji": { "type": "string", "description": "Emoji to remove (Unicode or custom emoji ID)" } }, "required": ["channel_id", "message_id", "emoji"] } ),