Variables Reference
All template variables available in Nevi custom commands: user, server, channel, arguments, and time variables.
User variables
User variables give you access to information about the person who ran the command.
| Variable | Description | Example Output |
|---|---|---|
{user} | The user's display name | Blake |
{user.name} | The user's username | blake |
{user.id} | The user's Discord ID | 123456789012345678 |
{user.mention} | Mention the user (clickable ping) | @Blake |
{target} | The mentioned user, or the command user if no one was mentioned | @MentionedUser or @Blake |
Target variable
The {target} variable is especially useful for commands that interact with another user. If the person running the command mentions someone, {target} resolves to that mentioned user. If no one is mentioned, it falls back to the command user themselves.
/customcmd create hug {user.name} gives {target} a big hug!Server variables
Server variables provide information about the Discord server where the command is run.
| Variable | Description | Example Output |
|---|---|---|
{server} | The server's name | My Awesome Server |
{server.memberCount} | Total number of members in the server | 1247 |
{channel} | The name of the channel where the command was run | general |
Example: Server info command
/customcmd create serverinfo Welcome to {server}! We currently have {server.memberCount} members. You're chatting in #{channel}.Argument variables
Argument variables let your custom command read text that the user types after the command name. This makes commands interactive and flexible.
| Variable | Description | Example |
|---|---|---|
{args} | All text after the command name | /say hello world → hello world |
{args.0} | First word of the arguments | /say hello world → hello |
{args.1} | Second word of the arguments | /say hello world → world |
{args.count} | Number of words in the arguments | /say hello world → 2 |
Example: Echo command
/customcmd create say {if({args.count} > 0:{user.name} says: {args}:Please provide a message!)}If the user types /say Hello everyone!, Nevi responds with "Blake says: Hello everyone!". If they type just /say with no arguments, they get "Please provide a message!".
Example: Choose sides
/customcmd create pick I choose: {args.0}!Running /pick pizza responds with "I choose: pizza!".
Time variables
Time variables give you the current date and time when the command is run.
| Variable | Description | Example Output |
|---|---|---|
{time} | The current time | 3:45 PM |
{date} | The current date | March 20, 2026 |
Example: Timestamp command
/customcmd create now It's currently {time} on {date}. Command run by {user.name} in #{channel}.Practical examples
Here are some real-world custom commands that combine multiple variables to create useful responses.
Welcome command
/customcmd create welcome Hey {target}! Welcome to {server} - we're glad to have you! We now have {server.memberCount} members.Greets a mentioned user (or the command user if no one is mentioned) with the server name and member count.
User info command
/customcmd create whois Info for {target}: Username: {target} | Server: {server} | Channel: #{channel}Displays basic info about a mentioned user in the current context.
Repeat command
/customcmd create echo {if({args.count} = 0:You didn't say anything!:{user.name}: "{args}")}Repeats whatever the user typed, or tells them they didn't say anything.
Related Commands
/customcmdmanagementRequires modCreate and manage custom commands with template support