Custom Commands

Variables

Use dynamic placeholders to personalize command responses with user, server, and contextual information.

Overview

Variables are placeholders in command responses that get replaced with real data when the command executes. They allow you to create dynamic, personalized responses without manually entering user or server information.

Variables use curly braces syntax like {variable_name}. When a user triggers the command, SYNTHET automatically replaces variables with the appropriate values.

User Variables

Get information about the user who triggered the command:

{user}Username of the person who triggered the command@john_doeHello {user}!
{user_id}Discord numeric ID of the user123456789012345678User ID: {user_id}
{mention}Mention the user (creates a ping)@john_doe{mention} your turn!
{user_avatar}URL to the user's profile picturehttps://...Avatar: {user_avatar}
{user_created}Date the user's account was created2020-01-15Member since {user_created}
{user_joined}Date the user joined this server2023-06-20Joined {user_joined}
{user_roles}List of all roles the user has@Admin, @ModeratorYour roles: {user_roles}
{user_highest_role}User's highest priority role@ModeratorRank: {user_highest_role}

Server Variables

Reference information about the Discord server:

{server}Name of the Discord serverMy Awesome ServerWelcome to {server}!
{server_id}Numeric ID of the server987654321098765432Server ID: {server_id}
{server_icon}URL to the server's icon/logohttps://...Icon: {server_icon}
{member_count}Total number of members in the server245We have {member_count} members!
{owner}Name of the server ownerAdminUserOwner: {owner}
{owner_id}Discord ID of the server owner111222333444555666Owner ID: {owner_id}
{creation_date}Date the server was created2019-03-10Created {creation_date}
{server_region}Server's geographic regionus-east-1Region: {server_region}

Channel Variables

Access information about the current channel where the command is used:

{channel}Name of the channel (without #)generalWelcome to {channel}!
{channel_id}Numeric ID of the channel333444555666777888Channel ID: {channel_id}
{channel_topic}Channel topic/descriptionGeneral discussionTopic: {channel_topic}
{channel_type}Type of channel (text, voice, category)textType: {channel_type}
{channel_created}Date the channel was created2020-05-12Channel created {channel_created}
{channel_messages}Approximate number of messages in channel5,234{channel_messages} messages
{channel_mention}Mention the channel (creates a link)#generalCheck {channel_mention}

Time Variables

Include current date and time information:

{now}Current date and time2024-01-15 14:30:45Executed {now}
{date}Current date only2024-01-15Date: {date}
{time}Current time only14:30:45Time: {time}
{day}Day of the weekMondayHappy {day}!
{month}Current month nameJanuaryWelcome to {month}
{year}Current year2024Year: {year}
{timestamp}Unix timestamp1705334445Timestamp: {timestamp}

Conditional Variables

Show different content based on conditions:

If User Has Role

{if:role:Moderator}You have moderator powers!{endif}

Shows text only if user has the Moderator role

If User is Admin

{if:admin}Welcome back, admin!{endif}

Shows text only if user has administrator permissions

If/Else Statement

{if:admin}Admin panel{else}You need admin!{endif}

Shows different content based on admin status

Random Variables

Create dynamic responses with random selection:

Random Choice

{random:Great job!|You rock!|Amazing!|Fantastic!}

Randomly picks one option separated by pipes

Random Number

{random:1-100}

Random number between 1 and 100

Combining Random with User

Congratulations {user}! You earned {random:10-50} points!

Mix variables for personalized random content

Variable Examples

See how to use variables in real commands:

Welcome Message

Welcome to {server}! I'm {bot_name}, and we're glad you're here, {mention}. Please read {channel_mention} and follow the rules!

Shows: "Welcome to My Server! I'm SYNTHET, and we're glad you're here, @john_doe. Please read #rules and follow the rules!"

Server Info Command

🏢 **Server:** {server} | 👥 **Members:** {member_count} | 👑 **Owner:** {owner} | 📅 **Created:** {creation_date}

Shows complete server statistics in one line

Personalized Compliment

{mention} {random:You're awesome!|You're incredible!|You're amazing!|You're fantastic!}

Each use gives a different compliment to the user

Stats Command

📊 {user} stats - Joined: {user_joined} | Highest Role: {user_highest_role} | Account Created: {user_created}

Displays user membership and account information

Conditional Admin Command

{if:admin}Admin dashboard for {user}. Last action: {now}{else}You don't have access!{endif}

Different message based on user's admin status

Formatting with Variables

Format and style variables within your command responses:

Bold Text

**{user}** just leveled up to {level}!

Makes the username bold in Discord

Italic Text

_Welcome to {server}!_

Makes text italic

Code Block

`User ID: {user_id}`

Formats as inline code

Headers

# Server Info for {server}

Creates a large header (use #, ##, ### for sizes)

Special Variables

Additional variables for advanced use cases:

{bot_name}

The bot's username (usually SYNTHET)

{command_name}

The exact trigger that was used to invoke the command

{arg1}, {arg2}, etc.

Access command arguments passed by the user

{args}

All arguments combined as a single string

Tips & Best Practices

  • • Use {mention} to tag users instead of just their name
  • • Combine multiple variables for rich, personalized responses
  • • Use {random:option1|option2|option3} to avoid repetitive messages
  • • Check for roles with {if:role:RoleName} before granting access
  • • Use {user_highest_role} to show a user's main rank
  • • Include {now} in logs or actions for timestamps
  • • Make responses personal with {user} - it feels more welcoming
  • • Use conditional variables to create context-aware responses
  • • Format important information with **bold** or __underline__
  • • Remember variable names are case-sensitive - use exact syntax