Entity Info
isMessageEdited
$isMessageEdited
The function $isMessageEdited checks if the given message was edited. It returns "true" or "false".
Syntax
$isMessageEdited[channelID;messageID]
Parameters
| Parameter | Description |
|---|---|
channelID |
Required. The ID of the channel containing the message. |
messageID |
Required. The ID of the message. |
Return Value
| Type | Description |
|---|---|
string |
"true" if the message was edited, "false" otherwise. |
Examples
Simple check
$if[$isMessageEdited[$channelID;$messageID]==true]
$sendMessage[⚠️ This message was modified.]
$else
$sendMessage[Original message.]
$endif
Edit log
$if[$isMessageEdited[$channelID;$messageID]==true]
$channelSendMessage[$channelIDFromName[logs];$username edited their message $messageURL]
$endif
$sendMessage[Command executed.]
User warning
$if[$isMessageEdited[$channelID;$messageID]==true]
$sendMessage[Warning: your command comes from an edited message.]
$stop
$endif
Notes
- Returns a string
"true"or"false", not a boolean. - To get the edit date, use
$messageEditedTimestamp[channelID;messageID]. - A bare
$isMessageEditedis invalid: both arguments are required. - An ID that is empty or not a positive integer raises
Invalid Discord ID.; a channel that cannot hold messages raisesChannel does not support messages. - The result is
"true"when Discord reports an edit date for the message.
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.