> ## Documentation Index
> Fetch the complete documentation index at: https://pumpkings.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# LiricCasino Discord Webhook Integration Setup Guide

> Configure Discord webhooks to broadcast LiricCasino jackpot hits, big wins above a custom threshold, and lottery draw winners to any Discord channel.

LiricCasino can send rich Discord embeds automatically whenever a notable event occurs in-game — a jackpot on the Slots 777, an unusually large win on any game, or a Lottery draw with a winner. All webhook behaviour is configured in `webhooks.yml`, and every webhook type is **disabled by default** so you opt in only to the notifications you want.

## Webhook types

<CardGroup cols={3}>
  <Card title="Jackpot" icon="slot-machine">
    Fires when a player lands the 777 jackpot on the Slot Machine (100× multiplier). Ideal for hyping big moments on your Discord server.
  </Card>

  <Card title="Big Win" icon="money-bill-wave">
    Fires when any player wins an amount that exceeds the configurable `min-amount` threshold (default: \$50,000) on **any** game.
  </Card>

  <Card title="Lottery Winner" icon="ticket">
    Fires when a scheduled or force-started lottery draw produces a winner, showing the winning number and prize amount.
  </Card>
</CardGroup>

## webhooks.yml structure

```yaml theme={null}
webhooks:
  enabled: false   # Master switch — set to true to enable all webhooks

  # ── Jackpot (Slots 777 x100) ─────────────────────────────
  jackpot:
    url: "https://discord.com/api/webhooks/YOUR_ID/YOUR_TOKEN"
    color: 16711935          # Embed colour in decimal (0xFF00FF = magenta)
    title: "🎰 !!JACKPOT 777!!"
    description: "**{player}** hit the **777** on Slots and won **{amount}**! 🤑"
    footer: "Liric Casino • Slots"
    mention-role: ""         # Leave empty, or use "@everyone" / "<@&ROLE_ID>"

  # ── Big Win (any game, exceeds min-amount) ────────────────
  big-win:
    url: "https://discord.com/api/webhooks/YOUR_ID/YOUR_TOKEN"
    color: 16766720          # 0xFFD700 = gold
    title: "💰 Big Win!"
    description: "**{player}** won **{amount}** playing **{game}**! 🎉"
    footer: "Liric Casino"
    mention-role: ""
    min-amount: 50000.0      # Only fires when winnings exceed this value

  # ── Lottery Winner ────────────────────────────────────────
  lottery:
    url: "https://discord.com/api/webhooks/YOUR_ID/YOUR_TOKEN"
    color: 16766720
    title: "🎟 Lottery Winner!"
    description: "**{player}** guessed the number **{number}** and won **{amount}**! 🎟✨"
    footer: "Liric Casino • Lottery"
    mention-role: ""
```

### Embed placeholders

| Placeholder | Available in              | Description                                 |
| ----------- | ------------------------- | ------------------------------------------- |
| `{player}`  | jackpot, big-win, lottery | The player's Minecraft username             |
| `{amount}`  | jackpot, big-win, lottery | The formatted winning amount                |
| `{game}`    | jackpot, big-win          | The name of the game where the win occurred |
| `{number}`  | lottery                   | The winning lottery number drawn            |

## Setting up a Discord webhook

<Steps>
  <Step title="Open your Discord server settings">
    In Discord, right-click your server name and choose **Server Settings**, then navigate to **Integrations → Webhooks**.
  </Step>

  <Step title="Create a new webhook">
    Click **New Webhook**. Give it a recognisable name (e.g. `LiricCasino`) and select the channel where notifications should appear. You can also upload a custom avatar.
  </Step>

  <Step title="Copy the webhook URL">
    Click **Copy Webhook URL**. The URL will look like:

    ```
    https://discord.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz
    ```
  </Step>

  <Step title="Paste the URL into webhooks.yml">
    Open `plugins/CasinoLiric/webhooks.yml` and replace the placeholder URL for each webhook type you want to enable:

    ```yaml theme={null}
    jackpot:
      url: "https://discord.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz"
    ```
  </Step>

  <Step title="Enable the master switch and individual webhooks">
    Set the top-level `enabled` flag to `true`, and confirm that you have set a valid URL for each webhook type you intend to use. Webhook types with a placeholder URL (`YOUR_ID/YOUR_TOKEN`) will not fire.

    ```yaml theme={null}
    webhooks:
      enabled: true
    ```
  </Step>

  <Step title="Reload the plugin">
    Apply your changes without restarting the server:

    ```bash theme={null}
    /casino reload
    ```

    You should see a confirmation message in chat. Test by triggering the relevant in-game event or using `/casino loteria forcestart` to verify the Lottery webhook.
  </Step>
</Steps>

## Additional configuration tips

<Note>
  You can point multiple webhook types at the **same** Discord channel (or different channels) simply by using the same or different URLs. There is no limit to how many channels you notify.
</Note>

<Warning>
  Webhook URLs contain a secret token. Do not share `webhooks.yml` publicly or commit it to a public repository. Anyone with the URL can post messages to your channel.
</Warning>

### Role mentions

Set `mention-role` to notify a role when a webhook fires:

```yaml theme={null}
jackpot:
  mention-role: "<@&1234567890>"   # Replace with your actual role ID
```

To ping everyone in the channel instead, use `"@everyone"`. Leave the value empty (`""`) for no mention.

### Adjusting the big-win threshold

If you find the big-win webhook fires too often or too rarely, raise or lower `min-amount` to match your server's economy scale:

```yaml theme={null}
big-win:
  min-amount: 100000.0   # Only fires for wins over $100,000
```

Run `/casino reload` after every change to `webhooks.yml` to apply it immediately.
