Custom commands

With DraftBot, you can create your own commands!

Configuration

⫸ Open the DraftBot panel

Fill in the various fields (name, description, actions, etc.), click the "Create" button, and your custom command is ready to use straight away!

Custom command configuration panel
Custom command configuration panel

For more customization, expand the "Advanced" menu!

Need to edit or delete a command?

No problem! Click "Edit" or "Delete":

Buttons for editing or deleting a custom command
Buttons for editing or deleting a custom command

Actions

Actions are the heart of your custom command, and they come in 4 types:

Send a message

When the command is run, DraftBot sends a message.

The message can contain markdown and variables. If you configure it from the Panel, you can even add embeds to it!

Advanced options

Where to find them?

From the Panel, you can bring up these options by clicking "Advanced", below your actions.

Expanding the advanced options menu
Expanding the advanced options menu

What do they do?

The advanced options fall into 4 categories:

Access to a command can be restricted by two criteria:

  1. Restrict by roles
    You can reserve the use of a command for certain specific roles, or on the contrary forbid it only to certain specific roles.

    Users with the Administrator permission can use the command whatever the allowed or forbidden roles.

  2. Restrict by channels
    In the same way, you can restrict the use of your command to certain specific channels, or forbid it in certain specific channels.

    To switch between the "allow" and "forbid" modes, click "ALLOWED/FORBIDDEN".

    The active mode is written in white, while the other one is greyed out.

    In this configuration, if I add roles/channels, they will not have access to the command.
    In this configuration, if I add roles/channels, they will not have access to the command.

Going further

Arguments

You can make the messages of your custom commands more personal and more relevant by using arguments!

An "argument" is a piece of information you give when using a command.

For example, in the command !compliment @DraftBot cool, @DraftBot is the first argument, and cool is the second one.

Here are the argument variables available with DraftBot:

VariableDescriptionExample
{args.1}First argument@DraftBot
{args.2}Second argumentcool
{args.N}Nth argument (up to 20)foo
{args.1+}Every argument from the first one@DraftBot cool
{args.2+}Every argument from the second onecool
{args.all}Every argument@DraftBot cool
{args.count}Number of arguments2

Features:

  • Support for modifiers: {args.1?uppercase}
  • Default values: {args.1:default=none}
  • Syntax consistent with the other variables

Variables

You can customize your message actions with variables:

VariableDescriptionExample
{money}Money1,234
{money.record}Money record5,678
{money.currency_icon}Currency icon💰
{money.rank}Position in the leaderboard3
{money.next_user}Member above in the leaderboard@DraftBot
{money.next_user.id}ID of the member above in the leaderboard318312854816161792
{money.next_user.money}Amount of money of the member above in the leaderboard2,500
{money.next_user.money_diff}Money difference with the member above in the leaderboard2,500
{money.to_position:position=N}Money needed to reach position N in the leaderboard1,200
{level}Level25
{level.rank}Position in the leaderboard5
{level.next_user}Member above in the leaderboard@DraftBot
{level.next_user.id}ID of the member above in the leaderboard318312854816161792
{level.next_user.xp}Amount of experience of the member above in the leaderboard2,500
{level.next_user.xp_diff}Experience difference with the member above in the leaderboard15,389
{level.next_user.level}Level of the member above in the leaderboard2,500
{level.next_user.level_diff}Level difference with the member above in the leaderboard2
{xp}Total experience12,500
{xp.current_level}Experience of the current level250
{xp.next_level}Experience needed to reach the next level750
{xp.to_level:level=N}Experience needed to reach level N15,000
{xp.to_position:position=N}Experience needed to reach position N in the leaderboard5,000
{birthday}Birth date15 March
{birthday.next}Next birthdayIn 2 months
{age}The user's age25 years old

In addition to the other variables already available globally!