Skip to content
Getting started

Message variables

Placeholders that Koya replaces when it sends a message.

A variable is a word between braces, like {user.mention}, that Koya replaces when it sends the message. The message editors in the dashboard list the variables you can use there.

Available in almost every message editor.

Variable Value
{server.name} The server name
{server.id} The server ID
{server.icon} The server icon

Available where a member triggers the message: announcements, levels, birthdays, auto responders and auto threads.

Variable Value
{user} Mentions the member, or shows their username
{user.mention} Mentions the member
{user.username} The member’s username
{user.id} The member’s ID
{user.avatar} The member’s avatar
Variable Value
{membercount} The number of members
{membercount.ordinal} The same number as an ordinal
{#channel} Mentions a channel: replace channel with its name or ID
{@role} Mentions a role: replace role with its name or ID
{:emoji} Shows a server emoji: replace emoji with its name or ID

In a Components V2 message, {announcement.image} shows the generated card. Put it inside a media component to choose where it appears.

Variable Value
{level} The member’s level
{xp.current} XP earned in the current level
{xp.required} XP needed for the next level
{xp.total} Total XP
{messages} Messages the member has sent
Variable Value
{args} Repeats what was typed after the command
{@user} Mentions a member: replace user with their name or ID
{&role} Mentions a role: replace role with its name or ID
{#channel} Mentions a channel: replace channel with its name or ID
{:emoji} Shows a server emoji: replace emoji with its name or ID
{user.displayname} The display name of the member who ran the command
{user.random} The username of a random member
{mention.users} Mentions the members mentioned in the original message
{repliedUser} Mentions the member you replied to when running the command
{channel.name} The channel where the command was run
{channel.id} That channel’s ID
{message.id} The message ID
{server.membercount} The number of members
{server.owner.id} The ID of the server owner
{prefix} The server prefix
{delete} Deletes the original message
{dm} Replies in direct messages
{nsfw} Cancels the command if the channel is not NSFW

Auto threads, starboard, giveaways, tickets and the social feeds have their own variables: the editor of each module lists them.