discord_edit_webhook
Modify Discord webhook properties including name, avatar, and channel assignment to update automated messaging configurations.
Instructions
Edit a webhook's name, avatar, or channel.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| webhook_id | Yes | ||
| name | No | New name for the webhook. | |
| avatar | No | New avatar URL for the webhook. | |
| channel_id | No | Move the webhook to a different channel. |
Implementation Reference
- src/tools/webhooks.ts:166-175 (handler)The handler implementation for the `discord_edit_webhook` tool. It fetches the webhook using `discord.fetchWebhook` and then updates it using `webhook.edit` with the provided parameters (name, avatar, or channel_id).
case "discord_edit_webhook": { const webhookId = validateId(args.webhook_id, "webhook_id"); const webhook = await discord.fetchWebhook(webhookId); const editOptions: Record<string, unknown> = {}; if (args.name !== undefined) editOptions.name = args.name as string; if (args.avatar !== undefined) editOptions.avatar = args.avatar as string; if (args.channel_id !== undefined) editOptions.channel = validateId(args.channel_id, "channel_id"); await webhook.edit(editOptions); return { content: [{ type: "text", text: `✅ Webhook "${webhook.name}" (id: ${webhook.id}) updated.` }] }; } - src/tools/webhooks.ts:64-77 (schema)The definition and input schema for the `discord_edit_webhook` tool, specifying the required `webhook_id` and optional parameters.
{ name: "discord_edit_webhook", description: "Edit a webhook's name, avatar, or channel.", inputSchema: { type: "object", properties: { webhook_id: { type: "string" }, name: { type: "string", description: "New name for the webhook." }, avatar: { type: "string", description: "New avatar URL for the webhook." }, channel_id: { type: "string", description: "Move the webhook to a different channel." }, }, required: ["webhook_id"], }, },