🗑️
Message deleted
messageDeleteMESSAGE_DELETETriggerFires when a message is deleted.
When to use this
- →Mod-log deleted messages
- →Anti-ghost-ping detection
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.
🗑️Trigger
Message deleted
messageDeleteSparks 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{{message.id}}The deleted message's ID{{message.content}}The deleted message's text (empty if message was not cached){{message.channelId}}ID of the channel the message was in{{message.author.id}}Who sent the message (may be empty for uncached messages){{message.author.name}}Sender's username (may be empty for uncached messages){{channel.id}}ID of the channel (same as message.channelId)Available sparks
Use these in any piece config field inside flows triggered by this event.
| Spark | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{message.id}} | string | The deleted message's ID |
{{message.content}} | string | The deleted message's text (empty if message was not cached) |
{{message.channelId}} | string | ID of the channel the message was in |
{{message.author.id}} | string | Who sent the message (may be empty for uncached messages) |
{{message.author.name}} | string | Sender's username (may be empty for uncached messages) |
{{channel.id}} | string | ID of the channel (same as message.channelId) |
📐
In TypeScript, this would be…
Not something you need to write — Kitcord registers these listeners automatically from your Kit.
TypeScript
client.on("messageDelete", (message) => {
// {{message.content}} may be empty if uncached
});