Variables

You may want to display certain server information in your command.

On the previous page, we learned how to send basic text to the user. But we can also send various information about the command author or the server. Here are a list of variables for our commands:

Variable Name

Value

{member}

A user mention.

{member.name}

The name of the current user.

{member.avatar}

The avatar of the current user.

{member.id}

ID of the current user.

{server}

The name of the server.

{channel}

A channel mention.

{channel.name}

The name of the current channel.

{channel.id}

ID of the current channel.

{message}

Content of the command message

Example: Avatar command

Say we want to send the user's avatar to then when they type a command, and we want to mention them whilst doing so.

Now, when running the avatar command, this is what we will see:

The variables that we gave to the command were replaced in our command, resulting in the user being provided with their avatar.

And that's all there is to variables!