Properties and Kit application
Properties read values from the execution context. @user is the member who invoked the bot. A user supplied by a command option can have a name and avatar without member roles. The types listed beneath each heading show which values support that property.
An ID in quotes is text. To get an entity, use the context or a typed command option. A supported property can return nil if its data is missing. A property the type does not support is an error. For example, @user.nickname can be absent, but @user.content is invalid.
KitStructure → String · User | Member | Channel | VoiceChannel | Role | Server → String
Returns the known display name. For a Kit or subkit, this is the name set in the editor.
Hi @user.name!Result:
Hi Anya!For users, the server nickname takes precedence over the global display name and then the username. If no name is available, use a fallback such as $(@args.person.name ?? "Someone").
KitStructure → String · User | Member | Channel | VoiceChannel | Role | Server | Message → String
Returns the exact identifier as text. Display or copy long Discord IDs without converting them to numbers. A Kit or subkit returns its Pokkan ID.
ID: @user.idResult:
ID: 100.mention
Section titled “.mention”User | Member | Channel | VoiceChannel | Role → String
Formats a mention for a user, channel, or role. Writing the entity directly, as in @user, also inserts its mention.
@user.mention · @channelResult:
<@100> · <#200>Allowed mentions control who receives a notification. For servers and messages, use .id.
.avatar
Section titled “.avatar”User | Member → String
Returns the available avatar URL, including a default avatar for users received from Discord. A user known only by ID may return nil. Reading this property uses the data already available to the bot.
$(@user.avatar ?? "No avatar")Result:
No avatar.nickname
Section titled “.nickname”Member → String
The member’s nickname in the server. Use $(@user.nickname ?? @user.name) to fall back to the display name.
.bitrate
Section titled “.bitrate”Channel | VoiceChannel → Number
The known bitrate of a voice channel, in bits per second. A text channel or a channel known only by ID can give nil. Check the value before dividing by 1,000 to display kilobits per second.
.content
Section titled “.content”Message → String
The text of the source or target message, including its Markdown. A message that contains only embeds or V2 elements may have empty text.
.roles
Section titled “.roles”Member → List
Returns the member’s roles as role entities. The invoking member’s roles include @everyone. Use a role entity with in. A role name or ID written as text is a different kind of value.
$if(@role in @user.roles) Role present.$else Role unavailable or absent.$endResult:
Role present.More properties
Section titled “More properties”.username
Section titled “.username”User | Member → String
The account’s Discord username. Use .name for the display name or nickname. The username can be absent if the invocation supplied only an ID.
User | Member → Boolean
Indicates whether the account is a bot. false identifies a person. nil means Discord did not supply that information for the entity.
.createdAt
Section titled “.createdAt”User | Member | Message | Server → Number
The creation time derived from the Discord ID, in whole Unix seconds. For a member, this is the account creation time. Use $timestamp(@user.createdAt, "D") to display the date.
.topic
Section titled “.topic”Channel → String
The known topic of a text channel. Use $(@channel.topic ?? "No topic set") to supply a fallback.
.author
Section titled “.author”Message → User
The user who wrote the message. This returns an entity. In a message context command, @message.author.username is the original author’s username and @user.username is the username of the person who invoked the command.
Choose which Kit to send
Section titled “Choose which Kit to send”Applying a Kit or subkit replaces the entire message, including its format and Sources. The person and channel stay the same. The first application reached in a given Kit takes effect, and the selected Kit can apply another prepared target.
$applyKit(name, arguments = {})
Section titled “$applyKit(name, arguments = {})”(String, Map) → Map · Contextual
Selects a saved Kit in the current server by name or ID. Use a literal string, for example $applyKit("Welcome", { name: @user.name }). Use the ID to distinguish Kits with the same name. The second argument is a map whose keys are the target Kit’s argument names.
$applySubkit(name, arguments = {})
Section titled “$applySubkit(name, arguments = {})”(String, Map) → Map · Contextual
Selects a subkit by name in the root Kit. Each subkit has its own message, arguments, and Sources and uses the root Kit’s access rules. If the inputs are optional or have defaults, $applySubkit("Welcome") is enough.
Create Music and Drawing subkits, then put this text in the Source of a String Select. Give the Music option the value music.
$if("music" in @values) $applySubkit("Music")$else $applySubkit("Drawing")$endThe compiler requires a literal target. The bot checks every reference before evaluating conditions, so a missing or ambiguous target or a reference cycle blocks delivery even if the branch would be skipped.
$child(parent, key)
Section titled “$child(parent, key)”(Any, Any) → Any · Contextual
Reads a child from an available structure. $child(@kit, "Music") finds a subkit by name. $($child(@kit, "Music").name ?? "No workshop") displays its name or a fallback. For a message element, pass the field key. For a list, pass its zero-based index.
Use @parent to read the parent of the current message element. From a subkit’s top-level content, it refers to the root Kit. For example, $($child(@parent, "type")) in a Button label reads its Action Row’s type. Missing children and indexes return nil. Use $applySubkit with a literal name to send the subkit’s message.