Discord context
Context contains the data available in one invocation. For example, @user is the person calling the command or using the component, not whoever is looking at the browser preview.
| Root | Available data |
|---|---|
@user |
Invoking user/member |
@channel |
Invocation or delivery channel |
@server |
Current server |
@message |
Triggering or target message, when supplied |
@author |
That message’s author, where available |
@target |
Context-command target or component message |
@args |
Normalized arguments and Kit defaults |
@values |
Selected input values |
@role |
Supplied typed argument named role |
@now |
Execution time in Unix seconds |
@kit |
Kit providing the evaluated content |
@parent |
Parent of the current element, or the root Kit for a subkit’s top-level content |
Entities and their display
Section titled “Entities and their display”Users, channels and roles are typed values. Direct text emission uses their mention; use .name for a name or .id for the exact identifier.
A server emits its known name or ID. A message emits its already-known ordinary content without evaluating it again. Embeds and V2 components are not flattened into a fabricated string.
The property reference shows what each entity supports. For example, @user.nickname reads a server nickname and @message.author.username reads the author’s username from the source message.
Availability varies
Section titled “Availability varies”A slash command does not necessarily provide a target message, role or selection. Prefix commands, context commands and browser-initiated bot sends have their own available data, so an optional root can be nil.
A missing entity or name yields nil. For a message that might run without a source message, write $(@message.author.name ?? "Author unavailable"). The bot uses the same @now in every field of the execution, including fields in an applied subkit.
Continue with arguments and selections to configure inputs or read a menu selection.