discord.js check if user has manage server permission code example
Example 1: if member has role discord.js
let allowedRole = message.guild.roles.find("name", "rolename");
if (message.member.roles.has(allowedRole.id) {
} else {
})
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!`);
});