From bdc8df33342f105452bd45e0f392a299e0a12bb1 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 2 Sep 2022 10:11:20 +0300 Subject: [PATCH] fixes --- src/structure/components/commands/utility/Grantable.js | 3 ++- src/structure/components/observers/UtilityHook.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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;