selfrole bugfix
This commit is contained in:
parent
22a87766d1
commit
c9f0ae1144
@ -36,11 +36,11 @@ class SelfroleCommand extends SlashCommand {
|
|||||||
if (!selfrole.roles.length) return { index: 'COMMAND_SELFROLE_NONE', emoji: 'failure' };
|
if (!selfrole.roles.length) return { index: 'COMMAND_SELFROLE_NONE', emoji: 'failure' };
|
||||||
|
|
||||||
const memberRoles = member.roles.cache.map((r) => r.id);
|
const memberRoles = member.roles.cache.map((r) => r.id);
|
||||||
const invalid = 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));
|
const _roles = roles?.value.filter((r) => selfrole.roles.includes(r.id)) || [];
|
||||||
let warning = null;
|
let warning = null;
|
||||||
if (invalid.length) warning = guild.format('COMMAND_SELFROLE_INVALID', { roles: invalid.map((r) => r.name).join('**, **') });
|
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,
|
let index = null,
|
||||||
params = {};
|
params = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user