diff --git a/src/structure/components/commands/utility/Grantable.js b/src/structure/components/commands/utility/Grantable.js index 3974146..661e2fb 100644 --- a/src/structure/components/commands/utility/Grantable.js +++ b/src/structure/components/commands/utility/Grantable.js @@ -6,7 +6,8 @@ class GrantablesCommand extends SlashCommand { super(client, { name: 'grantable', module: 'utility', - description: 'Display grantable roles' + description: 'Display grantable roles', + guildOnly: true }); } diff --git a/src/structure/components/observers/UtilityHook.js b/src/structure/components/observers/UtilityHook.js index 3d82afd..edbec7c 100644 --- a/src/structure/components/observers/UtilityHook.js +++ b/src/structure/components/observers/UtilityHook.js @@ -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;