> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-telegram/configuration.md).

# Configuration

Configure CAS Telegram for RedM — the VORP currency or RSG money account, language, number prices, the public register, market fee and limits.

Everything is in `config.lua`. Restart the resource after editing it:

```
restart cas-telegram
```

Only the settings below are worth changing. Everything else has a sensible default.

## Currency

If your server charges in gold instead of cash, change this:

```lua
Config.VORPCurrency = 0   -- 0 money, 1 gold, 2 rol
```

On RSG Core, set the account instead:

```lua
Config.RSGMoneyType = 'cash'
```

A stock rsg-core ships with `cash`, `bank`, `valbank`, `rhobank`, `blkbank`, `armbank` and `bloodmoney`. Your own list is read from rsg-core when the resource starts, so if this value is not on it the console says so and names the ones that are, and the resource does not open.

Getting this wrong means every price is taken from the wrong wallet.

If you run standalone there is no wallet to charge:

```lua
Config.StandaloneFreeEconomy = true
```

`true` lets purchases go through for free, which is useful for testing. `false` refuses them.

## Language

```lua
Config.Locale = 'en'   -- 'en' or 'tr'
```

To add your own, copy `locales/en.lua`, rename it, and set the name here without `.lua`. Translate the text on the right of each `=` and leave the names on the left alone.

This one file covers the device and the notifications. You do not need to rebuild the interface after changing it, only restart the resource.

{% hint style="info" %}
Any `%s` in a line is replaced with a name, a number, or an amount while the game runs. Keep them, and keep them in the same order.
{% endhint %}

## Command

```lua
Config.Command = 'telegram'
```

Written without the slash.

## Numbers and lines

```lua
Config.GiveStarterNumber = true
Config.MaxAccounts = 4
```

The first gives every character a free number on first use. Turn it off and a character with no number can only browse the exchange until they buy one.

The second is how many numbers one character may hold at once, counting the free one.

Prices:

```lua
Config.NumberTiers = {
    { id = 'standard',  price = 25,  digits = 4, count = 4 },
    { id = 'premium',   price = 180, digits = 3, count = 3 },
    { id = 'legendary', price = 900, digits = 2, count = 2 },
}

Config.DiscreetLines = {
    { id = 'anon',   kind = 'anonymous', price = 120 },
    { id = 'burner', kind = 'burner',    price = 35, hours = 12 },
    { id = 'org',    kind = 'business',  price = 400 },
}
```

`digits` is how long the number is. Fewer digits means rarer, which is why they cost more. `count` is how many are on offer at once.

`hours` is how long a burner lives before it is struck off, taking its messages with it.

## Prices

```lua
Config.MessagePrice = 0
Config.CircleCreatePrice = 60
Config.MarketFee = 0.05
```

`MessagePrice` is charged for every wire sent, voice included. It is `0` by default, which leaves wires free. Setting it changes how players use the device, so raise it slowly.

`MarketFee` is the cut taken from every marketplace sale. `0.05` is five percent. `0` pays the seller the full price.

## Public register

```lua
Config.Register = {
    Enabled = true,
    MinQuery = 2,
    MaxResults = 12,
}
```

Lets players find a number by searching the name on the line.

Anonymous and burner lines never appear, and any player can take their own line off the register in their settings. `MinQuery` is the fewest letters before a search runs, which stops the register being listed out in full.

Set `Enabled` to `false` to make players exchange numbers themselves.

## Notifications

```lua
Config.NotifyWhenClosed = true
Config.NotifyDuration = 8
```

Shows an incoming wire on screen even when the device is closed. The notice never takes the mouse and never interrupts what the player is doing. `NotifyDuration` is in seconds.

## Limits

```lua
Config.MaxMessageLength = 400
Config.MessageHistory = 60
Config.MaxContacts = 60
Config.MaxListings = 8
Config.MaxCircleMembers = 20
```

In order: how long one wire may be, how many messages load when a conversation is opened, how many names one line may keep, how many listings one line may have on the board, and how many members one circle may hold.

## Flood protection

```lua
Config.RateLimits = {
    message   = { count = 18, seconds = 10 },
    voice     = { count = 3,  seconds = 30 },
    react     = { count = 30, seconds = 10 },
    wire      = { count = 6,  seconds = 30 },
    contact   = { count = 10, seconds = 60 },
    listing   = { count = 5,  seconds = 60 },
    broadcast = { count = 1,  seconds = 600 },
}
```

Each line says how many times a player may do something inside that many seconds. The defaults stop a held key or a macro without getting in the way of normal play.

Set a `count` to `0` to remove that limit.

## Photographs

```lua
Config.Plates = {
    { id = 'town',   file = 'img/plate-town.jpg' },
    { id = 'office', file = 'img/panel.jpg' },
}
```

The pictures a player may attach to a wire. This resource does not capture the screen, so these are pictures that ship inside it.

To add one, put the file in `web/public/img/`, add a line here, and [rebuild the interface](/script-documentation/cas-telegram/interface.md).

## Marketplace pictures

```lua
Config.ListingArt = {
    'tex/items/generic_note.png',
    'tex/items/weapon_revolver_schofield.png',
    ...
}
```

The pictures a seller may put on a listing. The server refuses anything not on this list, so adding one means adding it here as well as putting the file in `web/public/`.

## Debug mode

```lua
Config.Debug = false
```

Turning this on adds console detail on start and while the address book loads. Leave it off on a live server.
