Entity Info
serverID
$serverID[] — Server Identifier
$serverID[] returns the identifier (Snowflake) of the current Discord server.
Syntax
$serverID
Parameters
No parameters.
Return Value
- Type:
string - The value of the
guild.idcontext variable supplied by the host (the ID of the current server), or an empty string if the host supplied none.
Examples
Display the ID
$sendMessage[ID of the server: $serverID]
Restrict a command to a specific server
$if[$serverID!=123456789012345678]
$sendMessage[This command is not available on this server.]
$stop
$endif
$sendMessage[Command executed successfully!]
Logs with identifier
$log[Action performed on server $serverID ($serverName)]
Link to a channel of the server
$sendMessage[Join the general channel: https://discord.com/channels/$serverID/$channelIDFromName[general]]
Notes
$serverIDand$guildIDread the sameguild.idvalue and both accept no argument.- Can be used to construct Discord URLs (channels, messages, etc.).
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.