Skip to content

Commit b01fc76

Browse files
authored
Merge pull request #86 from underctrl-io/rewrite
feat!: rewrite commandkit
2 parents 662fba2 + 2107673 commit b01fc76

File tree

92 files changed

+2582
-2667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2582
-2667
lines changed

apps/test-bot/commandkit.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
import { defineConfig } from 'commandkit';
22

3-
export default defineConfig({
4-
main: 'index.js',
5-
src: 'src',
6-
});
3+
export default defineConfig();

apps/test-bot/src/app.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Client } from 'discord.js';
2+
3+
const client = new Client({
4+
intents: ['Guilds', 'GuildMembers', 'GuildMessages', 'MessageContent'],
5+
});
6+
7+
export default client;

apps/test-bot/src/commands/misc/dm-only.ts renamed to 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/commands/misc/giveaway.ts renamed to 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/commands/misc/guild-only.ts renamed to 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/commands/misc/reload.ts renamed to 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/commands/misc/run-after.ts renamed to 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
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)