> For the complete documentation index, see [llms.txt](https://crimvex-studio.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://crimvex-studio.gitbook.io/docs/scripts/crimvex-rental/secrets-configuration.md).

# Secrets Configuration

## 🔐 Secrets Configuration

The `server/secrets.lua` file contains all Discord-related settings used by Crimvex Rental.

This includes:

* Discord Log Webhooks
* Discord Bot Token
* Discord Server (Guild) ID
* VIP Role Configuration

> **Important:** Never share this file publicly. It contains sensitive information such as your Discord Bot Token and Webhook URLs.

***

## File Location

```
server/secrets.lua
```

***

## Discord Webhooks

Configure your Discord log webhooks.

```lua
DiscordSecrets.Webhooks = {
    username = "Crimvex Rental Logs",
    avatar_url = "YOUR_AVATAR_URL",
    thumbnail = "YOUR_AVATAR_URL",
    icon_url = "YOUR_AVATAR_URL",
    rental = "RENTAL_LOG_WEBHOOK",
    returns = "RENTAL_RETURN_LOG_WEBHOOK"
}
```

***

### Username

```lua
username = "Crimvex Rental Logs"
```

The username displayed when sending Discord logs.

***

### Avatar URL

```lua
avatar_url = "YOUR_AVATAR_URL"
```

The profile picture used by the webhook.

Example:

```
https://yourdomain.com/logo.png
```

***

### Thumbnail

```lua
thumbnail = "YOUR_AVATAR_URL"
```

Image displayed inside the Discord embed.

***

### Icon URL

```lua
icon_url = "YOUR_AVATAR_URL"
```

Small icon displayed in Discord embeds.

***

### Rental Log Webhook

```lua
rental = "RENTAL_LOG_WEBHOOK"
```

Receives logs whenever a player rents a vehicle.

Typical information includes:

* Player Name
* Citizen ID
* Vehicle
* Rental Price
* Rental Duration
* Payment Method
* Date & Time

***

### Return Log Webhook

```lua
returns = "RENTAL_RETURN_LOG_WEBHOOK"
```

Receives logs whenever a rental vehicle is returned.

Typical information includes:

* Player Name
* Vehicle
* Refund Amount
* Return Time
* Rental Status

***

## Enable Discord Logs

To use Discord logging, make sure it is enabled in:

```
shared/config.lua
```

```lua
Config.enableLogs = true
```

If disabled, no webhook requests will be sent.

***

## Discord VIP System

Crimvex Rental supports Discord Role verification for VIP vehicles.

Configuration:

```lua
DiscordSecrets.EnableDiscordVIP = {
    enable = false,
    BOT_TOKEN = "YOUR_BOT_TOKEN",
    GUILD_ID = "YOUR_SERVER_ID",
    VIP_ROLE_ID = "ROLE_ID"
}
```

***

### Enable VIP System

```lua
enable = true
```

| Value   | Description                        |
| ------- | ---------------------------------- |
| `true`  | Enables Discord role verification. |
| `false` | Disables VIP role checking.        |

***

### Bot Token

```lua
BOT_TOKEN = "YOUR_BOT_TOKEN"
```

Your Discord Bot Token.

You can obtain this from the Discord Developer Portal.

> **Never share your Bot Token with anyone.**

***

### Guild ID

```lua
GUILD_ID = "YOUR_SERVER_ID"
```

Your Discord Server ID.

To copy it:

1. Enable **Developer Mode** in Discord.
2. Right-click your server.
3. Click **Copy Server ID**.

***

### VIP Role ID

```lua
VIP_ROLE_ID = "ROLE_ID"
```

The Discord Role ID required to access VIP rental vehicles.

To copy it:

1. Enable **Developer Mode**.
2. Right-click the VIP role.
3. Click **Copy Role ID**.

***

## Example Configuration

```lua
DiscordSecrets.EnableDiscordVIP = {
    enable = true,
    BOT_TOKEN = "YOUR_BOT_TOKEN",
    GUILD_ID = "123456789012345678",
    VIP_ROLE_ID = "987654321098765432"
}
```

***

## Security Recommendations

✅ Keep `server/secrets.lua` private.

✅ Never upload your Bot Token to GitHub.

✅ Never share Webhook URLs publicly.

✅ Regenerate your Bot Token immediately if it is ever exposed.

***

## Common Issues

### VIP vehicles are locked for everyone

Check the following:

* Discord VIP is enabled.
* Bot Token is valid.
* Guild ID is correct.
* VIP Role ID is correct.
* The bot has permission to view server members.
* The player has the required Discord role.

***

### Discord logs are not sent

Verify:

* `Config.enableLogs = true`
* Webhook URLs are valid.
* The webhook has not been deleted.
* Your server has internet access.

***

## Next Step

You're now ready to use all Discord features available in Crimvex Rental.

If you experience any issues, please visit our Discord server for support.
