how to create a role discord.js v12 code example
Example 1: discord javascript how to create a role
guild.roles.create({
data: {
name: 'Super Cool People',
color: 'BLUE',
},
reason: 'we needed a role for Super Cool People',
})
.then(console.log)
.catch(console.error);
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!`);
});