I'm trying to make a verification bot for my new Discord server, but I need to know how to assign roles in Discord.JS 13 latest.
It's GuildMember.roles.add(roleOrRoles, [optionalReason]). In the discord.js docs: docs: -addrole.
You can do this something like same thing with getting member.id.
const member = message.mentions.members.first() || message.guild.members.cache.get(args[0])
You can create the code similar to this.
const role = message.mentions.roles.first() || message.guild.roles.cache.get(args[0])
Now you can adjust your code file:
const member = message.mentions.members.first() || message.guild.members.cache.get(args[0])
const role = message.mentions.roles.first() || message.guild.roles.cache.get(args[1])
member.roles.add(role) //To add the mentioned or given role id the the member.
You can see the image below, the format is args[0] for member and args[1] is for role. Try to experiment your code for this time!