Skip to main content
Glama

discord_edit_message

Edit bot messages in Discord channels by providing channel ID, message ID, and new content to update text.

Instructions

Edit a message sent by the bot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYes
message_idYesThe message ID to edit (must be a bot message).
contentYesNew text content for the message.

Implementation Reference

  • The handler function that executes the `discord_edit_message` logic.
    case "discord_edit_message": {
      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 messages sent by the bot.");
      const edited = await msg.edit(args.content as string);
      return { content: [{ type: "text", text: `✅ Message ${edited.id} edited in #${channel.name}.` }] };
    }
  • The input schema definition for `discord_edit_message`.
    {
      name: "discord_edit_message",
      description: "Edit a message sent by the bot.",
      inputSchema: {
        type: "object",
        properties: {
          channel_id: { type: "string" },
          message_id: { type: "string", description: "The message ID to edit (must be a bot message)." },
          content: { type: "string", description: "New text content for the message." },
        },
        required: ["channel_id", "message_id", "content"],
      },
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PaSympa/discord-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server