> For the complete documentation index, see [llms.txt](https://darkstarworks.gitbook.io/plugins/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://darkstarworks.gitbook.io/plugins/mc/antidupepro/notifications-and-translation.md).

# Notifications & Translation

## AntiDupePro — Notifications & Translation

This short guide covers the two "make it yours" features: getting dupe alerts **outside the game** (Discord, Telegram, Slack, custom webhooks — since 3.3.4) and **translating or restyling** every in-game message (since 3.3.3). For installation, detection and admin commands, see the main user guide.

***

### Table of Contents

1. Alerts outside the game (webhooks)
2. Discord setup
3. Telegram setup
4. Slack setup
5. Custom webhook (everything else)
6. Good to know
7. Translating the plugin (messages.yml)

***

### 1. Alerts outside the game (webhooks) <a href="#notifications" id="notifications"></a>

AntiDupePro can ping you when a dupe is detected, even when no admin is online. Everything lives in the `notifications` section of `config.yml`, and everything is **off by default**:

```
notifications:
  # Only send alerts at or above this severity: LOW, MEDIUM, HIGH, CRITICAL.
  min_severity: HIGH

  # Don't re-send the same kind of alert more often than this (seconds).
  rate_limit_seconds: 30

  discord:
    enabled: false
    webhook_url: ""

  telegram:
    enabled: false
    bot_token: ""
    chat_id: ""

  slack:
    enabled: false
    webhook_url: ""

  generic:
    enabled: false
    url: ""
```

**Upgrading from an older version?** Your existing `config.yml` is kept as-is, so this section won't appear by itself — copy the block above into your file, enable what you use, and restart.

### 2. Discord setup <a href="#discord" id="discord"></a>

1. In Discord, open the channel where alerts should appear.
2. Channel settings (gear icon) → **Integrations** → **Webhooks** → **New Webhook**.
3. Click **Copy Webhook URL**.
4. In `config.yml`: set `discord.enabled: true` and paste the URL into `webhook_url`.
5. Restart the server. Alerts now arrive as colored Discord embeds (red = critical).

### 3. Telegram setup <a href="#telegram" id="telegram"></a>

1. In Telegram, message **@BotFather**, send `/newbot`, and follow the steps. You get a **bot token** (looks like `123456:ABC-DEF...`).
2. Add your new bot to the group or channel where alerts should appear.
3. Find the chat id: add **@getidsbot** (or @userinfobot) to the same group — it tells you the id (group ids usually start with `-100`).
4. In `config.yml`: set `telegram.enabled: true`, paste the token into `bot_token` and the id into `chat_id`.
5. Restart the server.

### 4. Slack setup <a href="#slack" id="slack"></a>

1. Create an **Incoming Webhook** for your workspace: [api.slack.com/messaging/webhooks](https://api.slack.com/messaging/webhooks).
2. Pick the channel, copy the webhook URL.
3. In `config.yml`: set `slack.enabled: true` and paste the URL into `webhook_url`.
4. Restart the server.

### 5. Custom webhook (everything else) <a href="#generic" id="generic"></a>

For anything not listed above — n8n, Zapier, Make, a home-grown bot — enable `generic` and set `url`. AntiDupePro sends an HTTP POST with this JSON body for every alert:

```
{
  "plugin": "AntiDupePro",
  "type": "BALANCE_DISCREPANCY",
  "severity": "CRITICAL",
  "player": "Steve",
  "playerUuid": "069a79f4-44e9-4726-a5be-fca90e38aaf5",
  "material": "ENCHANTED_BOOK",
  "details": "Has 12 but ledger shows 4 (excess: 8)",
  "timestamp": 1781234567890
}
```

### 6. Good to know <a href="#notify-tips" id="notify-tips"></a>

* **min\_severity** — `HIGH` (the default) keeps small wobbles out of your channel. Use `CRITICAL` if you only want the highest-confidence detections, or `LOW` to see everything.
* **Burst protection** — the same kind of alert (same player + same item) is sent at most once per `rate_limit_seconds`. A detection burst becomes one message, not a hundred.
* **It can't hurt the server** — sending happens in the background. If a webhook is broken or unreachable, the game is unaffected; the console gets one warning per minute until it works again.
* **Language** — notification text follows your `messages.yml`, with color codes removed.
* **Keep webhook URLs secret** — anyone who has the URL can post to your channel. Don't commit your `config.yml` to a public repo.

***

### 7. Translating the plugin (messages.yml) <a href="#translation" id="translation"></a>

#### Built-in translations (3.3.5+)

Five translations ship with the plugin. Pick one with a single line in `config.yml`:

```
language: pt_BR   # or: en, es, de, ru, pl
```

| Code    | Language            |
| ------- | ------------------- |
| `en`    | English (default)   |
| `pt_BR` | Português do Brasil |
| `es`    | Español             |
| `de`    | Deutsch             |
| `ru`    | Русский             |
| `pl`    | Polski              |

Your own edits in `messages.yml` always win over the chosen translation, and anything a translation is missing falls back to English — so switching languages never breaks anything. Spotted an awkward phrase? Corrections are very welcome as GitHub issues or pull requests.

#### Custom translation / restyling

Everything the plugin shows in-game — dupe alerts and all `/adp` command output — comes from `plugins/AntiDupePro/messages.yml`. The file is created on first start with the English defaults.

* **Edit any line.** Colors use `&` codes (`&c` = red, `&l` = bold, `&r` = reset).
* **Keep the `{placeholders}`** (like `{player}` or `{material}`) — the plugin fills them in. You can move them anywhere in the sentence, which matters for languages with different word order.
* **Delete what you don't customise.** Any missing line falls back to the built-in English text. This also means plugin updates can add new messages without ever breaking your translation.
* **Console logs stay English on purpose** — that keeps error messages searchable and makes it easier to get support.

Example — turning the alert German:

```
alerts:
  broadcast: "&c&l[DUPE] &e{player} &7({type}) &f{material}: &c{details}"
  balance-discrepancy: "Hat {actual}, aber das Kassenbuch zeigt {expected} (Überschuss: {excess})"
```

Changes take effect on the next server restart.

***

*Last updated for AntiDupePro 3.3.5 — see the main user guide for everything else.*


---

# 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:

```
GET https://darkstarworks.gitbook.io/plugins/mc/antidupepro/notifications-and-translation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
