diff --git a/src/structure/components/commands/utility/Selfrole.js b/src/structure/components/commands/utility/Selfrole.js index 39c6394..fef0737 100644 --- a/src/structure/components/commands/utility/Selfrole.js +++ b/src/structure/components/commands/utility/Selfrole.js @@ -36,11 +36,11 @@ class SelfroleCommand extends SlashCommand { if (!selfrole.roles.length) return { index: 'COMMAND_SELFROLE_NONE', emoji: 'failure' }; const memberRoles = member.roles.cache.map((r) => r.id); - const invalid = roles.value.filter((r) => !selfrole.roles.includes(r.id)); - const _roles = roles.value.filter((r) => selfrole.roles.includes(r.id)); + const invalid = roles?.value.filter((r) => !selfrole.roles.includes(r.id)) || []; + const _roles = roles?.value.filter((r) => selfrole.roles.includes(r.id)) || []; let warning = null; if (invalid.length) warning = guild.format('COMMAND_SELFROLE_INVALID', { roles: invalid.map((r) => r.name).join('**, **') }); - if(!_roles.length) return { content: warning }; + if(!_roles.length && subcommand !== 'clear') return { content: warning }; let index = null, params = {};