$setChannelVar
Set the value of the defined channel variable to a new value. You can provide a channel ID in the 2nd field to set the variable value of the specific channel.

FUNCTION USAGE

  • $setChannelVar[varName;newValue]
  • $setChannelVar[varName;newValue;channelID]

Properties:

varName - The variable being called in the command newValue - The new value for the channel variable channelID - The ID of the channel attached to the variable (You can omit this field of leave empty to set the current channel variable value).

Example 1: Setting the current channel variable value

1
bot.Command({
2
name: "set",
3
code:`
4
__Set the total messages sent in this channel to $message[]__
5
$setChannelVar[channelMsgs;$message[]]
6
`})
Copied!

Example 2: Setting another channel's variable value from the channel you're in

1
bot.Command({
2
name: "set",
3
code:`
4
__Set the total messages sent in <#$mentionedChannels[1]> to $message[]__
5
$setChannelVar[channelMsgs;$message[];$mentionedChannels[1]]
6
`})
Copied!
Copy link
Contents
Properties: