K
Docs
API Reference→Event Types→Message edited
✏️

Message edited

messageUpdateMESSAGE_UPDATETrigger

Fires when a message is edited.

When to use this
  • →Edit logging
  • →Re-scanning edited content for filters

On the canvas

This is what the trigger looks like in your bot's Triggers tab. The sparks listed are available in every node inside the linked flow.

✏️
Message edited
messageUpdate
Trigger
Sparks in this flow
{{input.guild.id}}Your Discord server's unique ID
{{input.guild.name}}Your server's name
{{input.guild.memberCount}}How many members are in the server
{{input.guild.icon}}Your server's icon image (empty if it has none)
{{oldMessage.content}}The message before the edit (empty if uncached)
{{newMessage.content}}The message after the edit
{{message.id}}The message's unique ID
{{message.author.id}}Discord ID of who sent the message
{{message.author.name}}Author's username
{{message.channelId}}ID of the channel
{{channel.id}}ID of the channel (same as message.channelId)
{{channel.name}}Name of the channel
{{message.image}}First image on the edited message — attachment, embed image or sticker
{{message.images}}Every image on the edited message, as a list
{{message.imageCount}}How many images the edited message carries
{{message.attachments}}Every file attached to the edited message (images or not)
{{message.author.avatar}}Avatar of whoever sent the edited message
{{message.url}}Link that jumps straight to the edited message

Available sparks

Use these in any piece config field inside flows triggered by this event.

SparkTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{input.guild.icon}}imageYour server's icon image (empty if it has none)
{{oldMessage.content}}stringThe message before the edit (empty if uncached)
{{newMessage.content}}stringThe message after the edit
{{message.id}}stringThe message's unique ID
{{message.author.id}}stringDiscord ID of who sent the message
{{message.author.name}}stringAuthor's username
{{message.channelId}}stringID of the channel
{{channel.id}}stringID of the channel (same as message.channelId)
{{channel.name}}stringName of the channel
{{message.image}}imageFirst image on the edited message — attachment, embed image or sticker
{{message.images}}arrayEvery image on the edited message, as a list
{{message.imageCount}}numberHow many images the edited message carries
{{message.attachments}}arrayEvery file attached to the edited message (images or not)
{{message.author.avatar}}imageAvatar of whoever sent the edited message
{{message.url}}stringLink that jumps straight to the edited message
📐

In TypeScript, this would be…

Not something you need to write — Kitcord registers these listeners automatically from your Kit.

TypeScript
client.on("messageUpdate", (oldMessage, newMessage) => {
  // {{oldMessage.content}}, {{newMessage.content}}
});