From 2e539511a49ff993eded39751a2e768315ee4ff6 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 25 Aug 2021 18:27:29 -0400 Subject: some fixes --- src/commands/config/joinRoles.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/commands/config') diff --git a/src/commands/config/joinRoles.ts b/src/commands/config/joinRoles.ts index 89a2421..9507d4b 100644 --- a/src/commands/config/joinRoles.ts +++ b/src/commands/config/joinRoles.ts @@ -39,12 +39,15 @@ export default class JoinRolesCommand extends BushCommand { public override async exec(message: BushMessage | BushSlashMessage, { role }: { role: Role }): Promise { const joinRoles = await message.guild!.getSetting('joinRoles'); - const newValue = util.addOrRemoveFromArray(joinRoles.includes(role.id) ? 'remove' : 'add', joinRoles, role.id); + const includes = joinRoles.includes(role.id); + client.console.debug(joinRoles); + const newValue = util.addOrRemoveFromArray(includes ? 'remove' : 'add', joinRoles, role.id); await message.guild!.setSetting('joinRoles', newValue); + client.console.debug(joinRoles); return await message.util.reply({ - content: `${util.emojis.success} Successfully ${joinRoles.includes(role.id) ? 'removed' : 'added'} <@&${ - role.id - }> from being assigned to members when they join the server.`, + content: `${util.emojis.success} Successfully ${includes ? 'removed' : 'added'} <@&${role.id}> ${ + includes ? 'from' : 'to' + }from being assigned to members when they join the server.`, allowedMentions: AllowedMentions.none() }); } -- cgit