Skip to content
Variables resetMessageVar

$resetMessageVar

$resetMessageVar restores a message-scoped variable to the default value declared for it in the Variables catalogue of the bot.

Syntax

$resetMessageVar[Name;(Message ID)]

Parameters

Parameter Description
Name Required. The variable name. An empty name raises “A variable name is required.”.
Message ID Optional. Resets only the value stored for this message. An invalid ID raises “A valid message ID is required.”. Unlike $getMessageVar, an empty ID never means the current message.

Behavior

  • Without Message ID, the variable is reset for all messages that have a stored value.
  • The variable must be declared with a default value; otherwise the error No declared default for message variable "name". is raised.
  • Returns an empty string.

Examples

One message

$resetMessageVar[votes;$messageID]
Votes reset for this message.

Every message

$resetMessageVar[votes]

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.