> For the complete documentation index, see [llms.txt](https://tyrix.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://tyrix.gitbook.io/docs/script-resources/tyrix-droply/discord-logging.md).

# Discord Logging

All logging is configured in `config_sv.lua` — a server-only script, so webhook URLs never reach a client.

## Enabling

```lua
Config_SV.DiscordLogs = {
    enabled   = true,
    botName   = 'Droply',
    botAvatar = '',                 -- optional avatar URL for the webhook bot

    -- Single shared webhook (simplest) …
    webhook = 'https://discord.com/api/webhooks/…',

    -- … or per-type webhooks, which take precedence where set.
    webhooks = {
        order = 'https://discord.com/api/webhooks/…',
        exploit = 'https://discord.com/api/webhooks/…',
        -- leave '' to fall back to the shared webhook
    },
}
```

Resolution is simple: a non-empty per-type URL wins; otherwise the shared `webhook` is used; if both are empty, nothing is sent.

## Event types

| Type             | Fires on                                                                                                                        |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `order`          | A new order is placed. Includes subtotal, delivery fee, tip, and item count.                                                    |
| `accept`         | An employee accepts an order.                                                                                                   |
| `delivered`      | A delivery completes. Includes the full money split — subtotal, fee, tip, total, society cut, driver cut, and both party names. |
| `cancel`         | An order is cancelled or expires. Also covers cancellation fees charged, fees waived, and the post-restart orphan sweep.        |
| `storefront`     | A storefront is saved, or a blocklist is updated.                                                                               |
| `toggle`         | A store is opened or closed.                                                                                                    |
| `manager`        | The manager list changes.                                                                                                       |
| `admin_stations` | An admin assigns crafting stations, or a stub storefront is auto-created.                                                       |
| `signup`         | A customer creates a Droply account.                                                                                            |
| `review`         | A customer posts a review.                                                                                                      |
| `promo`          | A promo code is created, updated, or deleted.                                                                                   |
| `exploit`        | A rejected or unauthorised action. See [Anti Abuse](/docs/script-resources/tyrix-droply/anti-abuse.md#exploit-logging).         |

## Toggling individual types

```lua
logTypes = {
    order          = true,
    accept         = true,
    delivered      = true,
    cancel         = true,
    storefront     = true,
    toggle         = true,
    manager        = true,
    admin_stations = true,
    signup         = true,
    review         = true,
    promo          = true,
    exploit        = true,
}
```

Set any entry to `false` to suppress that family entirely. On a busy server, `order` and `accept` are the noisiest — many operators keep `delivered`, `cancel`, and `exploit` on, and turn the rest off.

## Colours

Embed colours are decimal integers.

```lua
colors = {
    order          = 3447003,   -- blue
    accept         = 3447003,   -- blue
    delivered      = 5763719,   -- green
    cancel         = 15105570,  -- orange
    storefront     = 3447003,   -- blue
    toggle         = 3447003,   -- blue
    manager        = 3447003,   -- blue
    admin_stations = 10181046,  -- purple
    signup         = 5763719,   -- green
    review         = 16776960,  -- yellow
    promo          = 15844367,  -- gold
    exploit        = 15158332,  -- red
}
```

## Thumbnails

Optional per-type image URLs, rendered in the top-right of the embed.

```lua
thumbnails = {
    default        = 'https://…/droply.png',   -- fallback for any empty entry
    delivered      = 'https://…/delivered.png',
    exploit        = 'https://…/warning.png',
    -- …
}
```

Leave an entry as `''` to fall back to `default`. Leave `default` as `''` to skip thumbnails entirely.

## Player identification

Player-attributed logs include the actor's character name and their FiveM identifiers, so a staff member can trace an entry back to an account without a database lookup.

System-generated events — accept timeouts, offline cancellations, and the restart orphan sweep — carry no player block, since no player triggered them.

## Recommended setup

Split at minimum into three channels:

| Channel              | Types                                                        |
| -------------------- | ------------------------------------------------------------ |
| **#droply-orders**   | `order`, `accept`, `delivered`                               |
| **#droply-admin**    | `storefront`, `toggle`, `manager`, `admin_stations`, `promo` |
| **#droply-security** | `exploit`, `cancel`                                          |

This keeps exploit attempts visible instead of buried under routine order traffic.
