Skip to content

Commit 7fc7c54

Browse files
committed
feat: add EventHandler type
1 parent c90197e commit 7fc7c54

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

apps/website/docs/guide/05-official-plugins/01-commandkit-ai.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ This is an experimental feature and is subject to change.
1212

1313
:::
1414

15-
## Architecture Overview
16-
17-
The AI system consists of several key components:
15+
## Architecture overview
1816

1917
```mermaid
2018
graph TD
@@ -31,16 +29,16 @@ graph TD
3129
K[AI Commands] --> F
3230
```
3331

34-
AI plugin basically acts as a smart command handler that decides which
35-
command to execute based on the given prompt. Similarly, the AI
36-
commands are basically an abstraction for tool calling feature of the
37-
large language models. This plugin uses the
38-
[ai sdk](https://ai-sdk.dev) under the hood to interact with large
32+
The `@commandkit/ai` plugin basically acts as a smart command handler
33+
that decides which command to execute based on the given prompt.
34+
Similarly, the AI commands are basically an abstraction for tool
35+
calling feature of the large language models. This plugin uses the
36+
[AI SDK](https://ai-sdk.dev) under the hood to interact with large
3937
language models.
4038

4139
## Installation
4240

43-
Install the AI plugin and your preferred AI SDK:
41+
Install the plugin and your preferred AI SDK:
4442

4543
```bash npm2yarn
4644
npm install @commandkit/ai

packages/commandkit/src/types.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import {
1+
import type {
22
CacheType,
33
Client,
4+
ClientEvents,
45
Interaction,
56
RESTPostAPIApplicationCommandsJSONBody,
67
} from 'discord.js';
@@ -51,3 +52,10 @@ export type CommandData = Prettify<
5152
aliases?: string[];
5253
}
5354
>;
55+
56+
/**
57+
* Represents an event handler for a specific event.
58+
*/
59+
export type EventHandler<K extends keyof ClientEvents> = (
60+
...args: ClientEvents[K]
61+
) => void | Promise<void>;

0 commit comments

Comments
 (0)