---
description: Everything you must know about how to create and use Custom Commands.
---

# Custom Commands

{% hint style="warning" %}
Custom Commands are [Rich Commands](rich-commands).\
It's highly recommended to read the [Rich Commands page](rich-commands) before reading this page.
{% endhint %}

## Custom Commands Basics

### Managing Custom Commands

To manage custom commands on your server you have to use `customcommand` (or `cc`)

| Usage                             | Help                                                    |
| --------------------------------- | ------------------------------------------------------- |
| **`cc add [command] [content]`**  | Allows you to add a custom command on the server.       |
| **`cc edit [command] [content]`** | Allows you to edit a custom command on the server.      |
| **`cc delete [command]`**         | Allows you to remove a custom command from the server.  |
| **`cc list`**                     | Displays the custom commands list.                      |
| **`cc raw [command]`**            | Displays the real content of a custom command.          |

**Example :**

![Simple custom command](https://516520326-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRS4geI3sFMSPJz8Vid%2F-LRXtrgDVaaLdD9EVgou%2F-LRXu8tlKxLvtZo88Q46%2Fimage.png?alt=media\&token=e851aa74-4433-4122-b4c7-8dd3a131d2b6)

### Creating an alias

To create an alias you can use the fact that [you can call a command](../rich-commands#you-can-call-a-command) with Rich Commands.

![The letter k is now an alias for roll](https://516520326-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRS4geI3sFMSPJz8Vid%2F-LRXtrgDVaaLdD9EVgou%2F-LRXuseq5ODq1CM6V9F5%2Fimage.png?alt=media\&token=3c606eff-9450-40e3-b72b-4385f5dbb04e)

{% hint style="info" %}
When creating the custom command, you can specify a static parameter for the command, for example`>>>roll 10`will call `roll 10`when using`k`&#x20;
{% endhint %}

### Commands which doesn't need any parameter

Here's an example of a russian roulette which either play an earrape, or a relaxing song.

![Haha, I got lucky](https://516520326-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRS4geI3sFMSPJz8Vid%2F-LRXtrgDVaaLdD9EVgou%2F-LRXvWSb4ftMDGAh9fIk%2Fimage.png?alt=media\&token=b2793897-3ca0-4aa4-801d-c3371487b251)

### Mixing several commands together

You can call several commands thanks to`&&`

**Example :**

![Same example than Rich Command one, but in a custom command.](https://516520326-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRS4geI3sFMSPJz8Vid%2F-LRXtrgDVaaLdD9EVgou%2F-LRXxLJsD_oIwVyD2huS%2Fimage.png?alt=media\&token=3686c445-8585-4e2e-a76b-16d179fc4040)

## Custom Commands Advanced

### How to get user's parameter

If you don't want a static parameter, you can ask the user for one.

| Number  | Effect                                    |
| ------- | ----------------------------------------- |
| **`x`** | Empty.                                    |
| **`&`** | Same as`0`but without counting quotations |
| **`0`** | Gives every words.                        |
| **`1`** | Gives the first word.                     |
| **`2`** | Gives the second word.                    |
| **`3`** | Gives the third word.                     |
| ...     | ...                                       |

{% hint style="info" %}
Using quotations between a group of words allows you to parse several words instead of parsing them one by one.\
\
**Example :** \
`cmd "This is a test" Hello "Help please"`\
{1} = This is a test\
{2} = Hello\
{3} = Help please
{% endhint %}

**Example :**

![](https://516520326-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRS4geI3sFMSPJz8Vid%2F-LRXtrgDVaaLdD9EVgou%2F-LRXyA36QWCUNGZJPrTq%2Fimage.png?alt=media\&token=64a16993-feb1-4219-8921-3a24d7c5d104)

{% hint style="info" %}
By default, if you only specify `>>>volume`without`{1}`it's the same thing as`>>>volume {0}` . This means that every parameter is parsed, when`{1}`used, the command will only take the first one.
{% endhint %}

### Conditions

You can set a default value to use when no arguments are passed.

**Example :**

![When calling =vm, since I didn't specify a third parameter, it returns Cool Song](https://516520326-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRS4geI3sFMSPJz8Vid%2F-LRXyyJk8uJOygIWrK_K%2F-LRY2xvrY19xym2DaXeI%2Fimage.png?alt=media\&token=cdd5d10f-21bf-44dc-b7f5-04bee1e739bf)

### Others

#### You can select several parameters based on their index.&#x20;

**Example :**

```
cmd This is an example

{1:3} = This is an
{-1} = example
{-1:-2} = example an
{2:} = is an example
```

{% hint style="info" %}
You can use negative numbers to start counting from the end of the argument list.
{% endhint %}
