'Add role to user from DMs?

So I'm making a verification bot for one of my Discord Servers, and I've come across a problem.

Purpose: When the user first joins, they will be only allowed to talk in one specific channel, the verification channel. When they type $verify {username on-site}, the bot will reply in-server telling the user to check their DMs to continue. A unique string linked to a verification row in the database will be given, and the discord user will be told to change their status on-site to the given unique ID. Once they do that, they will be given the "Verified" role and will be able to speak on the discord.

The problem: When everything goes right, and the user is ready to be given the role on the discord server, the bot will not give the role. I'm assuming this is because the user that the bot is trying give the role to is not linked to the actual discord server for it, because it's in DMs.

What I'm looking for: If possible, give me an example on how to give a role to a user on a discord server from DMs, or documentation. That would be really helpful!

Code: I'll only include the part that is important, there is no other errors.

snekfetch.get("https://vertineer.com/api/getUniq.php?discord_id="+message.author.id).then(function(r){
                    console.log("here 2");
                    let uniq = JSON.parse(r.text);
                    if(uniq.id == uniq.status){
                        message.member.addRole("Verified");
                        message.reply("Success!");
                    } else {
                        message.reply("Looks like you didn't change your status to `"+uniq.id+"`, try again with `$finish`.");
                    }
                });


Solution 1:[1]

If this is only to work for one server you can do:

client.guilds.get('myguildID').members.get(message.author.id).addRole('193654001089118208')

And also, to give a role to a user you can't use the name. You need to use the ID or the Role Object.
If you would prefer to use the name you would need to do something like this:

var role = client.guilds.get('myguildID').roles.find(role => role.name === "Verified");
client.guilds.get('myguildID').members.get(message.author.id).addRole(role);

Solution 2:[2]

This is what worked for me:

client.guilds.fetch(<guild.id>).then(async(guild) => {
    let role = guild.roles.cache.find(r => r.name === <role.name>);
    let member = await guild.members.fetch(<member.id>);

    member.roles.add(role);
});

Substitute <guild.id>, <member.id> and <role.name> for the desired values respectively

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 André
Solution 2 WilliamDragon10