# Commands

## Console Commands

This section explains how to use the built-in console commands for interacting with the `cad-queue` system. These commands allow server administrators to check queue positions, modify them, and view priority or queue count.

### How it works ?

All commands are executed via **RCON** using the prefix:

queue &#x3C;subcommand> &#x3C;arguments>

Below is the list of supported operations.

---

### &#x20;`getpos`

**Usage:**

```
queue getpos <identifier>
```

Returns the player’s current queue position.

---

### `shiftpos`

**Usage:**

```
queue shiftpos <identifier> <new_position>
```

Moves a player to a new queue position.

**Example Output:**

```
steam:11000014ABCD123 was shifted to 2
```

---

### `getprio`

**Usage:**

```
queue getprio <identifier>
```

Returns priority information as JSON.

---

### `getqcount`

**Usage:**

```
queue getqcount
```

Shows how many players are currently in the queue.

## Discord Commands

The same commands also work from a Discord channel:

1. Give your bot the `Read Messages`, `Send Messages` and `Message Content` permissions.
2. In `config/discord.lua`, fill in `bot_token`, then set up `Config.Bot` (`enabled = true`, the channel id, and who is allowed to use it).
3. Type the commands in that channel with the prefix, e.g. `!queue getqcount`.

Anyone not listed in `allowed_roles` or `allowed_users` gets a "not allowed" reply. Messages sent before the resource started are ignored.
