Skip to content

Commit 5803ad9

Browse files
committed
feat: improvements to the cli
1 parent 2d0e9a4 commit 5803ad9

File tree

33 files changed

+1055
-97
lines changed

33 files changed

+1055
-97
lines changed

apps/test-bot/src/app/commands/(actions)/dm-only.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { SlashCommandProps, CommandData, dmOnly } from 'commandkit';
22

3-
export const data: CommandData = {
3+
export const command: CommandData = {
44
name: 'dm-only',
55
description: 'This is a dm only command',
66
};
77

8-
export async function run({ interaction }: SlashCommandProps) {
8+
export async function chatInput({ interaction }: SlashCommandProps) {
99
dmOnly();
1010

1111
await interaction.reply('This command can only be used in a dm.');

apps/test-bot/src/app/commands/(actions)/giveaway.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
AutocompleteProps,
1212
} from 'commandkit';
1313

14-
export const data: CommandData = {
14+
export const command: CommandData = {
1515
name: 'ping',
1616
description: 'Pong!',
1717
options: [
@@ -42,7 +42,7 @@ export async function autocomplete({ interaction }: AutocompleteProps) {
4242
interaction.respond(filtered);
4343
}
4444

45-
export async function run({ interaction, client }: SlashCommandProps) {
45+
export async function chatInput({ interaction, client }: SlashCommandProps) {
4646
if (!interaction.channel) return;
4747

4848
const button = new ButtonKit()

apps/test-bot/src/app/commands/(actions)/guild-only.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { SlashCommandProps, CommandData, guildOnly } from 'commandkit';
22

3-
export const data: CommandData = {
3+
export const command: CommandData = {
44
name: 'guild-only',
55
description: 'This is a guild only command.',
66
};
77

8-
export async function run({ interaction }: SlashCommandProps) {
8+
export async function chatInput({ interaction }: SlashCommandProps) {
99
guildOnly();
1010

1111
await interaction.reply('This command can only be used in a guild.');

apps/test-bot/src/app/commands/(developer)/reload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { SlashCommandProps, CommandOptions, CommandData } from 'commandkit';
22

3-
export const data: CommandData = {
3+
export const command: CommandData = {
44
name: 'reload',
55
description: 'Reload commands, events, and validations.',
66
};
77

8-
export async function run({ interaction, handler }: SlashCommandProps) {
8+
export async function chatInput({ interaction, handler }: SlashCommandProps) {
99
await interaction.deferReply({ ephemeral: true });
1010

1111
// await handler.reloadCommands();

apps/test-bot/src/app/commands/(developer)/run-after.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { SlashCommandProps, CommandData, afterCommand } from 'commandkit';
22

3-
export const data: CommandData = {
3+
export const command: CommandData = {
44
name: 'run-after',
55
description: 'This is a run-after command',
66
};
77

8-
export async function run({ interaction }: SlashCommandProps) {
8+
export async function chatInput({ interaction }: SlashCommandProps) {
99
afterCommand((env) => {
1010
console.log(
1111
`The command ${interaction.commandName} was executed successfully in ${env

apps/test-bot/src/app/commands/(general)/help.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { SlashCommandProps, CommandData } from 'commandkit';
22

3-
export const data: CommandData = {
3+
export const command: CommandData = {
44
name: 'help',
55
description: 'This is a help command.',
66
};
@@ -12,7 +12,7 @@ function $botVersion(): string {
1212
return require(path).version;
1313
}
1414

15-
export async function run({ interaction, handler }: SlashCommandProps) {
15+
export async function chatInput({ interaction, handler }: SlashCommandProps) {
1616
await interaction.deferReply();
1717

1818
const botVersion = $botVersion();

apps/test-bot/src/app/commands/(general)/ping.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
AutocompleteProps,
1212
} from 'commandkit';
1313

14-
export const data: CommandData = {
14+
export const command: CommandData = {
1515
name: 'ping',
1616
description: 'Pong!',
1717
options: [
@@ -42,7 +42,7 @@ export async function autocomplete({ interaction }: AutocompleteProps) {
4242
interaction.respond(filtered);
4343
}
4444

45-
export async function run({ interaction, client }: SlashCommandProps) {
45+
export async function chatInput({ interaction, client }: SlashCommandProps) {
4646
if (!interaction.channel) return;
4747

4848
const button = new ButtonKit()

apps/test-bot/src/app/commands/(interactions)/commandkit.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import CommandKit, {
77
} from 'commandkit';
88
import { MessageFlags } from 'discord.js';
99

10-
export const data: CommandData = {
10+
export const command: CommandData = {
1111
name: 'commandkit',
1212
description: 'This is a commandkit command.',
1313
};
@@ -40,7 +40,7 @@ function ButtonGrid() {
4040
);
4141
}
4242

43-
export async function run({ interaction }: SlashCommandProps) {
43+
export async function chatInput({ interaction }: SlashCommandProps) {
4444
await interaction.deferReply();
4545

4646
await interaction.editReply({

apps/test-bot/src/app/commands/(interactions)/confirmation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import CommandKit, {
77
} from 'commandkit';
88
import { ButtonStyle, MessageFlags } from 'discord.js';
99

10-
export const data: CommandData = {
10+
export const command: CommandData = {
1111
name: 'confirm',
1212
description: 'This is a confirm command.',
1313
};
@@ -30,7 +30,7 @@ const handleCancel: OnButtonKitClick = async (interaction, context) => {
3030
context.dispose();
3131
};
3232

33-
export async function run({ interaction }: SlashCommandProps) {
33+
export async function chatInput({ interaction }: SlashCommandProps) {
3434
const buttons = (
3535
<ActionRow>
3636
<Button onClick={handleCancel} style={ButtonStyle.Primary}>

apps/test-bot/src/app/commands/(leveling)/xp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SlashCommandProps, CommandData, cacheTag } from 'commandkit';
22
import { database } from '../../../database/store.ts';
33

4-
export const data: CommandData = {
4+
export const command: CommandData = {
55
name: 'xp',
66
description: 'This is an xp command.',
77
};
@@ -17,7 +17,7 @@ async function getUserXP(guildId: string, userId: string) {
1717
return xp;
1818
}
1919

20-
export async function run({ interaction }: SlashCommandProps) {
20+
export async function chatInput({ interaction }: SlashCommandProps) {
2121
await interaction.deferReply();
2222

2323
const dataRetrievalStart = Date.now();

0 commit comments

Comments
 (0)