> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jar.rip/llms.txt
> Use this file to discover all available pages before exploring further.

# Command Management

> Configure jar's commands & modules to your server's liking.

## Introduction

jar has a variety of commands that you can use to configure entire commands and modules.
You can enable or disable commands and modules, as well as restrict them to specific roles.

## Disabling commands

With the `disablecommand` command, you can disable a command for a specific user or channel.
This means that the command will no longer be available to use by that user or channel you specified.

<Warning>
  Only the **server owner** can use the command that is bound to be disabled.
</Warning>

<Tip>
  You can use the alias `dcmd` instead of `disablecommand`, to make the command easier to type.
</Tip>

To disable a command, use the `disablecommand` command, followed by the user or channel you'd like to disable it for & the command you'd like to disable.

<CodeGroup>
  ```ruby Syntax theme={null}
  disablecommand <user or channel> <command>
  ```

  ```ruby Example theme={null}
  ,,disablecommand @jaradc purge
  ```
</CodeGroup>

You should see a message confirming that the command has been disabled.

<Frame caption="Command disabled confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/placeholder.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=dc43bd89c8f518e713fde93bff1d5af2" width="600" height="400" data-path="images/placeholder.png" />
</Frame>

### Disabling commands for the whole server

You can also disable a command for the whole server by using the `disablecommand all` command.
This means that the command will no longer be available to use by anyone in your server, only the **server owner**.

<CodeGroup>
  ```ruby Syntax theme={null}
  disablecommand all <command>
  ```

  ```ruby Example theme={null}
  ,,disablecommand all purge
  ```
</CodeGroup>

You should see a message confirming that the command has been disabled for the whole server.

<Frame caption="Command disabled for the whole server confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/placeholder.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=dc43bd89c8f518e713fde93bff1d5af2" width="600" height="400" data-path="images/placeholder.png" />
</Frame>

## Enabling commands

With the `enablecommand` command, you can re-enable a command for a specific user or channel.
This means that the command will be available again to use by that user or channel you specified.

<Tip>
  You can use the alias `ecmd` instead of `enablecommand`, to make the command easier to type.
</Tip>

To enable a command, use the `enablecommand` command, followed by the user or channel you'd like to enable it for & the command you'd like to enable.

<CodeGroup>
  ```ruby Syntax theme={null}
  enablecommand <user or channel> <command>
  ```

  ```ruby Example theme={null}
  ,,enablecommand @jaradc purge
  ```
</CodeGroup>

You should see a message confirming that the command has been enabled.

<Frame caption="Command enabled confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/placeholder.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=dc43bd89c8f518e713fde93bff1d5af2" width="600" height="400" data-path="images/placeholder.png" />
</Frame>

### Enabling commands for the whole server

You can also enable a command for the whole server by using the `enablecommand all` command.
This means that the command will be available again to use by everyone in your server.

<CodeGroup>
  ```ruby Syntax theme={null}
  enablecommand all <command>
  ```

  ```ruby Example theme={null}
  ,,enablecommand all purge
  ```
</CodeGroup>

## Disabling modules

With the `disablemodule` command, you can disable a module for a specific channel.
This means commands that belong to the module will no longer be available to use by the channel you specified.

<Warning>
  Only the **server owner** can use the module that is bound to be disabled.
</Warning>

<Tip>
  You can use the alias `dmod` instead of `disablemodule`, to make the command easier to type.
</Tip>

<Warning>
  Make sure you use the correct case for the module name, as it is case-sensitive.
  (e.g. `Moderation` not `moderation`)
</Warning>

To disable a module, use the `disablemodule` command, followed by the channel you'd like to disable it for & the module you'd like to disable.

<CodeGroup>
  ```ruby Syntax theme={null}
  disablemodule <channel> <module>
  ```

  ```ruby Example theme={null}
  ,,disablemodule @jaradc Moderation
  ```
</CodeGroup>

You should see a message confirming that the module has been disabled.

<Frame caption="Module disabled confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/placeholder.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=dc43bd89c8f518e713fde93bff1d5af2" width="600" height="400" data-path="images/placeholder.png" />
</Frame>

### Disabling modules for the whole server

You can also disable a module for the whole server by using the `disablemodule all` command.
This means that the module will no longer be available to use by anyone in your server, only the **server owner**.

<Warning>
  Make sure you use the correct case for the module name, as it is case-sensitive.
  (e.g. `Moderation` not `moderation`)
</Warning>

<CodeGroup>
  ```ruby Syntax theme={null}
  disablemodule all <module>
  ```

  ```ruby Example theme={null}
  ,,disablemodule all Moderation
  ```
</CodeGroup>

You should see a message confirming that the module has been disabled for the whole server.

<Frame caption="Module disabled for the whole server confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/placeholder.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=dc43bd89c8f518e713fde93bff1d5af2" width="600" height="400" data-path="images/placeholder.png" />
</Frame>

