aboutsummaryrefslogtreecommitdiff
path: root/src/commands/config
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-12-29 16:15:06 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-12-29 16:15:06 -0500
commit08d7e6eb125c5ff6846c3a92491de79d291b8e12 (patch)
tree4abdaeee3ad258ef8fa0d7b517ea49d262d18b0b /src/commands/config
parentf9cf43fc47be2d497d92d728ea892246df96d736 (diff)
downloadtanzanite-08d7e6eb125c5ff6846c3a92491de79d291b8e12.tar.gz
tanzanite-08d7e6eb125c5ff6846c3a92491de79d291b8e12.tar.bz2
tanzanite-08d7e6eb125c5ff6846c3a92491de79d291b8e12.zip
misc improvements & typings changes
Diffstat (limited to 'src/commands/config')
-rw-r--r--src/commands/config/_customAutomodPhrases.ts (renamed from src/commands/config/customAutomodPhrases.ts)38
-rw-r--r--src/commands/config/_levelRoles.ts (renamed from src/commands/config/levelRoles.ts)38
-rw-r--r--src/commands/config/blacklist.ts13
3 files changed, 27 insertions, 62 deletions
diff --git a/src/commands/config/customAutomodPhrases.ts b/src/commands/config/_customAutomodPhrases.ts
index cf37595..cd59c9a 100644
--- a/src/commands/config/customAutomodPhrases.ts
+++ b/src/commands/config/_customAutomodPhrases.ts
@@ -12,37 +12,22 @@
// {
// id: 'required_argument',
// type: 'string',
-// prompt: {
-// start: 'What would you like to set your first argument to be?',
-// retry: '{error} Pick a valid argument.',
-// optional: false
-// }
+// description: 'This is the first argument.',
+// prompt: 'What would you like to set your first argument to be?',
+// retry: '{error} Pick a valid argument.',
+// slashType: 'STRING'
// },
// {
// id: 'optional_argument',
// type: 'string',
-// prompt: {
-// start: 'What would you like to set your second argument to be?',
-// retry: '{error} Pick a valid argument.',
-// optional: true
-// }
+// description: 'This is the second argument.',
+// prompt: 'What would you like to set your second argument to be?',
+// retry: '{error} Pick a valid argument.',
+// optional: true,
+// slashType: 'STRING'
// }
// ],
// slash: true,
-// slashOptions: [
-// {
-// name: 'required_argument',
-// description: 'What would you like to set your first argument to be?',
-// type: 'STRING',
-// required: true
-// },
-// {
-// name: 'optional_argument',
-// description: 'What would you like to set your second argument to be?',
-// type: 'STRING',
-// required: false
-// }
-// ],
// channel: 'guild',
// clientPermissions: (m) => util.clientSendAndPermCheck(m),
// userPermissions: ['MANAGE_GUILD']
@@ -52,8 +37,5 @@
// public override async exec(
// message: BushMessage | BushSlashMessage,
// args: { required_argument: string; optional_argument: string }
-// ) {
-// return await message.util.reply(`${util.emojis.error} Do not use the template command.`);
-// args;
-// }
+// ) {}
// }
diff --git a/src/commands/config/levelRoles.ts b/src/commands/config/_levelRoles.ts
index 7f99580..af7e637 100644
--- a/src/commands/config/levelRoles.ts
+++ b/src/commands/config/_levelRoles.ts
@@ -10,39 +10,24 @@
// examples: ['level-role 1 2'],
// args: [
// {
-// id: 'action',
-// customType: ['add', 'remove']
-// },
-// {
-// id: 'role',
-// type: 'role',
+// id: 'required_argument',
+// type: 'string',
+// description: 'This is the first argument.',
// prompt: 'What would you like to set your first argument to be?',
// retry: '{error} Pick a valid argument.',
-// optional: false
+// slashType: 'STRING'
// },
// {
-// id: 'level',
-// type: 'integer',
+// id: 'optional_argument',
+// type: 'string',
+// description: 'This is the second argument.',
// prompt: 'What would you like to set your second argument to be?',
// retry: '{error} Pick a valid argument.',
-// optional: false
+// optional: true,
+// slashType: 'STRING'
// }
// ],
// slash: true,
-// slashOptions: [
-// {
-// name: 'role',
-// description: 'What would you like to set your first argument to be?',
-// type: 'STRING',
-// required: true
-// },
-// {
-// name: 'level',
-// description: 'What would you like to set your second argument to be?',
-// type: 'STRING',
-// required: true
-// }
-// ],
// channel: 'guild',
// clientPermissions: (m) => util.clientSendAndPermCheck(m),
// userPermissions: ['MANAGE_GUILD', 'MANAGE_ROLES']
@@ -52,8 +37,5 @@
// public override async exec(
// message: BushMessage | BushSlashMessage,
// args: { required_argument: string; optional_argument: string }
-// ) {
-// return await message.util.reply(`${util.emojis.error} Do not use the template command.`);
-// args;
-// }
+// ) {}
// }
diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts
index d119774..d15b8d7 100644
--- a/src/commands/config/blacklist.ts
+++ b/src/commands/config/blacklist.ts
@@ -1,4 +1,4 @@
-import { AllowedMentions, ArgType, BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { AllowedMentions, BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
import { User } from 'discord.js';
export default class BlacklistCommand extends BushCommand {
@@ -16,10 +16,7 @@ export default class BlacklistCommand extends BushCommand {
readableType: "'blacklist'|'unblacklist'",
prompt: 'Would you like to add or remove someone or something from/to the blacklist?',
slashType: 'STRING',
- choices: [
- { name: 'blacklist', value: 'blacklist' },
- { name: 'unblacklist', value: 'unblacklist' }
- ],
+ choices: ['blacklist', 'unblacklist'].map((c) => ({ name: c, value: c })),
only: 'slash'
},
{
@@ -51,7 +48,11 @@ export default class BlacklistCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- args: { action?: 'blacklist' | 'unblacklist'; target: ArgType<'channel'> | ArgType<'user'> | string; global: boolean }
+ args: {
+ action?: 'blacklist' | 'unblacklist';
+ target: ArgType<'channel'> | ArgType<'user'> | string; // there is no way to combine channel and user in slash commands without making subcommands
+ global: ArgType<'boolean'>;
+ }
) {
let action: 'blacklist' | 'unblacklist' | 'toggle' =
args.action ?? (message?.util?.parsed?.alias as 'blacklist' | 'unblacklist' | undefined) ?? 'toggle';