> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_casino/integrations/discord-hook.md).

# Discord Hook

Sending casino events to a Discord channel

<figure><img src="https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-68bb2252c6e9bcba780e47d857d2784361702d38%2Fdiscord_hook.png?alt=media" alt=""><figcaption></figcaption></figure>

The casino can post its money and chip movements to a Discord channel as embeds, giving you a live audit trail without opening the admin console.

## Setup

1. In Discord, open Server Settings → Integrations → Webhooks and create a webhook pointed at the channel you want.
2. Copy its URL.
3. Put it in `configs/config_server.lua`:

```lua
ServerConfig = {
    Discord = true,
    HookUrl = "https://discord.com/api/webhooks/123456789/abcdef...",
}
```

4. Restart the resource.

Set `Discord = false` to turn logging off without deleting the URL.

## What gets logged

<table data-full-width="false"><thead><tr><th width="230">Event</th><th>Sent when</th></tr></thead><tbody><tr><td>Cashier Purchase</td><td>A player buys chips</td></tr><tr><td>Cashier Trade-In</td><td>A player cashes chips out</td></tr><tr><td>Cashier Bonus</td><td>A player claims the daily visitor bonus</td></tr><tr><td>Casino Money</td><td>A player's money is changed by the casino</td></tr><tr><td>Casino Chips</td><td>A player's chip balance changes</td></tr><tr><td>Casino Credit / Debit</td><td>Winnings paid out, or a bet taken</td></tr><tr><td>Casino Inventory</td><td>A casino item is given or removed</td></tr><tr><td>Bonus changes</td><td>A bonus is granted or revoked</td></tr><tr><td>Admin actions</td><td>Changes made from the admin console</td></tr></tbody></table>

## Betting behaviour events

Beyond money movements, the three table games detect and report betting patterns (Martingale, reverse Martingale and aggressive bet spikes) as players exhibit them. These arrive through the same webhook and are a useful early warning that someone is working a system.

The same information is available in the admin console's [traced players](https://documentation.rcore.cz/paid-resources/rcore_casino/features/admin-console.md#traced-players) view.
