0
votes

discord.js verison 12

if i want to add role member and input only role id '712836654561493014' can use this command

suchas i'm type !addverify @game <-- member in guild how i do?

if(message.content === '!addverify'){
message.guild.addrole()
}
1

1 Answers

0
votes

To add a role to the member you have mentioned, use this code:

let role = message.guild.roles.find(r => r.name === "GamerRole");
let member = message.mentions.members.first();

member.addRole(role).catch(console.error);