discord_reply_dm
Reply to a specific bot message in a Discord DM by providing user ID, message ID, and reply content.
Instructions
Reply to a specific message in a DM conversation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes | The Discord user ID. | |
| message_id | Yes | The message ID (must be a bot message). | |
| content | Yes | The reply content. |
Implementation Reference
- src/tools/dm.ts:242-249 (handler)Handler for discord_reply_dm: fetches the user, creates DM channel, fetches the target message, and replies to it.
case "discord_reply_dm": { const user = await discord.users.fetch(validateId(args.user_id, "user_id")); const dm = await user.createDM(); const msgId = validateId(args.message_id, "message_id"); const target = await dm.messages.fetch(msgId); const sent = await target.reply(args.content as string); return { content: [{ type: "text", text: `✅ DM reply sent to ${user.username} (message id: ${sent.id}).` }] }; } - src/tools/dm.ts:153-166 (schema)Schema definition for discord_reply_dm: requires user_id, message_id, and content.
{ name: "discord_reply_dm", description: "Reply to a specific message in a DM conversation.", inputSchema: { type: "object", properties: { ...userIdProp, ...messageIdProp, content: { type: "string", description: "The reply content." }, }, required: ["user_id", "message_id", "content"], }, }, - src/tools/index.ts:26-43 (registration)The dm module is imported and registered in the tool registry, making discord_reply_dm available for routing.
import dm from "./dm.js"; const modules: ToolModule[] = [ discovery, messages, channels, permissions, members, roles, moderation, screening, stats, forums, webhooks, scheduledEvents, invites, dm, ]; - src/tools/dm.ts:1-2 (helper)Imports discord client instance and validateId helper used in the handler.
import { EmbedBuilder, ColorResolvable } from "discord.js"; import { discord, validateId } from "../client.js";