Skip to main content

Referrals

The referral system lets players earn currency rewards by inviting new members to the Discord server. Each player can generate a unique permanent Discord invite link; when someone joins via that link and later claims a dzbot account, the referrer is automatically credited.

How it worksโ€‹

  1. A player with the profile.generate_referral access right generates their personal referral link on the Profile page.
  2. dzbot creates a permanent Discord invite for the first available text channel in the guild and stores it.
  3. When a new user joins the Discord server using that invite, dzbot records the join against the referral.
  4. When the new user later claims their in-game account through the bot, dzbot credits the referrer's balance with the configured reward amount.

Each join is credited at most once, per member and per referral. If the new user's account was already claimed before they joined, or if there is no unclaimed join for them at claim time, no reward is issued.

How dzbot identifies the inviteโ€‹

Discord never reports which invite a joining member used. The only available signal is that an invite's use-count changed, so dzbot keeps a record of the use-count of every invite on the guild โ€” including invites members created themselves โ€” and compares it against the live list each time somebody joins.

A referral is credited only when exactly one use accrued across the whole guild, on an invite that was already being tracked. That is the only situation in which the joining member can be tied to a specific invite with certainty.

Everything else is recorded as an unattributed join rather than credited to a best guess:

SituationWhat happens
A member's own invite or the vanity URL was usedResolved to that invite; no referral involved, nothing recorded
dzbot added the member itself when they linked their accountNo invite was used, so there is no referrer; nothing recorded
Several invites were used at the same momentRecorded, listing the invites that moved
The invite was created after the last observationRecorded
The bot had just restarted and had no baseline yetRecorded
The guild invite list could not be read (missing Manage Server permission)Recorded

Admins see these under Admin โ†’ Referrals โ†’ Unattributed joins and can assign one to the correct referrer, which creates the join and pays the reward. Rows that genuinely have no referrer โ€” the invite had already expired, or the bot could not read the list โ€” can be dismissed instead.

Joins that happened while the bot was offline are a separate case: Discord does not deliver those events afterwards, so the member is never seen at all and cannot appear in this list. They surface as an issue on the affected referral instead, showing how many uses went uncredited. Because the member is unknown, those cannot be assigned retroactively.

note

The bot needs the Manage Server permission on the guild to read the invite list. Without it no referral can ever be attributed, and every join lands in the unattributed list.

Configurationโ€‹

The reward amount is controlled by a single server setting:

SettingLocationDefault
Referral reward amountAdmin โ†’ Economy settings0 (disabled)

Setting the reward amount to 0 disables the referral feature entirely. Players will not see the referral card on their profile when the reward is zero.

Player experienceโ€‹

Players visit Profile and, if the feature is enabled and they have the required access right, a Referral Link card is shown. The card displays:

  • The configured reward per referral.
  • A Generate referral link button (shown before a link exists).
  • The generated invite URL with a copy button (shown once generated).
  • Statistics: total Discord joins via the link and how many resulted in a paid reward.

Access rightsโ€‹

Access rightWho needs it
profile.accessView the profile page
profile.generate_referralGenerate and view a referral link

Admins grant these rights through the access control system. See Access control.