## Enabling modules

With the `enablemodule` command, you can re-enable a module for a specific channel.
This means that the module will be available again to use by that channel you specified.

<Tip>
  You can use the alias `emod` instead of `enablemodule`, to make the command easier to type.
</Tip>

<Warning>
  Make sure you use the correct case for the module name, as it is case-sensitive.
  (e.g. `Moderation` not `moderation`)
</Warning>

To enable a module, use the `enablemodule` command, followed by the channel you'd like to enable it for & the module you'd like to enable.

<CodeGroup>
  ```ruby Syntax theme={null}
  enablemodule <channel> <module>
  ```

  ```ruby Example theme={null}
  ,,enablemodule @jaradc Moderation
  ```
</CodeGroup>

You should see a message confirming that the module has been enabled.

<Frame caption="Module enabled confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/placeholder.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=dc43bd89c8f518e713fde93bff1d5af2" width="600" height="400" data-path="images/placeholder.png" />
</Frame>

### Enabling modules for the whole server

You can also enable a module for the whole server by using the `enablemodule all` command.
This means that the module will be available again to use by everyone in your server.

<Tip>
  You can use the alias `emod` instead of `enablemodule`, to make the command easier to type.
</Tip>

<Warning>
  Make sure you use the correct case for the module name, as it is case-sensitive.
  (e.g. `Moderation` not `moderation`)
</Warning>

<CodeGroup>
  ```ruby Syntax theme={null}
  enablemodule all <module>
  ```

  ```ruby Example theme={null}
  ,,enablemodule all Moderation
  ```
</CodeGroup>

You should see a message confirming that the module has been enabled for the whole server.

<Frame caption="Module enabled for the whole server confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/placeholder.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=dc43bd89c8f518e713fde93bff1d5af2" width="600" height="400" data-path="images/placeholder.png" />
</Frame>

## Difference between `restrictcommand` and `restrictcommand reverse`

You might be wondering how the `restrictcommand` command differs from `restrictcommand reverse`.

* The `restrictcommand` command restricts a command to specific roles:
  * If users **have** the specified role, they **can** use the command.

* The `restrictcommand reverse` command blocks a command for specific roles:
  * If users **have** the specified role, they **cannot** use the command.

You can **only apply one** of these restrictions to a command at a time, not both.

## Restricting commands

With the `restrictcommand` command, you can restrict a command to a specific role.

This means that only users with the specified role will be able to use the command.

<Tip>
  You can use the alias `rc` instead of `restrictcommand`, to make the command easier to type.
</Tip>

### Adding a restriction

To restrict a command, use the `restrictcommand add` command, followed by the command and role you'd like to restrict it to.

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand add <command> <role>
  ```

  ```ruby Example theme={null}
  ,,restrictcommand add purge @Mod
  ```
</CodeGroup>

You should see a message confirming that the command has been restricted.

<Frame caption="Restriction confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/security/cmd_mgmt/rc/add.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=f1168d8c087c8ccc3fb0b20a480d8ba8" width="563" height="256" data-path="images/security/cmd_mgmt/rc/add.png" />
</Frame>

#### Restricting subcommands

If you want to restrict a subcommand, add an underscore (`_`) between the command and subcommand.

For example, to restrict the `purge bots` command to the `Mod` role, you would do the following:

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand add <command> <role>
  ```

  ```ruby Example theme={null}
  ,,restrictcommand add purge_bots @Mod
  ```
</CodeGroup>

Same as before, you should see a message confirming that the command has been restricted.

<Frame caption="Subcommand restriction confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/security/cmd_mgmt/rc/add_subcmd.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=546f5fb64f0290b74af59c19ac08fba1" width="588" height="246" data-path="images/security/cmd_mgmt/rc/add_subcmd.png" />
</Frame>

### Removing a restriction

To remove a restriction, use the `restrictcommand remove` command, followed by the command and role you'd like to remove the restriction from.

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand remove <command> <role>
  ```

  ```ruby Example theme={null}
  ,,restrictcommand remove purge @Mod
  ```
</CodeGroup>

You should see a message confirming that the restriction has been removed.

<Frame caption="Restriction removal confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/security/cmd_mgmt/rc/remove.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=7bbcfb54af0d5c9e05f5abc89711af4d" width="632" height="251" data-path="images/security/cmd_mgmt/rc/remove.png" />
</Frame>

#### Removing a subcommand restriction

To remove a subcommand restriction, add an underscore (`_`) between the command and subcommand.

For example, to remove the restriction from the `purge bots` command, you would do the following:

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand remove <command> <role>
  ```

  ```ruby Example theme={null}
  ,,restrictcommand remove purge_bots @Mod
  ```
</CodeGroup>

You should see a message confirming that the restriction has been removed.

