Skip to content

Invites on arrival

Every arrival is also counted for whoever invited the member. The numbers feed /inv invites, the invite leaderboard, giveaway requirements and the inviter variables of the welcome message. There is nothing to switch on: it runs on every server, as long as iHorizon has the Manage Server permission.

How the inviter is found

Discord doesn't tell bots which invite someone used. iHorizon works it out by comparing use counts:

  1. It keeps a note of how many times each of your invites has been used.
  2. When someone joins, it asks Discord for the current counts. The invite whose count went up is the one that was used.
  3. Its creator is credited with one invite, and the newcomer's record keeps who invited them (used later when they leave).

The note is taken when iHorizon starts (if it has Manage Server and View Audit Log at that moment), updated when an invite is created (that part needs View Audit Log), and after each credited arrival.

The credit is given on arrival, without waiting for the gates or the captcha. With the captcha on, the welcome message posted once the member is verified still names the inviter found on arrival.

The first arrival after iHorizon gets Manage Server

If iHorizon had no note of your counts yet (it was missing a permission when it started, for example), it can't tell which count went up. That first arrival is credited to nobody, iHorizon takes its note, and the next arrivals are counted normally.

Nobody is credited either when the member didn't come through an invite link: a bot added with its own link, a member added by AuthRestore, or a member who joined through your vanity URL (see below).

Leaves and rejoins

When a member leaves, for any reason, the person who invited them loses one invite and gains one leave. That includes members removed by iHorizon itself:

What happens to the newcomer Inviter's count
Stays +1
Kicked by the captcha or as a too-new account, banned by a blacklist +1 on arrival, −1 and one leave right after
Leaves after a month +1, then −1 and one leave a month later
Leaves and comes back through another member's invite The second inviter gets +1; the next leave counts against the second inviter
Comes back through the same invite +1 again: every arrival counts

So a raid that comes through one of your members' links shows up in that member's leaves, not in their total. Use /inv removeinvites if someone farms invites with accounts that leave and come back.

Vanity and discord.wf links

  • Your server's vanity URL (discord.gg/yourserver) belongs to nobody, so nobody is credited. In the welcome, the inviter shows as .gg/yourserver.
  • A discord.wf link made with /utils vanity-generator points to an invite created by iHorizon. In the welcome, the inviter shows as .wf/yourcode.

Members brought in by AuthRestore

/authrestore force-join adds your verified members back without any invite. For iHorizon, each of them is an ordinary arrival:

  • nobody is credited, and the inviter variables of the welcome get placeholder values;
  • each of them gets a welcome message, the join roles, the join DM, their saved roles if the role saver is on, once the gates let them in (after the captcha when it's on);
  • the gates apply: an account younger than your minimum age is kicked, and if the captcha is on, each of them gets one and is kicked after 2 minutes 30 seconds without an answer.

Turn the captcha off before a force-join

Members brought back by a force-join don't expect a captcha, and most of them won't see it in time: they'd be kicked one after the other. Switch the captcha off with /security config action:Power Off (and the too-new account check if it's on) for the duration of the force-join, and turn them back on afterwards. Expect one welcome message per member, too.

Next