> For the complete documentation index, see [llms.txt](https://docs.xandtech.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xandtech.fr/home/xtimerewards/features/discord.md).

# Discord Integration

Posts webhook embeds for a handful of notable events. Off by default — needs your own webhook URL (Discord: channel **Settings → Integrations → Webhooks → New Webhook → Copy URL**). No external HTTP/JSON library dependency; built entirely on the JDK's own `HttpClient`.

```yaml
discord:
  enabled: false
  webhook-url: ""
  username: "XTimeRewards"
  avatar-url: ""
  embed-color: 0x2F8A55
```

`username`/`avatar-url` override the webhook's own defaults in Discord — leave blank to use whatever the webhook itself is configured with. `embed-color` is the embed's sidebar color as a decimal RGB integer (hex literals like `0x2F8A55` parse fine in YAML).

{% hint style="info" %}
Every title/description below is a plain template with `{placeholder}` substitution — write whatever wording you want. MiniMessage color tags are accepted but stripped to plain text before sending, since Discord doesn't render them. Nothing here is auto-generated from reward values.
{% endhint %}

## Leaderboard results

```yaml
discord:
  events:
    leaderboard:
      enabled: true
      top-count: 3
      title: "🏆 {category} Leaderboard — {period} Results"
      line: "#{rank} {player} — {value}"
```

Posted once per [`leaderboard-rewards.yml`](/home/xtimerewards/features/leaderboards.md) distribution, independent of the in-game broadcast — turn either off separately if you only want one. `title` gets `{category}`/`{period}`; `line` gets `{rank}`/`{player}`/`{value}` and is repeated once per `top-count` rank, joined with newlines into the embed description.

## Lifetime milestones

```yaml
discord:
  events:
    milestone:
      enabled: false
      title: "⭐ Milestone Reached!"
      description: "{player} just reached the milestone \"{milestone}\"!"
```

Only fires for a **`total`** (lifetime) milestone in [`milestones.yml`](/home/xtimerewards/features/playtime-and-milestones.md) — the one-time "big" achievements, as opposed to the daily/weekly/monthly/yearly ones that repeat every period and would spam the channel. Off by default. Placeholders: `{player}`, `{milestone}`.

## New streak records

```yaml
discord:
  events:
    streak-record:
      enabled: false
      minimum-days: 7
      title: "🔥 New Streak Record!"
      description: "{player} just reached a new personal best: {streak} day(s) in a row!"
```

Fires when a player's current [streak](/home/xtimerewards/features/streaks.md) beats their own previous best (not just matches it), and only once it's at least `minimum-days` long — skips the trivial "new record of 1/2/3 days" every fresh player passes through. Off by default. Placeholders: `{player}`, `{streak}`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xandtech.fr/home/xtimerewards/features/discord.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
