Skip to content

Commit 7fc916c

Browse files
committed
docs: update event dir docs + fix commandkit references
1 parent 475efec commit 7fc916c

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

apps/website/docs/guide/01-getting-started/02-setup-commandkit.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ By using the CLI to create a base project, you should get a project structure th
3333
```
3434

3535
:::info
36-
The `src/app.ts` file is the main entry point for your application. This file default exports the discord.js client which commandkit loads at runtime. For example, the `src/app.ts` file looks like this:
36+
The `src/app.ts` file is the main entry point for your application. This file default exports the discord.js client which CommandKit loads at runtime. For example, the `src/app.ts` file looks like this:
3737

3838
```ts
3939
import { Client } from 'discord.js';
@@ -50,13 +50,13 @@ client.token = process.env.MY_BOT_TOKEN;
5050
export default client;
5151
```
5252

53-
Notice how we are not calling `client.login()` in this file. This is because commandkit will automatically call `client.login()` for you when the application starts.
53+
Notice how we are not calling `client.login()` in this file. This is because CommandKit will automatically call `client.login()` for you when the application starts.
5454

55-
Also, you might have noticed that we are not using anything from commandkit in this file. This is because commandkit is designed to reduce boilerplate code and make it easier to build discord bot applications.
55+
Also, you might have noticed that we are not using anything from CommandKit in this file. This is because CommandKit is designed to reduce boilerplate code and make it easier to build discord bot applications.
5656
:::
5757

5858
:::info
59-
The `src/app` directory is a special directory that commandkit understands. All the commands and events in this directory will be automatically registered when the application starts.
59+
The `src/app` directory is a special directory that CommandKit understands. All the commands and events in this directory will be automatically registered when the application starts.
6060
:::
6161

6262
## Development version

apps/website/docs/guide/01-getting-started/06-onApplicationBootstrap-function.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: onApplicationBootstrap function
33
description: The onApplicationBootstrap function is called when the application is ready.
44
---
55

6-
The `onApplicationBootstrap` is a lifecycle hook in CommandKit that allows you to execute code when the application is fully initialized and ready to run. This is particularly useful for setting up things like commandkit cache providers, message command prefix resolvers, and other application-wide settings.
6+
The `onApplicationBootstrap` is a lifecycle hook in CommandKit that allows you to execute code when the application is fully initialized and ready to run. This is particularly useful for setting up things like CommandKit cache providers, message command prefix resolvers, and other application-wide settings.
77

88
## Basic Usage
99

apps/website/docs/guide/07-file-system-conventions/05-events-directory.mdx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
22
title: Events Directory
3-
description: The events directory is used to define the events for your application.
3+
description: The events directory is used to define the events for your Discord.js application.
44
---
55

6-
CommandKit provides a special directory called `events` inside the `src/app` directory. This directory is used to define the events for your application. Each event is defined in its own file, and the file name should match the event name. For example, if you have an event called `messageCreate`, you should create a file called `messageCreate.ts` (or `messageCreate.js`) in the `src/app/events` directory.
6+
CommandKit provides a special directory called `events` inside the `src/app` directory. This directory is used to define the events for your Discord.js application. Each event is defined in its own directory, and the directory name should match the Discord.js event name. Inside each event directory, you can create multiple function files that will be executed when the event is triggered. For example, if you have an event called `messageCreate`, you should create a directory called `messageCreate` in the `src/app/events` directory, and place your event handler functions inside it.
77

88
```
9-
| src/
10-
| app/
11-
| events/
12-
| messageCreate/
13-
| give-xp.ts
14-
| log.ts
15-
| ready/
16-
| log.ts
17-
| initialize.ts
9+
.
10+
└── src/
11+
└── app/
12+
└── events/
13+
├── messageCreate/
14+
│ ├── give-xp.ts
15+
│ └── log.ts
16+
└── ready/
17+
├── log.ts
18+
└── initialize.ts
1819
```
1920

2021
CommandKit also supports using custom events in the `events` directory. Custom events must be defined in a namespaced directory, which are handled by the active plugins. For example, if you have a custom event called `guildMemberBoost`, you can create a file called `src/app/events/(custom)/guildMemberBoost/handler.ts` which will be handled by the appropriate active plugins.

apps/website/docs/guide/07-file-system-conventions/07-command-file.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The command file can export multiple handler functions, such as:
1212
- `userContextMenu`: This function is executed when the command is triggered by a user context menu event.
1313
- `messageContextMenu`: This function is executed when the command is triggered by a message context menu event.
1414

15-
When defining a command, if you export `userContextMenu` or `messageContextMenu`, commandkit will automatically register the command as a context menu command without you having to explicitly define them as one.
15+
When defining a command, if you export `userContextMenu` or `messageContextMenu`, CommandKit will automatically register the command as a context menu command without you having to explicitly define them as one.
1616

1717
## Example command
1818

0 commit comments

Comments
 (0)