aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/dev')
-rw-r--r--src/commands/dev/__template.ts4
-rw-r--r--src/commands/dev/dm.ts17
-rw-r--r--src/commands/dev/say.ts2
-rw-r--r--src/commands/dev/superUser.ts7
4 files changed, 14 insertions, 16 deletions
diff --git a/src/commands/dev/__template.ts b/src/commands/dev/__template.ts
index 4341198..11d9649 100644
--- a/src/commands/dev/__template.ts
+++ b/src/commands/dev/__template.ts
@@ -1,4 +1,4 @@
-import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptionalArgType } from '#lib';
export default class TemplateCommand extends BushCommand {
public constructor() {
@@ -39,7 +39,7 @@ export default class TemplateCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- args: { required_argument: string; optional_argument: string }
+ args: { required_argument: ArgType<'string'>; optional_argument: OptionalArgType<'string'> }
) {
return await message.util.reply(`${util.emojis.error} Do not use the template command.`);
args;
diff --git a/src/commands/dev/dm.ts b/src/commands/dev/dm.ts
index 4133b96..d702875 100644
--- a/src/commands/dev/dm.ts
+++ b/src/commands/dev/dm.ts
@@ -1,4 +1,4 @@
-import { ArgType, BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
export default class DMCommand extends BushCommand {
public constructor() {
@@ -21,10 +21,9 @@ 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.',
- optional: true,
+ description: 'The content to send to the user.',
+ prompt: 'What would you like to send to the user?',
+ retry: '{error} Pick something to send the user.',
slashType: 'STRING'
}
],
@@ -35,10 +34,12 @@ export default class DMCommand extends BushCommand {
userPermissions: []
});
}
- public override async exec(message: BushMessage | BushSlashMessage, args: { user: ArgType<'user'>; content: string }) {
+ public override async exec(
+ message: BushMessage | BushSlashMessage,
+ args: { user: ArgType<'user'>; content: ArgType<'string'> }
+ ) {
try {
- const u = await client.users.fetch(args.user.id);
- await u.send(args.content);
+ await client.users.send(args.user.id, args.content);
} catch (e) {
return message.util.reply(`${util.emojis.error} There was an error sending ${util.format.input(args.user.tag)} a dm.`);
}
diff --git a/src/commands/dev/say.ts b/src/commands/dev/say.ts
index 80cbbe2..2c8151f 100644
--- a/src/commands/dev/say.ts
+++ b/src/commands/dev/say.ts
@@ -26,7 +26,7 @@ export default class SayCommand extends BushCommand {
});
}
- public override async exec(message: BushMessage, args: { content: string }) {
+ public override async exec(message: BushMessage | BushSlashMessage, args: { content: string }) {
if (!message.author.isOwner())
return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`);
diff --git a/src/commands/dev/superUser.ts b/src/commands/dev/superUser.ts
index 35e98aa..3a6406d 100644
--- a/src/commands/dev/superUser.ts
+++ b/src/commands/dev/superUser.ts
@@ -1,4 +1,4 @@
-import { ArgType, BushCommand, Global, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushCommand, Global, type ArgType, type BushMessage } from '#lib';
import { type ArgumentOptions, type Flag } from 'discord-akairo';
export default class SuperUserCommand extends BushCommand {
@@ -53,10 +53,7 @@ export default class SuperUserCommand extends BushCommand {
return { action, user };
}
- public override async exec(
- message: BushMessage | BushSlashMessage,
- { action, user }: { action: 'add' | 'remove'; user: ArgType<'user'> }
- ) {
+ public override async exec(message: BushMessage, { 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.`);