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

# Restrict Commands

> Limit specific commands to certain roles.

## Overview

`,restrictcommand` lets you gate individual commands behind roles. Only members with an allowed role can run the command - useful alongside [fake permissions](https://wiki.adore.rest/docs/security/fake-permissions.md) when you want fine-grained access control.

> [!NOTE]
>
> Server owner and [fake owner](https://wiki.adore.rest/docs/security/fake-owner.md) bypass all restrictions.

## Commands

```javascript Syntax theme={null}
,restrictcommand add (command) (role)
,restrictcommand remove (command) (role)
,restrictcommand list
,restrictcommand reset
```

```javascript Example theme={null}
,restrictcommand add ban @Admin
,restrictcommand add kick @Moderator
,restrictcommand remove ban @Admin
```

| Subcommand | Description |
| - | - |
| `add` | Restrict a command to a role |
| `remove` | Remove a role restriction from a command |
| `list` | View all restricted commands and their roles |
| `reset` | Remove all command restrictions |

> [!WARNING]
>
> You cannot restrict the `restrictcommand` command itself.

## How it works

When a command is restricted, adore checks if the user has **any** of the roles assigned to that command. If not, the command is blocked.

Restrictions work with command aliases - if you alias `b` to `ban`, restricting `ban` also applies to the alias.

## Example setup

```javascript theme={null}
,fakepermissions add @Moderator kick_members, moderate_members
```

```javascript theme={null}
,restrictcommand add kick @Moderator
,restrictcommand add mute @Moderator
,restrictcommand add ban @Admin
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.