diff options
| author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-31 18:45:23 -0400 |
|---|---|---|
| committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-31 18:45:23 -0400 |
| commit | a47ef150fd38fff3666faccd6f976f660fdbf9f3 (patch) | |
| tree | 3f73c3d03236b09bf824469791f4ef7d2016b0b7 /src/commands/config | |
| parent | 9aa46f79516c0c044742339c59d471b43060d84f (diff) | |
| download | tanzanite-a47ef150fd38fff3666faccd6f976f660fdbf9f3.tar.gz tanzanite-a47ef150fd38fff3666faccd6f976f660fdbf9f3.tar.bz2 tanzanite-a47ef150fd38fff3666faccd6f976f660fdbf9f3.zip | |
cleanup and deprecated old config commands
Diffstat (limited to 'src/commands/config')
| -rw-r--r-- | src/commands/config/autoPublishChannel.ts | 48 | ||||
| -rw-r--r-- | src/commands/config/features.ts | 3 | ||||
| -rw-r--r-- | src/commands/config/joinRoles.ts | 39 | ||||
| -rw-r--r-- | src/commands/config/muteRole.ts | 34 | ||||
| -rw-r--r-- | src/commands/config/prefix.ts | 43 | ||||
| -rw-r--r-- | src/commands/config/punishmentFooter.ts | 39 | ||||
| -rw-r--r-- | src/commands/config/welcomeChannel.ts | 38 |
7 files changed, 31 insertions, 213 deletions
diff --git a/src/commands/config/autoPublishChannel.ts b/src/commands/config/autoPublishChannel.ts index a58f32f..d691a7f 100644 --- a/src/commands/config/autoPublishChannel.ts +++ b/src/commands/config/autoPublishChannel.ts @@ -1,59 +1,23 @@ -import { AllowedMentions, BushCommand, BushMessage } from '@lib'; -import { Channel } from 'discord.js'; +import { BushCommand, BushMessage } from '@lib'; export default class AutoPublishChannelCommand extends BushCommand { public constructor() { - super('autopublishchannel', { + super('autoPublishChannel', { aliases: ['autopublishchannel', 'apc', 'publishchannel', 'autopublishchannels', 'publishchannels', 'autopublish'], category: 'config', description: { - content: 'A command to add/remove channels from being automatically published.', + content: 'This command has been deprecated, please use the config command instead', usage: 'autopublishchannel <channel>', examples: ['autopublishchannel #github'] }, - args: [ - { - id: 'channel', - type: 'channel', - match: 'content', - prompt: { - start: 'What channel would you like to toggle auto publishing in?', - retry: '{error} Choose a valid channel.', - optional: false - } - } - ], - slash: true, - slashOptions: [ - { - name: 'channel', - description: 'What channel would you like me to send welcome messages in?', - type: 'CHANNEL', - required: true - } - ], channel: 'guild', + hidden: true, clientPermissions: ['SEND_MESSAGES'], userPermissions: ['MANAGE_GUILD', 'SEND_MESSAGES'] }); } - public override async exec(message: BushMessage, { channel }: { channel: Channel }): Promise<unknown> { - const autoPublishChannels = await message.guild!.getSetting('autoPublishChannels'); - const newValue = util.addOrRemoveFromArray( - autoPublishChannels.includes(channel.id) ? 'remove' : 'add', - autoPublishChannels, - channel.id - ); - await message.guild!.setSetting('autoPublishChannels', newValue); - client.logger.debugRaw(autoPublishChannels); - client.logger.debugRaw(channel.id); - client.logger.debugRaw(autoPublishChannels.includes(channel.id)); - return await message.util.reply({ - content: `${util.emojis.success} Successfully ${ - autoPublishChannels.includes(channel.id) ? 'enabled' : 'disabled' - } auto publishing in <#${channel.id}>.`, - allowedMentions: AllowedMentions.none() - }); + public override async exec(message: BushMessage): Promise<unknown> { + return message.util.reply(`${util.emojis.error} 'This command has been deprecated, please use the config command instead'`); } } diff --git a/src/commands/config/features.ts b/src/commands/config/features.ts index 9a5fa5b..7a7c3bb 100644 --- a/src/commands/config/features.ts +++ b/src/commands/config/features.ts @@ -14,8 +14,7 @@ export default class FeaturesCommand extends BushCommand { slash: true, channel: 'guild', clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], - userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'], - ownerOnly: true + userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'] }); } public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { diff --git a/src/commands/config/joinRoles.ts b/src/commands/config/joinRoles.ts index 0b9ac21..2a3031e 100644 --- a/src/commands/config/joinRoles.ts +++ b/src/commands/config/joinRoles.ts @@ -1,5 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { Role } from 'discord.js'; +import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; export default class JoinRolesCommand extends BushCommand { public constructor() { @@ -7,46 +6,18 @@ export default class JoinRolesCommand extends BushCommand { aliases: ['joinroles', 'joinrole', 'jr'], category: 'config', description: { - content: 'Configure what roles to assign to someone when they join the server.', + content: 'This command has been deprecated, please use the config command instead', usage: 'joinroles <role>', examples: ['joinroles @member'] }, - args: [ - { - id: 'role', - type: 'role', - prompt: { - start: 'What role would you like me to assign to users when they join the server?', - retry: '{error} Choose a valid role', - optional: true - } - } - ], - slash: true, - slashOptions: [ - { - name: 'role', - description: 'What role would you like me to assign to users when they join the server?', - type: 'ROLE', - required: false - } - ], channel: 'guild', + hidden: true, clientPermissions: ['SEND_MESSAGES'], userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'] }); } - public override async exec(message: BushMessage | BushSlashMessage, { role }: { role: Role }): Promise<unknown> { - const joinRoles = await message.guild!.getSetting('joinRoles'); - const includes = joinRoles.includes(role.id); - const newValue = util.addOrRemoveFromArray(includes ? 'remove' : 'add', joinRoles, role.id); - await message.guild!.setSetting('joinRoles', newValue); - return await message.util.reply({ - 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() - }); + public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + return message.util.reply(`${util.emojis.error} 'This command has been deprecated, please use the config command instead'`); } } diff --git a/src/commands/config/muteRole.ts b/src/commands/config/muteRole.ts index c7a6e75..6d3c9f6 100644 --- a/src/commands/config/muteRole.ts +++ b/src/commands/config/muteRole.ts @@ -1,5 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { Role } from 'discord.js'; +import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; export default class MuteRoleCommand extends BushCommand { public constructor() { @@ -7,41 +6,18 @@ export default class MuteRoleCommand extends BushCommand { aliases: ['muterole'], category: 'config', description: { - content: 'Configure what role to use when muting users.', + content: 'This command has been deprecated, please use the config command instead', usage: 'muterole <role>', examples: ['muterole 748912426581229690'] }, - args: [ - { - id: 'role', - type: 'role', - prompt: { - start: "What would you like to set the server's mute role to?", - retry: '{error} Choose a valid role.', - optional: false - } - } - ], - slash: true, - slashOptions: [ - { - name: 'role', - description: "What would you like to set the server's mute role to?", - type: 'ROLE', - required: true - } - ], channel: 'guild', + hidden: true, clientPermissions: ['SEND_MESSAGES'], userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'] }); } - override async exec(message: BushMessage | BushSlashMessage, args: { role: Role }): Promise<void> { - await message.guild!.setSetting('muteRole', args.role.id); - await message.util.send({ - content: `${util.emojis.success} Changed the server's mute role to <@&${args.role.id}>.`, - allowedMentions: AllowedMentions.none() - }); + override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + return message.util.reply(`${util.emojis.error} 'This command has been deprecated, please use the config command instead'`); } } diff --git a/src/commands/config/prefix.ts b/src/commands/config/prefix.ts index 9d707e0..5cd75b3 100644 --- a/src/commands/config/prefix.ts +++ b/src/commands/config/prefix.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; export default class PrefixCommand extends BushCommand { public constructor() { @@ -6,51 +6,18 @@ export default class PrefixCommand extends BushCommand { aliases: ['prefix'], category: 'config', description: { - content: 'Set or reset the prefix for the server.', + content: 'This command has been deprecated, please use the config command instead', usage: 'prefix [prefix]', examples: ['prefix', 'prefix -'] }, - args: [ - { - id: 'prefix', - type: 'string', - prompt: { - start: 'What would you like the new prefix to be?', - retry: '{error} Choose a valid prefix', - optional: true - } - } - ], - slash: true, - slashOptions: [ - { - name: 'prefix', - description: 'What would you like the new prefix to be?', - type: 'STRING', - required: false - } - ], channel: 'guild', + hidden: true, clientPermissions: ['SEND_MESSAGES'], userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'] }); } - override async exec(message: BushMessage | BushSlashMessage, args: { prefix?: string }): Promise<unknown> { - const oldPrefix = await message.guild!.getSetting('prefix'); - await message.guild!.setSetting('prefix', args.prefix ?? client.config.prefix); - if (args.prefix) { - return await message.util.send({ - content: `${util.emojis.success} changed the server's prefix ${oldPrefix ? `from \`${oldPrefix}\`` : ''} to \`${ - args.prefix - }\`.`, - allowedMentions: AllowedMentions.none() - }); - } else { - return await message.util.send({ - content: `${util.emojis.success} reset the server's prefix to \`${client.config.prefix}\`.`, - allowedMentions: AllowedMentions.none() - }); - } + override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + return message.util.reply(`${util.emojis.error} 'This command has been deprecated, please use the config command instead'`); } } diff --git a/src/commands/config/punishmentFooter.ts b/src/commands/config/punishmentFooter.ts index d07ce4f..79e3df3 100644 --- a/src/commands/config/punishmentFooter.ts +++ b/src/commands/config/punishmentFooter.ts @@ -1,5 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { Util } from 'discord.js'; +import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; export default class PunishmentFooterCommand extends BushCommand { public constructor() { @@ -7,46 +6,18 @@ export default class PunishmentFooterCommand extends BushCommand { aliases: ['punishmentfooter'], category: 'config', description: { - content: 'Configure or reset what should follow all punishment related dms.', + content: 'This command has been deprecated, please use the config command instead', usage: 'punishmentfooter [message]', examples: ['punishmentfooter', 'prefix you can appeal at https://example.com.'] }, - args: [ - { - id: 'ending', - type: 'string', - match: 'restContent', - prompt: { - start: 'What message would you like to follow punishment dms?', - retry: '{error} Choose a valid role.', - optional: true - } - } - ], - slash: true, - slashOptions: [ - { - name: 'ending', - description: 'What message would you like to follow punishment dms?', - type: 'STRING', - required: false - } - ], channel: 'guild', + hidden: true, clientPermissions: ['SEND_MESSAGES'], userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'] }); } - override async exec(message: BushMessage | BushSlashMessage, args: { ending: string }): Promise<unknown> { - await message.guild!.setSetting('punishmentEnding', args.ending || ''); - if (args.ending) - return await message.util.send({ - content: `${util.emojis.success} Changed the server's punishment footer to \n\`\`\`${Util.cleanCodeBlockContent( - args.ending - )}\`\`\`.`, - allowedMentions: AllowedMentions.none() - }); - else return await message.util.send(`${util.emojis.success} Removed he server's punishment footer.`); + override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + return message.util.reply(`${util.emojis.error} 'This command has been deprecated, please use the config command instead'`); } } diff --git a/src/commands/config/welcomeChannel.ts b/src/commands/config/welcomeChannel.ts index fc56607..c94b416 100644 --- a/src/commands/config/welcomeChannel.ts +++ b/src/commands/config/welcomeChannel.ts @@ -1,5 +1,4 @@ import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { Channel } from 'discord.js'; export default class WelcomeChannelCommand extends BushCommand { public constructor() { @@ -7,46 +6,17 @@ export default class WelcomeChannelCommand extends BushCommand { aliases: ['welcomechannel', 'wc'], category: 'config', description: { - content: 'Configure the what channel you want BushBot to send a message in when someone joins the server.', + content: 'This command has been deprecated, please use the config command instead', usage: 'welcomechannel [channel]', examples: ['welcomechannel #welcome'] }, - args: [ - { - id: 'channel', - type: 'channel', - prompt: { - start: 'What channel would you like me to send welcome messages in?', - retry: '{error} Choose a valid channel', - optional: true - } - } - ], - slash: true, - slashOptions: [ - { - name: 'channel', - description: 'What channel would you like me to send welcome messages in?', - type: 'CHANNEL', - required: false - } - ], channel: 'guild', + hidden: true, clientPermissions: ['SEND_MESSAGES'], userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'] }); } - public override async exec(message: BushMessage | BushSlashMessage, args: { channel: Channel }): Promise<unknown> { - const oldChannel = await message.guild!.getSetting('welcomeChannel'); - await message.guild!.setSetting('welcomeChannel', args.channel.id ?? undefined); - if (args.channel) { - return await message.util.send( - `${util.emojis.success} changed the server's welcome channel ${oldChannel ? `from <#${oldChannel}>` : ''} to <#${ - args.channel.id - }>.` - ); - } else { - return await message.util.send(`${util.emojis.success} removed the server's welcome channel.`); - } + public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + return message.util.reply(`${util.emojis.error} 'This command has been deprecated, please use the config command instead'`); } } |
