discord_edit_embed
Edit Discord bot embed messages by updating specific fields like title, description, color, or images while removing omitted elements.
Instructions
Edit an embed message previously sent by the bot. Only provided fields are updated; omitted fields are removed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| message_id | Yes | The message ID to edit (must be a bot message with an embed). | |
| title | No | ||
| url | No | URL that makes the title clickable. | |
| description | No | ||
| color | No | Hex color e.g. #5865F2 | |
| fields | No | ||
| author | No | ||
| thumbnail_url | No | ||
| footer | No | ||
| image_url | No | ||
| timestamp | No | If true, adds the current timestamp to the embed. |
Implementation Reference
- src/tools/messages.ts:372-379 (handler)The handler logic for 'discord_edit_embed' which fetches the message, validates the sender, updates the embed, and edits the message.
case "discord_edit_embed": { const channel = await getTextChannel(args.channel_id as string); const msg = await channel.messages.fetch(args.message_id as string); if (msg.author.id !== discord.user?.id) throw new Error("Can only edit embeds sent by the bot."); const embed = buildEmbed(args); await msg.edit({ embeds: [embed] }); return { content: [{ type: "text", text: `✅ Embed edited on message ${args.message_id} in #${channel.name}.` }] }; } - src/tools/messages.ts:137-177 (schema)The schema definition for the 'discord_edit_embed' tool, outlining required parameters and input properties.
{ name: "discord_edit_embed", description: "Edit an embed message previously sent by the bot. Only provided fields are updated; omitted fields are removed.", inputSchema: { type: "object", properties: { channel_id: { type: "string" }, message_id: { type: "string", description: "The message ID to edit (must be a bot message with an embed)." }, title: { type: "string" }, url: { type: "string", description: "URL that makes the title clickable." }, description: { type: "string" }, color: { type: "string", description: "Hex color e.g. #5865F2" }, fields: { type: "array", items: { type: "object", properties: { name: { type: "string" }, value: { type: "string" }, inline: { type: "boolean" }, }, required: ["name", "value"], }, }, author: { type: "object", properties: { name: { type: "string" }, icon_url: { type: "string" }, url: { type: "string" }, }, required: ["name"], }, thumbnail_url: { type: "string" }, footer: { type: "string" }, image_url: { type: "string" }, timestamp: { type: "boolean", description: "If true, adds the current timestamp to the embed." }, }, required: ["channel_id", "message_id"], }, },