diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-26 20:07:19 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-26 20:07:19 -0400 |
commit | ed59b7f1827ab93573b079144c3eeaa01ce40492 (patch) | |
tree | 7ceac6d61a8a25586ab9bbaf7acfbade91c97132 /src/commands/config | |
parent | c0a81b014a56e4d44c826f78391a930361aab122 (diff) | |
download | tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.gz tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.bz2 tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.zip |
clean up, bug fixes
Diffstat (limited to 'src/commands/config')
-rw-r--r-- | src/commands/config/blacklist.ts | 11 | ||||
-rw-r--r-- | src/commands/config/config.ts | 10 | ||||
-rw-r--r-- | src/commands/config/customAutomodPhrases.ts | 4 | ||||
-rw-r--r-- | src/commands/config/disable.ts | 4 | ||||
-rw-r--r-- | src/commands/config/features.ts | 4 | ||||
-rw-r--r-- | src/commands/config/levelRoles.ts | 2 | ||||
-rw-r--r-- | src/commands/config/log.ts | 7 |
7 files changed, 19 insertions, 23 deletions
diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts index ef0c94e..d6d7c18 100644 --- a/src/commands/config/blacklist.ts +++ b/src/commands/config/blacklist.ts @@ -9,7 +9,7 @@ export default class BlacklistCommand extends BushCommand { category: 'config', description: { content: 'A command to blacklist users and channels.', - usage: 'blacklist|unblacklist <user|channel>', + usage: ['blacklist|unblacklist <user|channel>'], examples: ['blacklist @user', 'unblacklist #channel'] }, args: [ @@ -18,8 +18,7 @@ export default class BlacklistCommand extends BushCommand { customType: Argument.union('channel', 'user'), prompt: { start: 'What channel or user that you would like to blacklist/unblacklist?', - retry: '{error} Pick a valid command.', - optional: false + retry: '{error} Pick a valid user or channel.' } }, { @@ -56,7 +55,7 @@ export default class BlacklistCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, args: { action: 'blacklist' | 'unblacklist'; target: Channel | User | string; global: boolean } - ): Promise<unknown> { + ) { let action: 'blacklist' | 'unblacklist' | 'toggle' = args.action ?? (message?.util?.parsed?.alias as 'blacklist' | 'unblacklist') ?? 'toggle'; const global = args.global && message.author.isOwner(); @@ -92,9 +91,7 @@ export default class BlacklistCommand extends BushCommand { }); else return await message.util.reply({ - content: `${util.emojis.success} Successfully **${action}ed** ${util.format.bold( - target?.tag ?? target.name - )} globally.`, + content: `${util.emojis.success} Successfully ${action}ed ${util.format.bold(target?.tag ?? target.name)} globally.`, allowedMentions: AllowedMentions.none() }); // guild disable diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts index 0fdd615..0ca8ef8 100644 --- a/src/commands/config/config.ts +++ b/src/commands/config/config.ts @@ -24,9 +24,11 @@ export default class SettingsCommand extends BushCommand { category: 'config', description: { content: 'Configure server settings.', - usage: `settings (${settingsArr.map((s) => `\`${s}\``).join(', ')}) (${['view', 'set', 'add', 'remove'].map( - (s) => `\`${s}\`` - )})`, + usage: [ + `settings (${settingsArr.map((s) => `\`${s}\``).join(', ')}) (${['view', 'set', 'add', 'remove'].map( + (s) => `\`${s}\`` + )})` + ], examples: ['settings', 'config prefix set -'] }, slash: true, @@ -181,7 +183,7 @@ export default class SettingsCommand extends BushCommand { subcommand?: Action; value: string | Channel | Role; } - ): Promise<unknown> { + ) { if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be used in servers.`); if (!message.member?.permissions.has('MANAGE_GUILD') && !message.member?.user.isOwner()) return await message.util.reply( diff --git a/src/commands/config/customAutomodPhrases.ts b/src/commands/config/customAutomodPhrases.ts index 51e219a..e02d52b 100644 --- a/src/commands/config/customAutomodPhrases.ts +++ b/src/commands/config/customAutomodPhrases.ts @@ -7,7 +7,7 @@ // category: 'config', // description: { // content: 'Configure additional phrases to be used for automod.', -// usage: 'custom-automod-phrases <requiredArg> [optionalArg]', +// usage: ['custom-automod-phrases <requiredArg> [optionalArg]'], // examples: ['custom-automod-phrases 1 2'] // }, // args: [ @@ -57,7 +57,7 @@ // public override async exec( // message: BushMessage | BushSlashMessage, // args: { required_argument: string; optional_argument: string } -// ): Promise<unknown> { +// ) { // return await message.util.reply(`${util.emojis.error} Do not use the template command.`); // args; // } diff --git a/src/commands/config/disable.ts b/src/commands/config/disable.ts index bca1207..2e3ce74 100644 --- a/src/commands/config/disable.ts +++ b/src/commands/config/disable.ts @@ -7,7 +7,7 @@ export default class DisableCommand extends BushCommand { category: 'config', description: { content: 'A command to disable and enable commands.', - usage: 'disable|enable <command>', + usage: ['disable|enable <command>'], examples: ['enable ban', 'disable kick'] }, args: [ @@ -62,7 +62,7 @@ export default class DisableCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, args: { action: 'enable' | 'disable'; command: BushCommand | string; global: boolean } - ): Promise<unknown> { + ) { let action = (args.action ?? message?.util?.parsed?.alias ?? 'toggle') as 'disable' | 'enable' | 'toggle'; const global = args.global && message.author.isOwner(); const commandID = (args.command as BushCommand).id; diff --git a/src/commands/config/features.ts b/src/commands/config/features.ts index 3c3075c..8285845 100644 --- a/src/commands/config/features.ts +++ b/src/commands/config/features.ts @@ -8,7 +8,7 @@ export default class FeaturesCommand extends BushCommand { category: 'config', description: { content: 'Toggle features the server.', - usage: 'features', + usage: ['features'], examples: ['features'] }, slash: true, @@ -18,7 +18,7 @@ export default class FeaturesCommand extends BushCommand { }); } - public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage) { if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be used in servers.`); const featureEmbed = new MessageEmbed().setTitle(`${message.guild!.name}'s Features`).setColor(util.colors.default); diff --git a/src/commands/config/levelRoles.ts b/src/commands/config/levelRoles.ts index ee5f255..c8f0bf3 100644 --- a/src/commands/config/levelRoles.ts +++ b/src/commands/config/levelRoles.ts @@ -58,7 +58,7 @@ // public override async exec( // message: BushMessage | BushSlashMessage, // args: { required_argument: string; optional_argument: string } -// ): Promise<unknown> { +// ) { // return await message.util.reply(`${util.emojis.error} Do not use the template command.`); // args; // } diff --git a/src/commands/config/log.ts b/src/commands/config/log.ts index 363620a..c364a35 100644 --- a/src/commands/config/log.ts +++ b/src/commands/config/log.ts @@ -9,7 +9,7 @@ export default class LogCommand extends BushCommand { category: 'config', description: { content: 'Set or remove a log channel.', - usage: 'log <logType> [channel]', + usage: ['log <logType> [channel]'], examples: ['log automod #automod-logs'] }, slash: true, @@ -60,10 +60,7 @@ export default class LogCommand extends BushCommand { return { log_type, channel }; } - public override async exec( - message: BushMessage | BushSlashMessage, - args: { log_type: GuildLogType; channel: TextChannel } - ): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage, args: { log_type: GuildLogType; channel: TextChannel }) { if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be used in servers.`); const currentLogs = await message.guild.getSetting('logChannels'); const oldChannel = currentLogs[args.log_type] ?? undefined; |