K
Docs
API ReferenceEvent TypesMessage 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
{{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

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
{{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
📐

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}}
});