How to make a command require admininstrator in discord.js 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!`);
});