diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-25 16:16:44 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-25 16:16:44 -0400 |
commit | 4364f1d344e75d23728ce951fc768bc9c8405bed (patch) | |
tree | 47dbdb0482fc16842271c44e3736ba86e0064351 /src/commands/config/joinRoles.ts | |
parent | 95dc4c4a4abeed75f419c9ccd5b3f072609c5035 (diff) | |
download | tanzanite-4364f1d344e75d23728ce951fc768bc9c8405bed.tar.gz tanzanite-4364f1d344e75d23728ce951fc768bc9c8405bed.tar.bz2 tanzanite-4364f1d344e75d23728ce951fc768bc9c8405bed.zip |
cleaned up, wolfram alpha command, a few fixes
Diffstat (limited to 'src/commands/config/joinRoles.ts')
-rw-r--r-- | src/commands/config/joinRoles.ts | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/commands/config/joinRoles.ts b/src/commands/config/joinRoles.ts index ee2ce75..89a2421 100644 --- a/src/commands/config/joinRoles.ts +++ b/src/commands/config/joinRoles.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { Channel } from 'discord.js'; +import { Role } from 'discord.js'; export default class JoinRolesCommand extends BushCommand { public constructor() { @@ -36,18 +36,15 @@ export default class JoinRolesCommand extends BushCommand { userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'] }); } - public override async exec(message: BushMessage | BushSlashMessage, { channel }: { channel: Channel }): Promise<unknown> { - const autoPublishChannels = await message.guild!.getSetting('joinRoles'); - const newValue = util.addOrRemoveFromArray( - autoPublishChannels.includes(channel.id) ? 'remove' : 'add', - autoPublishChannels, - channel.id - ); + + public override async exec(message: BushMessage | BushSlashMessage, { role }: { role: Role }): Promise<unknown> { + const joinRoles = await message.guild!.getSetting('joinRoles'); + const newValue = util.addOrRemoveFromArray(joinRoles.includes(role.id) ? 'remove' : 'add', joinRoles, role.id); await message.guild!.setSetting('joinRoles', newValue); return await message.util.reply({ - content: `${util.emojis.success} Successfully ${ - autoPublishChannels.includes(channel.id) ? 'disabled' : 'enabled' - } auto publishing in <#${channel.id}>.`, + content: `${util.emojis.success} Successfully ${joinRoles.includes(role.id) ? 'removed' : 'added'} <@&${ + role.id + }> from being assigned to members when they join the server.`, allowedMentions: AllowedMentions.none() }); } |