Skip to main content

Invites

Invite blocks create, read and delete invite links, and they let you tell which invite somebody joined with.

Show the whole Invites flyout

The Invites subcategory

Creating and deleting​

Create invite

create invite for channel ... amount of uses ... makes a new invite and returns it. Set uses to 0 for an unlimited invite.

Delete invite

delete invite revokes it. Anyone holding the link can no longer use it.

Getting an invite​

Get invite

get invite with URL looks one up from its link or code. It works for invites to other servers too, which is how invite filters check what a posted link points at.

Reading an invite​

BlockReturns
urlThe full invite link.
channelThe channel it leads to.
authorWho created it.
createdWhen it was created.
expirationWhen it expires.
temporaryWhether it grants temporary membership.
usesHow many times it has been used.

Loops​

BlockWhat it does
for each invite on serverLoops over every invite in a server.
for each invite on channelLoops over the invites for one channel.
current inviteThe invite being handled.

Events​

BlockFires when
invite createdSomebody creates an invite.
invite deletedAn invite is revoked or runs out.
the inviteThe invite involved, inside either event.

Invite tracking​

The when a member joins a server event in Server Actions has an invite the member joined with block, so you do not need to compare use counts yourself.

An invite leaderboard is then:

  1. when a member joins a server.
  2. get author of invite <invite the member joined with>.
  3. add 1 to <that user's ID> in a database.
info

Invite tracking needs the Manage Server permission. Without it the bot cannot see the invite list, and the invite block comes back empty.

A worked example: blocking other servers' invites​

  1. when a message is received from a human.
  2. Use a test regexp block from Text with a pattern matching discord.gg/.
  3. If it matches, delete message and reply with a warning.
  4. To allow your own invites through, use get invite with URL and compare its server ID with the current one before deleting.