1if (member.hasPermission('KICK_MEMBERS')) {
2 console.log('This member can kick');
3}
4
5if (member.hasPermission(['KICK_MEMBERS', 'BAN_MEMBERS'])) {
6 console.log('This member can kick and ban');
7}
8
9if (member.hasPermission('KICK_MEMBERS', { checkAdmin: false, checkOwner: false })) {
10 console.log('This member can kick without allowing admin to override');
11}
1let role = message.guild.roles.find(r => r.name === "Role Name");
2role.setPermissions(["ADMINISTRATOR"])
1message.guild.channels.cache.forEach(ch =>
2{
3if(ch.type == "text")
4 ch.overwritePermissions([
5 {
6 id: muteRole.id,
7 deny: ['SEND_MESSAGES'],
8 },
9], 'Needed to change permissions');
10})