How can I say which Discord member came through which invite?

Viewed 264

I want to have a Discord server for paid members. I thought I could make them pay over Stripe, send them an invite on payment, and then regularly run a Python script, which checks whether all my Discord members have a valid subscription. For this to work I need a logical connection between the payment and the Discord member.

I thought the logical connection would be the invite, but I can't seem to figure out how to do this. I studied the Discord API, but it seems the invites are not unique to members nor I can track down which members used which invites.

Also, I can't even see the members' e-mail address. Not that e-mails would be the best logical connection, as one could use a different e-mail for subscription than for setting up their Discord account, but it would be at least a spark of hope. I discovered a permission/scope to see e-mails, but it seems to require a full, interactive OAuth2 flow, whereas I need to pair the members with payments using a non-interactive server-side cron script.

Could someone point me to the right direction?

Note: There are services like LaunchPass or Memberful, which can do this, hence there must be a way. I can code and I think I'd be okay with a much simpler mechanism then what they offer (one manually editable Google Sheets table and one Python script), so I'm trying to figure this out myself.

1 Answers

Another option would be to create a single-use invite once the user completes the payment and send it to them. It'll be unique to them, and it'll get invalidated once they join. When they join, you can record which member joined using this invite and cross-reference the payment which caused the invite to be created and the member who used it.

For bonus points, you can see if the member leaves and email them another invite to join the server back.

A drawback of this solution is that this does not prove that the member who joined is the member who paid, and they can transfer their invite to somebody else and their username will get associated with the payment, but that would require actions on behalf of the person making the payment.

Related