> For the complete documentation index, see [llms.txt](https://zoomiescore.gitbook.io/zoomiescore-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zoomiescore.gitbook.io/zoomiescore-docs/community/invites.md).

# invites

See who's bringing new members to your server — invite-tracker.com style, built in. No setup, no signup, automatic once the bot has **Manage Server** permission (to fetch the invite list).

## How it works

{% stepper %}
{% step %}

## Cache invites

On startup and after every invite create/delete, the bot caches your invite list in memory.
{% endstep %}

{% step %}

## Attribute joins

When someone joins, the bot re-fetches invites and diffs — whichever code's `uses` went up is the one they joined with, and its creator gets credited.
{% endstep %}

{% step %}

## Store stats

Each join is stored in an audit log; each inviter's totals live in a stats table.
{% endstep %}

{% step %}

## Track leaves

On leave, the corresponding audit row is marked left and the inviter's "active" count drops.
{% endstep %}
{% endstepper %}

## Dashboard

**Dashboard → Invites**

### Top inviters

Leaderboard sorted by **active** members (`joined − left − fake`).

Each row shows:

* Rank
* Inviter ID
* Total joined, total left
* Suspected fake count (accounts under 7 days old at join time)
* Current active count (large number, right side)

### Recent joins

Timeline of the last 100 joins with:

* Member tag
* Inviter mention (or `no inviter` for vanity / discovery / widget joins)
* Invite code used
* Account-age warning if under 7 days
* "left N ago" marker when applicable

## Slash commands

| Command              | Effect                                        |
| -------------------- | --------------------------------------------- |
| `/invites [@user]`   | Show one member's invite stats (public reply) |
| `/inviteleaderboard` | Top 10 inviters in the server                 |

## Welcome message placeholder

Use `{inviter}` in your welcome message and it'll auto-expand to a mention of whoever invited the new member:

> ```
> Welcome {user} to the pack, invited by {inviter}! 🎉
> ```

When someone joins through vanity URL / discovery / widget (no attributable inviter), `{inviter}` renders as an empty string.

## Edge cases

* **Vanity URL joins** are labelled `vanity` in the recent-joins list. No inviter is credited.
* **Multiple simultaneous joins on different invites** — the bot picks the code with the largest use delta as primary; alternates are stored on the event but not surfaced in the UI (yet).
* **Bot restart** — the initial cache seed catches the current state. The first join after a restart always attributes correctly (fresh cache is the baseline for the next diff).
* **Missing Manage Server permission** — the bot can't fetch the invite list, so no attribution happens in that guild. Grant the permission and it'll start working immediately on the next join.

## Fake-invite detection

Any join by an account younger than **7 days** is flagged `is_fake: true` and increments the inviter's `fake` counter. Active count = `joined − left − fake`, so invite farming with fresh alts doesn't inflate leaderboards.

The threshold is intentional conservative — it isn't perfect, but it catches the most common farming patterns without penalising legitimate new-account joins during a marketing push.
