forked from Galactic/galactic-bot
fixes
This commit is contained in:
parent
5f310e9494
commit
bdc8df3334
@ -6,7 +6,8 @@ class GrantablesCommand extends SlashCommand {
|
|||||||
super(client, {
|
super(client, {
|
||||||
name: 'grantable',
|
name: 'grantable',
|
||||||
module: 'utility',
|
module: 'utility',
|
||||||
description: 'Display grantable roles'
|
description: 'Display grantable roles',
|
||||||
|
guildOnly: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,6 +121,10 @@ class UtilityHook extends Observer {
|
|||||||
if (!setting.enabled || !setting.roles) return;
|
if (!setting.enabled || !setting.roles) return;
|
||||||
const me = await guild.resolveMember(this.client.user);
|
const me = await guild.resolveMember(this.client.user);
|
||||||
if (!me.permissions.has('ManageRoles')) return;
|
if (!me.permissions.has('ManageRoles')) return;
|
||||||
|
if (setting.roles.some((r) => r === null)) {
|
||||||
|
setting.roles = setting.roles.filter((r) => r);
|
||||||
|
await guild.updateSettings({ autorole: setting });
|
||||||
|
}
|
||||||
|
|
||||||
const _roles = await guild.resolveRoles(setting.roles || []);
|
const _roles = await guild.resolveRoles(setting.roles || []);
|
||||||
if (_roles.some((r) => r.position >= me.roles.highest.position)) return;
|
if (_roles.some((r) => r.position >= me.roles.highest.position)) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user