<Frame caption="Subcommand restriction removal confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/security/cmd_mgmt/rc/remove_subcmd.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=cdedf727686c6308b1ef70da14e17632" width="670" height="254" data-path="images/security/cmd_mgmt/rc/remove_subcmd.png" />
</Frame>

### Listing all restrictions

To list all the restrictions on your server, use the `restrictcommand list` command.

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand list
  ```

  ```ruby Example theme={null}
  ,,restrictcommand list
  ```
</CodeGroup>

You should see a list of all the restrictions on your server.

### Removing all restrictions

To remove all restrictions on your server, use the `restrictcommand clear` command.

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand clear
  ```

  ```ruby Example theme={null}
  ,,restrictcommand clear
  ```
</CodeGroup>

You will be asked to confirm that you want to remove all restrictions. If you confirm, you should see a message confirming that all restrictions have been removed.

## Reverse restricting commands

With the `restrictcommand reverse` command, you can block a command from being used by a specific role.

This means that if a user has the specified role, they will not be able to use the command.

<Tip>
  You can use the alias `rc rev` instead of `restrictcommand reverse`, to make the command easier to type.
</Tip>

### Adding a reverse restriction

To reverse restrict a command, use the `restrictcommand reverse add` command, followed by the command and role you'd like to reverse restrict it from.

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand reverse add <command> <role>
  ```

  ```ruby Example theme={null}
  ,,restrictcommand reverse add purge @Mod
  ```
</CodeGroup>

You should see a message confirming that the command has been reverse restricted.

<Frame caption="Reverse restriction confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/security/cmd_mgmt/rc_reverse/add.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=1e8dfc3e1799f8cd78340e94a71f5df4" width="619" height="254" data-path="images/security/cmd_mgmt/rc_reverse/add.png" />
</Frame>

#### Reverse restricting subcommands

If you want to reverse restrict a subcommand, add an underscore (`_`) between the command and subcommand.

For example, to reverse restrict the `purge bots` command from the `Mod` role, you would do the following:

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand reverse add <command> <role>
  ```

  ```ruby Example theme={null}
  ,,restrictcommand reverse add purge_bots @Mod
  ```
</CodeGroup>

Same as before, you should see a message confirming that the command has been reverse restricted.

<Frame caption="Subcommand reverse restriction confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/security/cmd_mgmt/rc_reverse/add_subcmd.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=40c85a4180326e79934a502ca8210956" width="664" height="256" data-path="images/security/cmd_mgmt/rc_reverse/add_subcmd.png" />
</Frame>

### Removing a reverse restriction

To remove a reverse restriction, use the `restrictcommand reverse remove` command, followed by the command and role you'd like to remove the reverse restriction from.

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand reverse remove <command> <role>
  ```

  ```ruby Example theme={null}
  ,,restrictcommand reverse remove purge @Trial Mod
  ```
</CodeGroup>

You should see a message confirming that the reverse restriction has been removed.

<Frame caption="Reverse restriction removal confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/security/cmd_mgmt/rc_reverse/remove.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=13897f4e4aa4b54cb030ef84a925f4c5" width="685" height="244" data-path="images/security/cmd_mgmt/rc_reverse/remove.png" />
</Frame>

#### Removing a subcommand reverse restriction

To remove a subcommand reverse restriction, add an underscore (`_`) between the command and subcommand.

For example, to remove the reverse restriction from the `purge bots` command, you would do the following:

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand reverse remove <command> <role>
  ```

  ```ruby Example theme={null}
  ,,restrictcommand reverse remove purge_bots @Trial Mod
  ```
</CodeGroup>

You should see a message confirming that the reverse restriction has been removed.

<Frame caption="Subcommand reverse restriction removal confirmation">
  <img src="https://mintcdn.com/jarinc/A4GghNGPwdWr9LoP/images/security/cmd_mgmt/rc_reverse/remove_subcmd.png?fit=max&auto=format&n=A4GghNGPwdWr9LoP&q=85&s=ee2c5acd607bf605b14d5433f5a37655" width="735" height="252" data-path="images/security/cmd_mgmt/rc_reverse/remove_subcmd.png" />
</Frame>

### Listing all reverse restrictions

To list all the reverse restrictions on your server, use the `restrictcommand reverse list` command.

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand reverse list
  ```

  ```ruby Example theme={null}
  ,,restrictcommand reverse list
  ```
</CodeGroup>

You should see a list of all the reverse restrictions on your server.

### Removing all reverse restrictions

To remove all reverse restrictions on your server, use the `restrictcommand reverse clear` command.

<CodeGroup>
  ```ruby Syntax theme={null}
  restrictcommand reverse clear
  ```

  ```ruby Example theme={null}
  ,,restrictcommand reverse clear
  ```
</CodeGroup>

You will be asked to confirm that you want to remove all reverse restrictions. If you confirm, you should see a message confirming that all reverse restrictions have been removed.
