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

You can create a custom command with the /config command, then going to the "Custom commands" tab of the selector. DraftBot then asks you for:

  • The name of the command,
  • The description of the command,
  • The action(s) your command has to carry out,
  • The allowed/forbidden roles or channels,
  • Whether the command should appear in /help or not,
  • Whether you want to add a slow mode to your command,
  • Whether you want to set a condition for using it.

When you run a custom command, the text that triggered it stays in the channel. If you want DraftBot to delete your command, you can enable the corresponding option in /config, going to the "Custom commands" tab of the selector, then enabling the "Enable command deletion" button.

::

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!

  1. Add roles
    When the command is run, DraftBot assigns the selected role(s).
  1. Add a temporary role

When the command is run, DraftBot assigns a role, then removes it after a time of your choice.

  1. Remove roles

When the command is run, DraftBot removes the selected role(s).

If you want the command to apply directly to the member using it, simply untick the "target another member" box.

Target another member
Target another member
  1. Shop article
    By using this command, the member buys the selected item.
  1. Add money

When the command is run, DraftBot adds a set amount of money to the member.

::

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.

  1. 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.

If you do not want the command to appear in /help, you can enable this button:

Option for hiding the command
Option for hiding the command

When the command is hidden, it does not return an error message if it is used incorrectly!

If you want to apply a "cooldown" to your custom command, you can set it up flexibly by giving the following information:

  • Number of uses: how many times the same user can use it before triggering a cooldown
  • Slow mode duration: how long the cooldown lasts before the user can use the command again.
The Panel offers an intuitive interface for setting the slow mode.
The Panel offers an intuitive interface for setting the slow mode.

If you are a moderator or an administrator, you can reset your own number of uses of a command! To do so, go to the Panel and click "Edit" next to the command in question.

A "Reset my slow mode" button appears at the bottom left of the screen:

Resetting your slow mode from the panel
Resetting your slow mode from the panel

You can make access to your command conditional on prerequisites:

  • Inventory item: the member can only use the command if they own the set item.
  • Money: the member can only use the command if they hold the set amount of money.
  • Level: only the members of a certain level can use the command.

For the "inventory item" and "money" options, you can decide whether the item (or the amount) is deducted from the member's inventory or not.

Thanks to the Panel, you can configure all of this in a few clicks:

List of the possible conditions
List of the possible conditions

::

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!