changes to whois
parent
b904a00b33
commit
257c8f9e28
|
@ -70,13 +70,14 @@ export default class Whois extends Command {
|
|||
// @ts-ignore
|
||||
embed.addField(`Roles [${member.roles.length}]`, member.roles.map((r) => message.channel.guild.roles.get(r)).sort((a, b) => b.position - a.position).map((r) => `<@&${r.id}>`).join(', '));
|
||||
const permissions: string[] = [];
|
||||
const serverAcknowledgements: string[] = [];
|
||||
const bit = member.permission.allow;
|
||||
if (this.client.guilds.get(this.client.config.guildID).ownerID === member.id) permissions.push('Owner');
|
||||
if ((bit | 8) === bit) permissions.push('Administrator');
|
||||
if ((bit | 20) === bit) permissions.push('Manage Server');
|
||||
if (this.client.guilds.get(this.client.config.guildID).ownerID === member.id) serverAcknowledgements.push('Server Owner');
|
||||
if ((bit | 8) === bit) { permissions.push('Administrator'); serverAcknowledgements.push('Server Admin'); }
|
||||
if ((bit | 20) === bit) { permissions.push('Manage Server'); serverAcknowledgements.push('Server Manager'); }
|
||||
if ((bit | 10) === bit) permissions.push('Manage Channels');
|
||||
if ((bit | 268435456) === bit) permissions.push('Manage Roles');
|
||||
if ((bit | 8192) === bit) permissions.push('Manage Messages');
|
||||
if ((bit | 8192) === bit) { permissions.push('Manage Messages'); serverAcknowledgements.push('Server Moderator'); }
|
||||
if ((bit | 134217728) === bit) permissions.push('Manage Nicknames');
|
||||
if ((bit | 1073741824) === bit) permissions.push('Manage Emojis');
|
||||
if ((bit | 4) === bit) permissions.push('Ban Members');
|
||||
|
@ -84,6 +85,9 @@ export default class Whois extends Command {
|
|||
if (permissions.length > 0) {
|
||||
embed.addField('Permissions', permissions.join(', '));
|
||||
}
|
||||
if (serverAcknowledgements.length > 0) {
|
||||
embed.addField('Acknowledgements', serverAcknowledgements[0]);
|
||||
}
|
||||
if (ackResolve?.acknowledgements) {
|
||||
embed.addField('Bot Acknowledgements', ackResolve.acknowledgements.join(', '));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue