discord.js bot makes role code example
Example 1: how to give roles discord.js
let role = message.guild.roles.find(r => r.name === "Role Name");
let member = message.mentions.members.first();
member.roles.add(role)
Example 2: discord.js v12 how to set owner commands
<message>.guild.members.fetch().then(fetchedMembers => {
const totalOnline = fetchedMembers.filter(member => member.presence.status === 'online');
<message>.channel.send(`There are currently ${totalOnline.size} members online in this guild!`);
});