diff options
Diffstat (limited to 'src/commands/dev')
-rw-r--r-- | src/commands/dev/__template.ts | 1 | ||||
-rw-r--r-- | src/commands/dev/dm.ts | 7 | ||||
-rw-r--r-- | src/commands/dev/eval.ts | 4 | ||||
-rw-r--r-- | src/commands/dev/javascript.ts | 4 | ||||
-rw-r--r-- | src/commands/dev/superUser.ts | 5 |
5 files changed, 11 insertions, 10 deletions
diff --git a/src/commands/dev/__template.ts b/src/commands/dev/__template.ts index 5bb29c8..4341198 100644 --- a/src/commands/dev/__template.ts +++ b/src/commands/dev/__template.ts @@ -36,6 +36,7 @@ export default class TemplateCommand extends BushCommand { userPermissions: [] }); } + public override async exec( message: BushMessage | BushSlashMessage, args: { required_argument: string; optional_argument: string } diff --git a/src/commands/dev/dm.ts b/src/commands/dev/dm.ts index 5031dfd..4133b96 100644 --- a/src/commands/dev/dm.ts +++ b/src/commands/dev/dm.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushUser, type BushMessage, type BushSlashMessage } from '#lib'; +import { ArgType, BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; export default class DMCommand extends BushCommand { public constructor() { @@ -11,7 +11,7 @@ export default class DMCommand extends BushCommand { args: [ { id: 'user', - type: 'string', + type: 'user', description: 'The user to send the dm to.', prompt: 'Who would you like to dm?', retry: '{error} Pick a valid user to send a dm to.', @@ -20,6 +20,7 @@ export default class DMCommand extends BushCommand { { id: 'content', type: 'string', + match: 'rest', description: 'This is the second argument.', prompt: 'What would you like to set your second argument to be?', retry: '{error} Pick a valid argument.', @@ -34,7 +35,7 @@ export default class DMCommand extends BushCommand { userPermissions: [] }); } - public override async exec(message: BushMessage | BushSlashMessage, args: { user: BushUser; content: string }) { + public override async exec(message: BushMessage | BushSlashMessage, args: { user: ArgType<'user'>; content: string }) { try { const u = await client.users.fetch(args.user.id); await u.send(args.content); diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts index 2393a9b..f97f00d 100644 --- a/src/commands/dev/eval.ts +++ b/src/commands/dev/eval.ts @@ -1,4 +1,4 @@ -import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; +import { ArgType, BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; import { exec } from 'child_process'; import { MessageEmbed as _MessageEmbed } from 'discord.js'; import ts from 'typescript'; @@ -119,7 +119,7 @@ export default class EvalCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, args: { - sel_depth: number; + sel_depth: ArgType<'integer'>; code: string; sudo: boolean; silent: boolean; diff --git a/src/commands/dev/javascript.ts b/src/commands/dev/javascript.ts index d832c09..2a6a87b 100644 --- a/src/commands/dev/javascript.ts +++ b/src/commands/dev/javascript.ts @@ -1,4 +1,4 @@ -import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; +import { ArgType, BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; import { MessageEmbed } from 'discord.js'; import { VM } from 'vm2'; @@ -51,7 +51,7 @@ export default class JavascriptCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, args: { - sel_depth: number; + sel_depth: ArgType<'integer'>; code: string; } ) { diff --git a/src/commands/dev/superUser.ts b/src/commands/dev/superUser.ts index f38419f..35e98aa 100644 --- a/src/commands/dev/superUser.ts +++ b/src/commands/dev/superUser.ts @@ -1,6 +1,5 @@ -import { BushCommand, Global, type BushMessage, type BushSlashMessage } from '#lib'; +import { ArgType, BushCommand, Global, type BushMessage, type BushSlashMessage } from '#lib'; import { type ArgumentOptions, type Flag } from 'discord-akairo'; -import { type User } from 'discord.js'; export default class SuperUserCommand extends BushCommand { public constructor() { @@ -56,7 +55,7 @@ export default class SuperUserCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, - { action, user }: { action: 'add' | 'remove'; user: User } + { action, user }: { action: 'add' | 'remove'; user: ArgType<'user'> } ) { if (!message.author.isOwner()) return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`); |