API Feature Request: Track invite used. #3210
Replies: 61 comments 54 replies
-
Hi, What's the use case here? |
Beta Was this translation helpful? Give feedback.
-
Handy for bot-logging, so you can tell what invite is being used for raids, or if unsavory people are joining, you can find out how. Currently can be done by polling the invite list for increments, but thats unreliable at times. Similar vein, a create invite event would be nice. |
Beta Was this translation helpful? Give feedback.
-
There is an OAuth scope which allows applications to add users to guilds. This could be used instead. |
Beta Was this translation helpful? Give feedback.
-
Not really the same use case that vexs pointed out |
Beta Was this translation helpful? Give feedback.
-
@MinnDevelopment vexs means that when a user joins, the invite information would be sent in an event. Not add a user to a guild using an invite. |
Beta Was this translation helpful? Give feedback.
-
He is talking about adding this for raid prevention, I'm just saying that this OAuth scope already makes this possible as it gives full control over who gets added in the first place making this information available. |
Beta Was this translation helpful? Give feedback.
-
OAuth scope doesn't let people create invite links for others to join. It also means you lose the discord.gg link. |
Beta Was this translation helpful? Give feedback.
-
+1 Would be helpful to find out who keeps inviting ban evaders/troublemakers. On a side note, I'd also like to see this information in the user's profile within the client. An admin shouldn't have to write a bot to figure it out. I'd honestly like to see the HTTP REFERRER header information too if it was defined when the user joined through discord.gg... though I can imagine that may raise some privacy issues, inconsistent data, or even spoofed data. But it'd still help to know where users are posting invites to your server. I don't see OAuth as a viable solution to this, it's more of an inconvenient workaround for those who don't don't require that flow. |
Beta Was this translation helpful? Give feedback.
-
A current way to do this is to be able to check the invites that exist at the current point in time, store them yourself, then on member join, check which invite count updated that way. I don't know if this is possible but it should be as long as the bot has perms to make invites I think. |
Beta Was this translation helpful? Give feedback.
-
@BoxOfFlex I feel like there would be some edge cases with that method, for example when two invites are used by two different users at once. You might also have to handle single-use invites differently. Not impossible to implement, but not perfect either. |
Beta Was this translation helpful? Give feedback.
-
Another issue of polling the existing invites are that vanity invites for partners are not listed in the server invites. Including the used invite in the member join event would provide a much cleaner way to track invites. It would also reduce the HTTP API traffic as you don't have to request all server invites for every member joining a server. |
Beta Was this translation helpful? Give feedback.
-
Now that I think about it, that would actually be a massive pain to implement... You'd have to also watch for when invites are invalidated to make sure your cache stays up-to-date so users don't get associated with two invites. And yeah, even that's assuming that you don't have a vanity link, that would mess everything up. |
Beta Was this translation helpful? Give feedback.
-
this would make referring easier for bot programmers. im currently working on a system where people invite multiple friends and get a role as a reward. this would make my life a lot easier |
Beta Was this translation helpful? Give feedback.
-
Right now, my use case is this: A user joins the server. I'd like to detect if the invite link used was temporary or permanent, and if a permanent one, then shoot a DM to the person explaining how to use the bots within discord. |
Beta Was this translation helpful? Give feedback.
-
You can just track the invites, and see which one of them increases when a guild event happen. but this request will make every thing easy |
Beta Was this translation helpful? Give feedback.
-
I think a user-specific invite endpoint like /channels/{channel.id}/invite/{user.id} could be a better solution. Humans and bots could utilise that endpoint alike. |
Beta Was this translation helpful? Give feedback.
-
I have been struggling to solve this problem for days. A general suggestion is to cache the invite codes in the inviteCreate event and match them later in the guildMemberAdd event by fetching all invites so far. This is problematic because when creating a link for a specific person, the only thing you have is the invite code(for one time links) I don't know what other path to follow just to match the invite code with discord user name/id. Can you guys tell me if there is any further progress in this issue, please. |
Beta Was this translation helpful? Give feedback.
-
Thanks. |
Beta Was this translation helpful? Give feedback.
-
If track invite is not an idea for staff, why can't it just be a special intent? |
Beta Was this translation helpful? Give feedback.
-
for what it's worth you can generate your own invite codes and require these to be entered in a special channel before your bot gives them access to the rest of the guild, but not sure if this is against the Discord ToS 🤷 |
Beta Was this translation helpful? Give feedback.
-
Dec 10, 2017, Feature Request |
Beta Was this translation helpful? Give feedback.
-
Yes, this is possible through tracking the guild's invite list, but if discord already knows which invite was used, why not just send that along too? |
Beta Was this translation helpful? Give feedback.
-
Heyyyyy guys, this feature seems really useful, maybe add it at some point? |
Beta Was this translation helpful? Give feedback.
-
Now that this is exposed to server admins via the member list in the client it feels right to also expose this in the API (or document it because I've heard it already is exposed 👀) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
This works for me, POST |
Beta Was this translation helpful? Give feedback.
-
A POST works, but is there any way or query to add to have it return more than the first 25 members? Requests from the members tab only use the |
Beta Was this translation helpful? Give feedback.
-
Thanks for this! |
Beta Was this translation helpful? Give feedback.
-
Hey, thanks for this amazing feature! I've already been trying to implement it. Do we know when this will be fully documented and rolled out (in an announcement) yet? |
Beta Was this translation helpful? Give feedback.
-
Definitely this is necessary |
Beta Was this translation helpful? Give feedback.
-
Feature request to include the invite code used as well as the inviting member in the member join event. Alternatively, include invite used information in the member object (invited-by: [USER SNOWFLAKE]).
Beta Was this translation helpful? Give feedback.
All reactions