Clean up bitfield calculations
parent
7a3ccd7bd7
commit
e387d20f44
|
@ -86,15 +86,15 @@ export default class Whois extends Command {
|
||||||
const serverAcknowledgements: string[] = [];
|
const serverAcknowledgements: string[] = [];
|
||||||
const bit = member.permission.allow;
|
const bit = member.permission.allow;
|
||||||
if (message.guild.ownerID === member.id) serverAcknowledgements.push('Server Owner');
|
if (message.guild.ownerID === member.id) serverAcknowledgements.push('Server Owner');
|
||||||
if ((bit | 8) === bit) { permissions.push('Administrator'); serverAcknowledgements.push('Server Admin'); }
|
if (bit & 8) { permissions.push('Administrator'); serverAcknowledgements.push('Server Admin'); }
|
||||||
if ((bit | 32) === bit) { permissions.push('Manage Server'); serverAcknowledgements.push('Server Manager'); }
|
if (bit & 32) { permissions.push('Manage Server'); serverAcknowledgements.push('Server Manager'); }
|
||||||
if ((bit | 16) === bit) permissions.push('Manage Channels');
|
if (bit & 16) permissions.push('Manage Channels');
|
||||||
if ((bit | 268435456) === bit) permissions.push('Manage Roles');
|
if (bit & 268435456) permissions.push('Manage Roles');
|
||||||
if ((bit | 8192) === bit) { permissions.push('Manage Messages'); serverAcknowledgements.push('Server Moderator'); }
|
if (bit & 8192) { permissions.push('Manage Messages'); serverAcknowledgements.push('Server Moderator'); }
|
||||||
if ((bit | 134217728) === bit) permissions.push('Manage Nicknames');
|
if (bit & 134217728) permissions.push('Manage Nicknames');
|
||||||
if ((bit | 1073741824) === bit) permissions.push('Manage Emojis');
|
if (bit & 1073741824) permissions.push('Manage Emojis');
|
||||||
if ((bit | 4) === bit) permissions.push('Ban Members');
|
if (bit & 4) permissions.push('Ban Members');
|
||||||
if ((bit | 2) === bit) permissions.push('Kick Members');
|
if (bit & 2) permissions.push('Kick Members');
|
||||||
const account = await this.client.db.Member.findOne({ userID: member.id });
|
const account = await this.client.db.Member.findOne({ userID: member.id });
|
||||||
if (account?.additional?.langs.length > 0) {
|
if (account?.additional?.langs.length > 0) {
|
||||||
const langs: string[] = [];
|
const langs: string[] = [];
|
||||||
|
|
Loading…
Reference in New Issue