onMessageUpdate
Triggers when a user edits their message.
Add The Event: bot.addEvent("onMessageUpdate")
Type: updateCommand
Base Code
bot.command({
type: "updateCommand", // onMessageUpdate type.
channel: "channelID", // The channel which the message gets sent in.
code: `code` // The code to run when someone edits their message.
})
Example
bot.command({
type: "updateCommand",
channel: "39459438494840494",
code: `A message was edited by <@$oldMessage[userID]>. $oldMessage[content] => $message`
})
// $oldMessage holds the data for the message before it got edited.
// You can use regular functions like $message to return the data for the new message.
Using $oldMessage
Usage
$oldMessage[option;(optional) index;(optional) index2]
Breakdown
option
- The data to return. (see available options section)
index
- In case the field name/value option is picked, this option will be used to choose which field name/value to get. Optional.
index2
- Which embed to get the data from, in case there were multiple embeds attached to the message. Optional.
Available Options
content
attachment
author
authorURL
channelID
description
fieldName
fieldValue
footer
footerURL
image
messageID
thumbnail
title
userID
Last updated
Was this helpful?