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

Comments

87 comments

  • 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
  • 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
  • Skwiggs

    Yes please <3 

    0
  • Cheese

    @ShuriZma

    i don't want people to self-assign roles in my server.

    -1
  • ShuriZma™

    its actually the same if you got 3 invites and each got an own role or if you got 3 roles that all people can assign one of them to themselves.

    -2
  • ShuriZma™

    you could use bots that allow users to give them those roles themselves 

    -4
  • Spud
    As this isn't a feature yet, I recommend you use the mee6 bot for this.
    -4
  • ImRock

    Discord ensures that there will be no breaking changes as if this occurs then a lot of other dependancies other than just bots will also break. The purpose of bots is to the ground between discord servers and plugins as the staff have to focus on other elements of the service and if you are worried about bots breaking you should concider a bot that is actually being actively being developed on instead of stating that all discord bots just break for no reason when discord updates and there being no certainty that it will be fixed.

    Having some sort of plugins for discord servers would remove any sort of purpose for bots which have been well established in the community and would be a reinventation of the wheel and would generally be a waste of time.

    -4
  • 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
  • Neztore
    Whats wrong with using bots? The point of bots is to provide custom and helpful features not widely enough required to be added to discord.
    -5
  • hasankayra04

    discord bots can do it for you example: mee6

    -5
  • Frosty
    You can use bots for autorole
    -6
  • undermaster

    Many bots can do that but if you're asking for a built-in one. That's a good idea

    -6
  • 〘⋌【Alcahest】⋋〙

    The auto role on join is possible with Tatsumaki (and if i don't remember bad) with Mee6, good idea, but a little useless if there are bots that do the same thing

    -7
  • ImRock

    I mean there is no harm in using bots ¯\_(ツ)_/¯

    -8
  • chloroform chloe

    No, I'm not tired of it. Dude, just create an integration lol. They do that for you already.

    -9
  • voiden.

    Dyno, Mee6 and tatsumaki all do this...

    -13

Please sign in to leave a comment.