Skip to content

Commit 8598c43

Browse files
committed
feat(website): add docgen to website
1 parent d276a83 commit 8598c43

30 files changed

+673
-6
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
title: ButtonKit
3+
description: No description provided
4+
---
5+
6+
7+
## ButtonKit extends ButtonBuilder
8+
9+
10+
```typescript
11+
new ButtonKit(data)
12+
```
13+
| Parameter | Type | Optional |
14+
| ----------- | ----------- | ----------- |
15+
| data | Partial\<ButtonComponentData> \| Partial\<APIButtonComponent> ||
16+
17+
18+
## Properties
19+
### public data: any
20+
The API data associated with this component.
21+
22+
## Methods
23+
### public dispose(): ButtonKit
24+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/components/ButtonKit.ts#L165)
25+
### public onClick(handler, data?): this
26+
Sets up an inline interaction collector for this button. This collector by default allows as many interactions as possible if it is actively used.
27+
If unused, this expires after 24 hours or custom time if specified.
28+
29+
```ts
30+
const button = new ButtonKit()
31+
.setLabel('Click me')
32+
.setStyle(ButtonStyle.Primary)
33+
.setCustomId('click_me');
34+
35+
const row = new ActionRowBuilder().addComponents(button);
36+
37+
const message = await channel.send({ content: 'Click the button', components: [row] });
38+
39+
button.onClick(async (interaction) => {
40+
await interaction.reply('You clicked me!');
41+
}, { message });
42+
43+
// Remove onClick handler and destroy the interaction collector
44+
button.onClick(null);
45+
```
46+
47+
| Parameter | Type | Optional | Description |
48+
| ----------- | ----------- | ----------- | ----------- |
49+
| handler | CommandKitButtonBuilderInteractionCollectorDispatch || The handler to run when the button is clicked |
50+
| data | CommandKitButtonBuilderInteractionCollectorDispatchContextData || The context data to use for the interaction collector |
51+
52+
53+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/components/ButtonKit.ts#L74)
54+
### public onEnd(handler): this
55+
| Parameter | Type | Optional |
56+
| ----------- | ----------- | ----------- |
57+
| handler | CommandKitButtonBuilderOnEnd ||
58+
59+
60+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/components/ButtonKit.ts#L98)
61+
### public setCustomId(customId): this
62+
Sets the custom id for this button.
63+
64+
65+
66+
| Parameter | Type | Optional | Description |
67+
| ----------- | ----------- | ----------- | ----------- |
68+
| customId | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The custom id to use |
69+
### public setDisabled(disabled?): this
70+
Sets whether this button is disabled.
71+
72+
73+
74+
| Parameter | Type | Optional | Description |
75+
| ----------- | ----------- | ----------- | ----------- |
76+
| disabled | [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) || Whether to disable this button |
77+
### public setEmoji(emoji): this
78+
Sets the emoji to display on this button.
79+
80+
81+
82+
| Parameter | Type | Optional | Description |
83+
| ----------- | ----------- | ----------- | ----------- |
84+
| emoji | [ComponentEmojiResolvable](https://discord.js.org/docs/packages/discord.js/main/ComponentEmojiResolvable:TypeAlias) || The emoji to use |
85+
### public setLabel(label): this
86+
Sets the label for this button.
87+
88+
89+
90+
| Parameter | Type | Optional | Description |
91+
| ----------- | ----------- | ----------- | ----------- |
92+
| label | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The label to use |
93+
### public setSKUId(skuId): this
94+
Sets the SKU id that represents a purchasable SKU for this button.
95+
96+
97+
98+
| Parameter | Type | Optional | Description |
99+
| ----------- | ----------- | ----------- | ----------- |
100+
| skuId | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The SKU id to use |
101+
### public setStyle(style): this
102+
Sets the style of this button.
103+
104+
105+
106+
| Parameter | Type | Optional | Description |
107+
| ----------- | ----------- | ----------- | ----------- |
108+
| style | [ButtonStyle](https://discord-api-types.dev/api/discord-api-types-v10/enum/ButtonStyle) || The style to use |
109+
### public setURL(url): this
110+
Sets the URL for this button.
111+
112+
113+
114+
| Parameter | Type | Optional | Description |
115+
| ----------- | ----------- | ----------- | ----------- |
116+
| url | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The URL to use |
117+
### public toJSON(): [APIButtonComponent](https://discord-api-types.dev/api/discord-api-types-v10#APIButtonComponent)
118+
ComponentBuilder.toJSON
119+
### public static from(other): ButtonBuilder
120+
| Parameter | Type | Optional |
121+
| ----------- | ----------- | ----------- |
122+
| other | [APIButtonComponent](https://discord-api-types.dev/api/discord-api-types-v10#APIButtonComponent) | JSONEncodable\<[APIButtonComponent](https://discord-api-types.dev/api/discord-api-types-v10#APIButtonComponent)> ||
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: CommandKit
3+
description: No description provided
4+
---
5+
6+
7+
## CommandKit
8+
9+
10+
```typescript
11+
new CommandKit(options)
12+
```
13+
| Parameter | Type | Optional | Description |
14+
| ----------- | ----------- | ----------- | ----------- |
15+
| options | CommandKitOptions || The default CommandKit configuration. |
16+
17+
18+
## Properties
19+
### public static _instance: any
20+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L12)
21+
### public client: any
22+
Get the client attached to this CommandKit instance.
23+
24+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L42)
25+
### public commandHandler: any
26+
Get command handler instance.
27+
28+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L49)
29+
### public commands: any
30+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L128)
31+
### public commandsPath: any
32+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L144)
33+
### public devGuildIds: any
34+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L172)
35+
### public devRoleIds: any
36+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L179)
37+
### public devUserIds: any
38+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L165)
39+
### public eventsPath: any
40+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L151)
41+
### public validationsPath: any
42+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L158)
43+
44+
## Methods
45+
### public reloadCommands(type?): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)>
46+
Updates application commands with the latest from "commandsPath".
47+
48+
49+
50+
| Parameter | Type | Optional |
51+
| ----------- | ----------- | ----------- |
52+
| type | ReloadOptions ||
53+
54+
55+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L104)
56+
### public reloadEvents(): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)>
57+
Updates application events with the latest from "eventsPath".
58+
59+
60+
61+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L112)
62+
### public reloadValidations(): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)>
63+
Updates application command validations with the latest from "validationsPath".
64+
65+
66+
67+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L120)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: ReloadType
3+
description: No description provided
4+
---
5+
6+
## ReloadType
7+
8+
| Property | Type | Value | Description |
9+
| ----------- | ----------- | ----------- | ----------- |
10+
| Developer | 'dev' | N/A | Reload developer/guild commands. |
11+
| Global | 'global' | N/A | Reload global commands. |
12+
13+
14+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/types.ts#L275)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: defineConfig
3+
description: No description provided
4+
---
5+
6+
7+
### defineConfig(config): Partial\<[CommandKitConfig](/docs/api-reference/types/CommandKitConfig)>
8+
9+
| Parameter | Type | Optional |
10+
| ----------- | ----------- | ----------- |
11+
| config | PartialConfig\<[CommandKitConfig](/docs/api-reference/types/CommandKitConfig)> ||
12+
13+
14+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/config.ts#L71)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: getConfig
3+
description: No description provided
4+
---
5+
6+
7+
### getConfig(): [CommandKitConfig](/docs/api-reference/types/CommandKitConfig)
8+
9+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/config.ts#L60)

