Moderation
voiceUserLimit
$voiceUserLimit
The $voiceUserLimit function returns the user limit value of the channel in which the command runs (the channel.userLimit runtime variable).
Syntax
$voiceUserLimit[(channelID)]
Parameters
| Parameter | Description |
|---|---|
channelID |
Optional - The ID of a channel. It must be a valid ID of an existing channel (Invalid channel ID. / Channel not found. otherwise), but in the current engine it does not change the returned value: the limit of the channel of the current command is always returned. If omitted, the current channel is checked. |
Return Value
- Type: String (number)
- The value of
channel.userLimitfor the channel of the current command, as provided by Discord for that channel. 0if the runtime has no user limit value for the channel (for example a channel type that has no user limit).
Examples
Showing the limit of the current channel
$if[$voiceUserLimit==0]
No user limit value is available for this channel.
$else
This channel is limited to **$voiceUserLimit** users.
$endif
Embed
$title[🔊 Channel info]
$description[**Limit:** $voiceUserLimit (0 when no limit value is available)]
$color[#5865F2]
Notes
- To read the limit of a voice channel, run the command from that channel (for example in the text chat of the voice channel): the returned value always comes from the channel of the command, whatever
channelIDis given. - The function needs a channel service to check the channel; without it the call fails.
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.