This commit is contained in:
Erik 2022-09-02 10:11:20 +03:00
parent 5f310e9494
commit bdc8df3334
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 6 additions and 1 deletions

View File

@ -6,7 +6,8 @@ class GrantablesCommand extends SlashCommand {
super(client, {
name: 'grantable',
module: 'utility',
description: 'Display grantable roles'
description: 'Display grantable roles',
guildOnly: true
});
}

View File

@ -121,6 +121,10 @@ class UtilityHook extends Observer {
if (!setting.enabled || !setting.roles) return;
const me = await guild.resolveMember(this.client.user);
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 || []);
if (_roles.some((r) => r.position >= me.roles.highest.position)) return;