Context

Every tag has access to four context globals and the args array. They are plain dictionaries, so you read them with dot notation: $user.username.

$user

The person who ran the tag.

fielddescription
iduser id
usernameusername
discriminatordiscriminator, like 0001
tagusername and discriminator together, like rubik#0001
display_namethe name shown in chat
global_nameglobal display name
avataravatar hash
avatar_urlavatar image URL
bannerbanner hash
bottrue if this is a bot
systemtrue if this is a system account
created_ataccount creation date

$channel

The channel the tag was sent in.

fielddescription
idchannel id
namechannel name
typechannel type number
guild_idid of the guild it belongs to
positionposition in the channel list
topicchannel topic
nsfwtrue for NSFW channels
mentionthe channel mention string
rate_limitslowmode in seconds
created_atchannel creation date

$message

The message that invoked the tag.

fielddescription
idmessage id
contentfull message text
author_idid of the author
authorthe $user dict for the author
channel_idchannel it was sent in
guild_idguild it was sent in
created_atwhen it was sent
edited_timestampwhen it was last edited
mentionslist of users mentioned
mention_roleslist of role ids mentioned
mention_everyonetrue if it pings everyone
attachmentslist of attachments
pinnedtrue if pinned
ttstrue if sent with text to speech
webhook_idwebhook id if sent by a webhook
typemessage type number
flagsmessage flags
urllink to the message

$guild

The server the tag was sent in.

fielddescription
idguild id
nameguild name
iconicon hash
icon_urlicon image URL
bannerbanner hash
banner_urlbanner image URL
descriptionguild description
owner_idid of the owner
featureslist of guild features
premium_tierboost tier
member_countnumber of members
preferred_localeserver language
created_atguild creation date

args

The text after the tag name when it is invoked, split into args.0, args.1, and so on. args is always an array, even when no arguments were passed.

rune
9 lines

Not given?

Check for a missing argument with == null. That is how the tags in the Examples chapter guard their usage.