Skip to content

Commit 467ac03

Browse files
committed
move test bot to new app directory
1 parent c78f2a4 commit 467ac03

File tree

14 files changed

+41
-42
lines changed

14 files changed

+41
-42
lines changed
File renamed without changes.

apps/test-bot/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

apps/test-bot/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This app is used to test `/packages/commandkit`

apps/test-bot/package.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "test-bot",
3+
"scripts": {
4+
"test": "echo \"Error: no test specified\" && exit 1"
5+
},
6+
"dependencies": {
7+
"commandkit": "workspace:*",
8+
"discord.js": "^14.16.3",
9+
"dotenv": "^16.4.7"
10+
},
11+
"devDependencies": {
12+
"tsx": "^4.7.0"
13+
}
14+
}

packages/commandkit/tests/src/commands/misc/giveaway.ts renamed to apps/test-bot/src/commands/misc/giveaway.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
CommandData,
1010
ButtonKit,
1111
AutocompleteProps,
12-
} from '../../../../src/index';
12+
} from 'commandkit';
1313

1414
export const data: CommandData = {
1515
name: 'ping',

packages/commandkit/tests/src/commands/misc/ping.ts renamed to apps/test-bot/src/commands/misc/ping.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
CommandData,
1010
ButtonKit,
1111
AutocompleteProps,
12-
} from '../../../../dist/index.mjs';
12+
} from 'commandkit';
1313

1414
export const data: CommandData = {
1515
name: 'ping',

packages/commandkit/tests/src/commands/misc/reload.ts renamed to apps/test-bot/src/commands/misc/reload.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
SlashCommandProps,
3-
CommandOptions,
4-
CommandData,
5-
} from '../../../../src/index';
1+
import { SlashCommandProps, CommandOptions, CommandData } from 'commandkit';
62

73
export const data: CommandData = {
84
name: 'reload',

packages/commandkit/tests/src/events/ready/console-log.ts renamed to apps/test-bot/src/events/ready/console-log.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Client } from 'discord.js';
2-
import type { CommandKit } from '../../../../src';
2+
import type { CommandKit } from 'commandkit';
33

44
export default function (c: Client<true>, client, handler: CommandKit) {
55
console.log(`${c.user.username} is online.`);

packages/commandkit/tests/src/index.ts renamed to apps/test-bot/src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { CommandKit } from '../../src/index';
1+
import { CommandKit } from 'commandkit';
22
import { Client } from 'discord.js';
3-
// require('dotenv').config();
3+
import 'dotenv/config';
44

55
const client = new Client({
66
intents: ['Guilds', 'GuildMembers', 'GuildMessages', 'MessageContent'],
@@ -11,7 +11,7 @@ new CommandKit({
1111
commandsPath: `${__dirname}/commands`,
1212
eventsPath: `${__dirname}/events`,
1313
validationsPath: `${__dirname}/validations`,
14-
// devGuildIds: process.env.DEV_GUILD_ID?.split(',') ?? [],
14+
devGuildIds: process.env.DEV_GUILD_ID?.split(',') ?? [],
1515
devUserIds: process.env.DEV_USER_ID?.split(',') ?? [],
1616
bulkRegister: true,
1717
});

packages/commandkit/tests/src/validations/devOnly.ts renamed to apps/test-bot/src/validations/devOnly.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ValidationProps } from '../../../src';
1+
import type { ValidationProps } from 'commandkit';
22

33
export default function ({
44
interaction,

packages/commandkit/src/types.ts

-22
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,34 @@ export interface CommandKitOptions {
2222
* The Discord.js client object to use with CommandKit.
2323
*/
2424
client: Client;
25-
2625
/**
2726
* The path to your commands directory.
2827
*/
2928
commandsPath?: string;
30-
3129
/**
3230
* The path to your events directory.
3331
*/
3432
eventsPath?: string;
35-
3633
/**
3734
* The path to the validations directory.
3835
*/
3936
validationsPath?: string;
40-
4137
/**
4238
* List of development guild IDs to restrict devOnly commands to.
4339
*/
4440
devGuildIds?: string[];
45-
4641
/**
4742
* List of developer user IDs to restrict devOnly commands to.
4843
*/
4944
devUserIds?: string[];
50-
5145
/**
5246
* List of developer role IDs to restrict devOnly commands to.
5347
*/
5448
devRoleIds?: string[];
55-
5649
/**
5750
* Skip CommandKit's built-in validations (for devOnly commands).
5851
*/
5952
skipBuiltInValidations?: boolean;
60-
6153
/**
6254
* Bulk register application commands instead of one-by-one.
6355
*/
@@ -138,12 +130,10 @@ export interface CommandProps {
138130
| UserContextMenuCommandInteraction
139131
| MessageContextMenuCommandInteraction
140132
| AutocompleteInteraction;
141-
142133
/**
143134
* The Discord.js client object that CommandKit is handling.
144135
*/
145136
client: Client<true>;
146-
147137
/**
148138
* The current CommandKit handler instance.
149139
*/
@@ -205,17 +195,14 @@ export interface ValidationProps {
205195
| ChatInputCommandInteraction
206196
| ContextMenuCommandInteraction
207197
| AutocompleteInteraction;
208-
209198
/**
210199
* The Discord.js client object that CommandKit is handling.
211200
*/
212201
client: Client<true>;
213-
214202
/**
215203
* The current (local) target command object.
216204
*/
217205
commandObj: CommandObject;
218-
219206
/**
220207
* The current CommandKit handler instance.
221208
*/
@@ -233,18 +220,15 @@ export interface CommandOptions {
233220
* @deprecated Use `dm_permission` in the command's `data` object instead.
234221
*/
235222
guildOnly?: boolean;
236-
237223
/**
238224
* A boolean indicating whether the command is developer-only.
239225
* Used for registration and built-in validation.
240226
*/
241227
devOnly?: boolean;
242-
243228
/**
244229
* A boolean indicating whether the command is deleted/ignored on restart/reload.
245230
*/
246231
deleted?: boolean;
247-
248232
/**
249233
* A string or array of permissions that a user needs for the current command to be executed.
250234
* Used for built-in validation.
@@ -255,7 +239,6 @@ export interface CommandOptions {
255239
* userPermissions: ['BanMembers', 'KickMembers']
256240
*/
257241
userPermissions?: PermissionsString | PermissionsString[];
258-
259242
/**
260243
* A string or array of permissions that the bot needs to execute the current command.
261244
* Used for built-in validation.
@@ -277,17 +260,14 @@ export type CommandObject = {
277260
* An object which defines the structure of the application command.
278261
*/
279262
data: CommandData;
280-
281263
/**
282264
* Additional command configuration options.
283265
*/
284266
options?: CommandOptions;
285-
286267
/**
287268
* The path to the command file.
288269
*/
289270
filePath: string;
290-
291271
/**
292272
* The command's category. Determined based on the command folder.
293273
*
@@ -298,7 +278,6 @@ export type CommandObject = {
298278
* ```
299279
*/
300280
category: string | null;
301-
302281
[key: string]: any;
303282
};
304283

@@ -307,7 +286,6 @@ export enum ReloadType {
307286
* Reload developer/guild commands.
308287
*/
309288
Developer = 'dev',
310-
311289
/**
312290
* Reload global commands.
313291
*/

pnpm-lock.yaml

+17-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)