onMessageDelete

Triggers when a message is deleted.

Add The Event: bot.addEvent("onMessageDelete")

Type: deleteCommand

Base Code

bot.command({
    type: "deleteCommand", // onMessageDelete type.
    channel: "channelID", // The channel which the message gets sent in.
    code: `code` // The code to run a message is deleted.
})

Example

bot.command({
    type: "deleteCommand",
    channel: "39459438494840494",
    code: `A message was deleted by <@$authorID>. Contents: $message`
})

onMessageDelete triggers for all servers (globally). You can prevent this by using server variables. (learn-more)

Last updated

Was this helpful?