# Referrals

Personal invite links, who invited whom, a stay timer that blocks invite-and-leave, and reward roles at a number of referrals.

Source: https://noxyrbot.com/docs/referrals

## How it works

Discord does not say which invite a member used, so the bot keeps every invite's use count and, when someone joins, credits the invite whose count went up. /referrals link creates a bot-made personal invite for the member who runs it, so their joins are credited to them without touching Discord's invite dialog.

Each referral is announced: an embed in a log channel, or a private ticket for staff with Approve and Reject buttons. Once a member reaches a reward threshold they get the role automatically.

## Setup

- **/referrals setup enabled:true**: Turns tracking on. Options: mode (log or ticket), log_channel, ticket_category, staff_role, hold, hold_hours (1-720), min_account_age (0-365 days).
- **/referrals reward-add count:<n> role:@role**: Give a role once someone reaches n counted referrals. Add several for tiers; /referrals reward-remove count:<n> drops one.
- **/referrals settings**: The current configuration and the total counted so far.
- **Referrals page (dashboard)**: Community → Referrals: the same settings with a form, plus the reward tiers.

## Member commands

- **/referrals link**: Your personal invite link for this server.
- **/referrals me**: How many people you brought in, and how many are still waiting on the stay timer.
- **/referrals top**: The members with the most referrals.
- **/referrals user member:@someone**: Staff only: totals for one member.

## What does not count

- **Rejoins**: One referral per member per server, ever. Leaving and joining through another link does not count again.
- **Self-invites and bots**: Never counted.
- **Young accounts**: Accounts younger than min_account_age days are rejected.
- **Invite-and-leave**: With hold on, a referral waits hold_hours and only counts if the member is still in the server.

> Note: The bot needs Manage Server to read invites. Without it, joins are not attributed and nothing else breaks. Vanity URL joins are not tied to a member.