apps/website/docs/api-reference/intro.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: AutocompleteProps
3+
description: Props for autocomplete command run functions.
4+
---
5+
6+
## AutocompleteProps
7+
8+
Props for autocomplete command run functions.
9+
10+
| Property | Type | Value | Description |
11+
| ----------- | ----------- | ----------- | ----------- |
12+
| client | [Client\<true>](https://discord.js.org/docs/packages/discord.js/main/Client:Class) | N/A | The Discord.js client object that CommandKit is handling. |
13+
| handler | [CommandKit](/docs/api-reference/classes/CommandKit) | N/A | The current CommandKit handler instance. |
14+
| interaction | [AutocompleteInteraction\<CacheType>](https://discord.js.org/docs/packages/discord.js/main/AutocompleteInteraction:Class) | N/A | The current autocomplete command interaction object. |
15+
16+
17+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/types.ts#L137)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: CommandContext
3+
description: Represents a command context.
4+
---
5+
6+
## CommandContext
7+
8+
Represents a command context.
9+
10+
| Property | Type | Value | Description |
11+
| ----------- | ----------- | ----------- | ----------- |
12+
| client | [Client\<boolean>](https://discord.js.org/docs/packages/discord.js/main/Client:Class) | N/A | The client that instantiated this command. |
13+
| handler | [CommandKit](/docs/api-reference/classes/CommandKit) | N/A | The command data. |
14+
| interaction | [Interaction\<CacheType>](https://discord.js.org/docs/packages/discord.js/main/Interaction:Class) | N/A | The interaction that triggered this command. |
15+
16+
17+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/types.ts#L71)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: CommandData
3+
description: No description provided
4+
---
5+
6+
## CommandData
7+
8+
- Type: [RESTPostAPIApplicationCommandsJSONBody](https://discord-api-types.dev/api/discord-api-types-v10#RESTPostAPIApplicationCommandsJSONBody)
9+
10+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/types.ts#L247)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: CommandFileObject
3+
description: Represents a command file.
4+
---
5+
6+
## CommandFileObject
7+
8+
Represents a command file.
9+
10+
| Property | Type | Value |
11+
| ----------- | ----------- | ----------- |
12+
| autocomplete | ( ctx: CommandContext\<Interaction, Cached> ) => void | N/A |
13+
| category | null \| string | N/A |
14+
| data | [RESTPostAPIApplicationCommandsJSONBody](https://discord-api-types.dev/api/discord-api-types-v10#RESTPostAPIApplicationCommandsJSONBody) | N/A |
15+
| filePath | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | N/A |
16+
| options | CommandOptions | N/A |
17+
| run | ( ctx: CommandContext\<Interaction, Cached> ) => void | N/A |
18+
19+
20+
- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/types.ts#L92)

0 commit comments

Comments
 (0)