# Discord whitelist, from the questions to the city

A Discord whitelist with questions, team approval and the player's ID unlocked inside the city right away.

Source: https://fivedash.fivex.gg/docs/en/tutorials/discord-whitelist

In this tutorial you set up a whitelist in **Manual review** mode: the person answers the questions on Discord, the team approves in the dashboard and the person sends their ID through an unlock panel. The bot gives the role, changes the nickname and, with the `fivedash` resource connected, unlocks the ID inside the city. It's for whoever sets up the city's way in.

## What you need

* The **Discord** module in the organization's plan. The whitelist is on every tier (Plus, Pro and Ultra).
* The city's bot connected to the Discord server. See [Bot](https://fivedash.fivex.gg/docs/en/discord/bot).
* The `fivedash` resource installed and the server connected, so the unlock applies in the game. See [Connect your city to FiveDash](https://fivedash.fivex.gg/docs/en/tutorials/connect-your-city).
* On Discord, a role for approved members and one for unlocked members. The bot's role must sit **above** them, in **Server Settings → Roles**.
* In the dashboard, the **Configure** level on the **Whitelist** area to set it up, and **Manage** to approve.

## 1. Get the framework's whitelist ready

The in-game unlock uses the framework's own whitelist. Get it ready first:

> **FiveM**
>
> | Framework                  | What to get ready                                                                                                           | What the player enters                                 |
> | -------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
> | QBCore                     | The whitelist on in `qb-core/config.lua`, with `WhitelistPermission = 'whitelisted'` instead of the default `'admin'`       | Only the character's name                              |
> | Qbox                       | `whitelist` on in `qbx_core/config/server.lua`, with `whitelistPermission = 'whitelisted'` instead of the default `'admin'` | Only the character's name                              |
> | ESX                        | `esx_whitelist` started, in `"identifier"` or `"both"` mode                                                                 | Only the character's name                              |
> | vRP / vRPex                | The `whitelisted` column in the `vrp_users` table                                                                           | The account number                                     |
> | Creative Network Enchanted | The base's whitelist on in `vrp/config/Global.lua` (not `Whitelisted = false`)                                              | The token shown when connecting, or the account number |
>
> With a staff permission, like `admin`, the whitelist via FiveDash is turned off: every unlocked player would become staff. After switching to `whitelisted`, give the permission to staff in `server.cfg`:
>
> ```bash
> add_ace group.admin whitelisted allow
> ```
>
> ox_core has no whitelist of its own: unlocking only gives the role on Discord.

> **RedM**
>
> * **VORP:** keep `Whitelist = true` in `vorp_core/config/config.lua`. The unlock applies to the `whitelist` table, by the Steam seen with the Discord.
> * **RSG:** in `rsg-core/shared/config.lua`, turn on `RSGConfig.Server.Whitelist` and change the default `admin` `WhitelistPermission` to `whitelisted`. With `admin` every unlocked player would become staff, so FiveDash doesn't unlock.
>
> On both, the player only enters the character's name: the city finds them by their Discord. **RedEM:RP** has no whitelist through FiveDash yet.

In **Server → Overview**, the **Game connection** card should show **Whitelist via FiveDash** as **Active**. Details in [Frameworks](https://fivedash.fivex.gg/docs/en/developers/frameworks).

## 2. Pick the mode and the questions

Open **Discord → Whitelist → Settings**.

1. In the **Mode** group, click **Manual review**: the team reads the answers and approves or refuses. If you haven't touched the sample questions yet, they become 6 written questions.
2. In **Steps**, open **Start** and pick the **Panel channel**: that's where the bot posts the message with the **Start whitelist** button.
3. In **Questions**, adjust the samples or click **Add question** (up to 25). For each one, fill in **Question** and pick the **Type**: **Multiple choice**, **Short answer** or **Long answer**.
4. In the **Rules** group, check **Time to answer** (default 15 minutes) and **Try again** (default 30 min), and pick the **Team channel**: the bot posts there when a whitelist arrives for review.

The other modes (**Automatic questions**, **Interview only** and **Unlock only**) and the interview are in [Whitelist](https://fivedash.fivex.gg/docs/en/discord/whitelist).

## 3. Set up the unlock

Go to the **Unlock** tab and fill in:

| Field                            | What to pick                                                                                                                  |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **Channel**                      | Where the panel with the unlock button sits                                                                                   |
| **Approved members' role**       | Only members with this role can use the panel. The bot gives it to whoever is approved and removes it once the ID is unlocked |
| **Unlocked members' role**       | Access to the city                                                                                                            |
| **Ask for the character's name** | Keep it on (default) so the bot changes the nickname                                                                          |

The default **Nickname format** is `{personagem} | {id}`: the character "Carlos Andrade" with the ID `1234` becomes `Carlos Andrade | 1234`.

On the **In the city** card, check that **Server connected** shows. It also holds **Remove the whitelist from whoever is kicked or banned** and **Remove the whitelist from whoever leaves the Discord**, both on by default.

## 4. Turn it on and publish the panels

At the top of the page, flip the switch to **On**, click **Save** and then **Publish panels**. It worked when **Panels published** shows, with the channels where they are.

If something is missing, the dashboard points out the first problem and takes you to the field (for example, "Pick the role for members already unlocked."). **Publish panels** stays blocked while there are unsaved changes.

## 5. The player answers

On Discord, the person:

1. Clicks **Start whitelist** in the panel's channel.
2. Answers one question at a time ("Question 1 of 6"), with the time left. Written answers open a form through the **Answer** button.
3. At the end, their answers are sent. The result arrives by DM, so they must keep direct messages open.

On QBCore, Qbox, ESX, VORP and RSG, the person must also try to join the city once, with Discord open on their PC, before the unlock. That's how FiveDash links their Discord to the license (on VORP, to the Steam).

## 6. The team approves

In **Discord → Whitelist → Overview**, the whitelist shows in the **In review** column of the **Board**. Click the card to open the sheet with the answers and click **Approve** (or **Refuse**). You can also drag the card to the **Approved** column.

The person gets the **Approved members' role** and an approval DM with the unlock link. On a refusal, the reason goes in the DM, and they can try again after the **Try again** time.

## 7. The player unlocks their ID in the city

In the unlock channel, the person clicks **Unlock my ID** and fills in the form: the character's name and, on the frameworks that ask for it, the game ID (up to 12 digits).

Right away, the bot gives the **Unlocked members' role**, removes the approved one, changes the nickname and, with the server connected, unlocks the ID in the game. Check the **Unlocked** list on the **Overview** tab:

| In-game status  | What it means                                            |
| --------------- | -------------------------------------------------------- |
| **Queued**      | The server is offline: the unlock waits until it's back  |
| **In the city** | Unlocked in the game. Done                               |
| **Failed**      | The server couldn't unlock the ID. Unlock it in the game |

> To let someone in without the whitelist, the team uses `/liberar` on Discord, with the `id` and, for the bot to give the unlocked role, the `membro`. Who can use it is set in **Roles that can use it**, in the **/liberar command** block of the **Unlock** tab.

If the bot says the ID doesn't exist in the city, the person must join the server once, check the ID shown and try again.

## Next steps

[Whitelist](https://fivedash.fivex.gg/docs/en/discord/whitelist)

Every mode, the interview and codes.

[Bot](https://fivedash.fivex.gg/docs/en/discord/bot)

Connect the bot and sort out roles and permissions.

[Frameworks](https://fivedash.fivex.gg/docs/en/developers/frameworks)

Each framework's whitelist in detail.

[Commands](https://fivedash.fivex.gg/docs/en/discord/commands)

/liberar, /remover and the bot's other commands.
