Generate an invite link to add a user to a role.

Kommentarer

87 kommentarer

  • JKybett

    I need this so much!
    There is a server I have where I could double the users I could be inviting to it but can't include a large demographic because there are certain areas that would have to be specific to one half of the user base or the other.
    In this specific server it is incredibly difficult (and would be very time consuming) to find out and/or verify which of these two groups users belong to but very easy to restrict which invite links these people have access to.
    I have a different server where I invite people with single-use invites and this would simplify giving the right people the right roles.
    I can also see this being useful for servers that are linked to patron systems or memberships, servers that are used in a professional setting, and any other servers using roles to identify a portion of the user base that is different for reasons external to the server.

    0
  • Insasse

    Is there any progress on this?
    This would make life much easier for discord admins!

    0
  • Unit_3397

    yessssssssssss please devs, +1 @Phantom

    0
  • ATLAS

    +1

    0
  • Eriolo

    this can be really helpful for like the current situation and teachers, discord already set a template for classrooms, but with this option i cand send to one class a link and they only have permission to the channels i want, i send other link to other class and will have permission for other channels,is perfect.

    0
  • Optivex

    please add this devs! if I create an invite on a private text channel I should have the option to get people straight in here with a link such as discord.gg/linkID/channelPassword

    0
  • mistr88

    If discord will be something as messenger, then yes, but the power of discord is in bots. And here, I am not saying, that this is terrible idea because you can do this by bots, but bot creators are lazy (I see it on me) and will use this and will not use the standard **universal** approach. And then, when someone will join via different invite, he will not get the starter role.

    Edit: And not putting this to API will not help, because this feature will still be useable by user bots.

    1
  • mistr88

    And also, it's extremely easy to create own fully customized bot (about 10 mins just for this task)

    1
  • Sebastian Nielsen

    @mistr88 No. The problem is that the bot cannot easily know which invite link a user "comes from". Yes, there is ugly solutions as like looking on invite link counts and such, but such solutions can be dangerous, especially when using them to assign moderator/admin roles.

    The second problem is if a user is already member, but gained another invite link, that would grant them a "second role". One example could be a gaming community for multiple games, where a role @Minecraft would gain them access to Minecraft-related channels, and @CSGO would gain them access to CS:GO related channels. In their minecraft server, they then have a minecraft related invite link, and in CS:GO server a CS:GO-related invite link. If a user is member of both servers, it could be a good thing if the user, after already joined @Minecraft role, could just visit the link for the @CS:GO role, and then instead of showing "Already connected" it will show a button "Give me the role" and clicking this, will then turn it into a "Already connected" button and give the role.

    1
  • Henry Bitmin

    https://top.gg/bot/480240313525600267 Here is a bot that does that, but it really should be integrated with discord

    0
  • addisonschultz

    +1 for this feature, would be super helpful managing invited users

    0
  • Technical_13

    This follows in line with https://support.discord.com/hc/en-us/community/posts/360029311651-Track-who-joined-through-what-invite- and https://support.discord.com/hc/en-us/community/posts/360058433271-Add-invite-data-to-user-joined-event for how I would use the data if it was in the API for the bot to see which invite a member is joining with on join.

    0
  • ModerateWinGuy

    This really should just be a default feature. If only they would add this.

    0
  • Delight

    its literally that easy:

    step 1: install node.js from https://www.nodejs.org

    step 2: search "node.js command prompt"

    step 3: enter "npm i discord.js" in the command prompt

    step 4: go to https://discord.com/developers/applications log in with your discord account, click on "new application", enter a name, then click "create" and click "copy" below your client id

    step 5: on the left side click on "bot", click on "add bot" then on "yes, do it"

    step 6: go to https://discordapi.com/permissions.html#8 insert your client id in the field called "client id:" and click on the link

    step 7: select the server you want to have the bot on and solve the captcha

    step 8: go back to the bot section of the developer portal and click on "copy" below "your token" Make sure you dont share your token with anyone, it is like the username and password to your bot and can get your account banned.

    step 9: create a folder on your desktop called something like "Bot". create a new text file and paste code located at the bottom of this comment.

    step 10: replace "DEFAULT ROLE NAME HERE" with the default role name and replace "YOUR TOKEN HERE" with the token you just copied. save the document as "index.js"

    step 11: create another text document, insert "node index.js" in the first line and "pause" in the second line. save it as "start.bat"

    step 12: execute start.bat and your bot is running. congratulations!

    index.js code:

     

    const Discord = require("discord.js");
    const client = new Discord.Client();
     
    client.on("guildMemberAdd", newMember => {
       
    const defaultRole = message.guild.roles.cache.find(role => role.name == "DEFAULT ROLE NAME HERE");
    newMember.roles.add(defaultRole);
    });
     
    client.login("YOUR TOKEN HERE");
    -4
  • ImRock

    That does not give roles if they use specific links that is a general auto role thing.

    2
  • J3st3r

    Im happy for all the advice on how to work around this lack of feature, however the point of requesting a feature (in the feedback section) is the hopes the dev team can add it in to the base application.

    From my perspective, bots are best used for niche things that the devs dont feel the need to provide or to allow customization which would otherwise be impossible to facilitate within the base application, not for things that a lot of people would like implemented for QoL reasons which would make the overall application better. You see the devs put notes in when patches are applied literally stating "due to community request", its obvious they listen when they can.

    I dont see why people would actively try to shut down conversation on a request for a feature that obviously ticks the right boxes for a certain amount of people. 

    3
  • Wayland

    Delight That is an awesome guide on how to get a discord.js bot up and running, but that does not solve the issue of "people joining with a specific invite should be automatically added to a role" your solution just adds everyone who joins the guild to a role, and that is no bueno.

    For example what if I had a role to denote users who are from a forum which I want to invite to my guild. Currently I would have to just use any invite and they would need to ask to be added the role after some sort of manual verification on my part.

    If we could somehow access data about what invite they used to join on guildMemberAdd it would be as easy as checking "is this invite they used the one that should get the special role?" and if so assign the role and if not don't. The only info available is how many times an invite has been used.

    1
  • MasterReY

    Its funny how many people in this thread do not realize that a auto-assignment of DIFFERENT ROLES for DIFFERENT USERS (depending on the invite link) is needed.

    Yes, bots can auto assign roles.
    Yes, everyone can write his own bot and auto-assign roles.

    However whats currently NOT possible is this:
    I have one server for my streaming community and also my friends.
    I want everyone joining from the link on my stream to get the "streaming community role" auto assigned.
    I want everyone joining from the link of my friends to get the "friends" role auto assigned.
    The link itself is not important. I just can't think of another criteria to differentiate between two kinds of users.

    Please tell me I'm wrong and there is a way to do this :)

    0
  • JKybett

    It is possible for bots to do what you're asking, in the following way:
    Make the bot track the number of people who have joined via each invite link.
    When a new user joins, check each link and assign a role based on which link has had more people join than before.
    The problem with this, is that if your bot suffers downtime while people are joining or people are joining more often than the bot is able to check this, it becomes impossible to ascertain which user is responsible for which increase in users-joined by invite link.
    Even if the devs put in a feature where the link a person used to join is recorded or each link records which specific users joined by it, this problem could be avoided. As it is, although it is possible to implement this behaviour with bots, it is not possible to trust the bot that implements this behaviour.

    0
  • MasterReY

    Thanks for the reply JKybett!
    So it is actually possible, but i think no current bot actually implemented that feature sadly.

    Could you specify what exactly you mean with "it is not possible to trust the bot that implements this behaviour."
    Why would you not trust a bot with this specific feature, but trust it with all the other features the bots have?

    0
  • JKybett

    Such a bot is too prone to failure for this purpose, if the different role permissions are important to your server. It's a matter of recoverability. If a bot that blocks swearing, maintains bans or performs tasks based on commands like "!help" suffers an error or downtime, the bot can re-attempt these functions when it recovers. However, since this feature requires constant monitoring of the number of people who have joined via each particular link and comparing them to existing figures, there's a specific window of opportunity during which the bot can function as normal; between one person joining and the next. If such a bot were to miss this opportunity, then it is completely incapable of determining which link these users used, rendering it useless for these people.
    So, if it's important to distinguish people upon joining to give them a specific role depending on how they joined, you can't trust this bot to do it as it could fail for any user at any time and be unable to correct itself.

    0
  • MasterReY

    Ah okay i see. Yeah thats true.
    I somehow read your sentence in a different way that a bot who has enough permissions to do that can somehow compromise the server etc. Makes no sense :)

    So then the point of the thread here still stands. I think we really need this feature.
    My temporary solution is:
    I have given my friends the permission to "manage roles" (another big feature that is missing is the permission to only ASSIGN role and not edit/delete them) and tell them that they should manually remove the auto-assigned role and add the "friend" role instead to people they invite.

    0
  • JKybett

    Unrelated to the feature request, but might I suggest getting a bot that can manage roles with a command to give a role to someone that your friends can use? That way your friends aren't able to edit or manage the role but can still give it to people. Sounds like what you're looking for in your workaround.

    0
  • MasterReY

    Yeah that will be the best way.
    Thanks for your input!

    0
  • natemaingard

    How is this not a thing yet? It seems so simple and it would make a huge difference to being able to filter members based on role! I do hope they implement it asap. At the moment I'm running a workshop and I want to give attendees a unique invite link which would enable them to join a specific private channel...

     

    1
  • Skwiggs

    Yes please <3 

    0

Log ind for at efterlade en kommentar.