Skip to content

Commit 6b42b8e

Browse files
committed
docs: build
1 parent f8cc07d commit 6b42b8e

File tree

305 files changed

+9296
-256
lines changed

Some content is hidden

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

305 files changed

+9296
-256
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: AppCommandHandler
3+
description: No description provided
4+
---
5+
6+
## AppCommandHandler
7+
8+
```typescript
9+
new AppCommandHandler(commandkit);
10+
```
11+
12+
| Parameter | Type | Optional |
13+
| ---------- | ---------- | -------- |
14+
| commandkit | CommandKit ||
15+
16+
## Properties
17+
18+
### public commandkit: any
19+
20+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/app/command-handler/AppCommandHandler.ts#L74)
21+
22+
## Methods
23+
24+
### public applyLocalizations(command): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<RESTPostAPIContextMenuApplicationCommandsJSONBody | CommandBuilderLike>
25+
26+
| Parameter | Type | Optional |
27+
| --------- | ------------------ | -------- |
28+
| command | CommandBuilderLike ||
29+
30+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/app/command-handler/AppCommandHandler.ts#L240)
31+
32+
### public getCommandsArray(): [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\<any>
33+
34+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/app/command-handler/AppCommandHandler.ts#L76)
35+
36+
### public loadCommands(): [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)>
37+
38+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/app/command-handler/AppCommandHandler.ts#L166)
39+
40+
### public prepareCommandRun(source): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<null | PreparedAppCommandExecution>
41+
42+
| Parameter | Type | Optional |
43+
| --------- | ------------------------------------------------------------------------------------- | -------- | --- |
44+
| source | [Interaction](https://discord.js.org/docs/packages/discord.js/main/Interaction:Class) | Message ||
45+
46+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/app/command-handler/AppCommandHandler.ts#L83)

apps/docs/content/docs/classes/ButtonKit.mdx

+32-15
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ new ButtonKit(data);
1111

1212
| Parameter | Type | Optional |
1313
| --------- | ------------------------------------------------------------- | -------- |
14-
| data | Partial\<ButtonComponentData> \| Partial\<APIButtonComponent> ||
14+
| data | Partial\<APIButtonComponent> \| Partial\<ButtonComponentData> ||
1515

1616
## Properties
1717

@@ -23,7 +23,17 @@ The API data associated with this component.
2323

2424
### public dispose(): ButtonKit
2525

26-
- [Source](https://github.com/underctrl-io/commandkit/blob/7e608cc8c859522925eced5a54de0a18e9cbc1e9/packages/commandkit/src/components/ButtonKit.ts#L165)
26+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/components/button/ButtonKit.ts#L222)
27+
28+
### public filter(predicate): this
29+
30+
Sets a filter for the interaction collector.
31+
32+
| Parameter | Type | Optional | Description |
33+
| --------- | ------------------ | -------- | ----------------------------------------------- |
34+
| predicate | ButtonKitPredicate || The filter to use for the interaction collector |
35+
36+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/components/button/ButtonKit.ts#L164)
2737

2838
### public onClick(handler, data?): this
2939

@@ -34,7 +44,11 @@ If unused, this expires after 24 hours or custom time if specified.
3444
const button = new ButtonKit()
3545
.setLabel('Click me')
3646
.setStyle(ButtonStyle.Primary)
37-
.setCustomId('click_me');
47+
.setCustomId('click_me')
48+
.filter((interaction) => interaction.user.id === '1234567890')
49+
.onClick(async (interaction) => {
50+
await interaction.reply('You clicked me!');
51+
});
3852

3953
const row = new ActionRowBuilder().addComponents(button);
4054

@@ -43,13 +57,6 @@ const message = await channel.send({
4357
components: [row],
4458
});
4559

46-
button.onClick(
47-
async (interaction) => {
48-
await interaction.reply('You clicked me!');
49-
},
50-
{ message },
51-
);
52-
5360
// Remove onClick handler and destroy the interaction collector
5461
button.onClick(null);
5562
```
@@ -59,15 +66,25 @@ button.onClick(null);
5966
| handler | CommandKitButtonBuilderInteractionCollectorDispatch || The handler to run when the button is clicked |
6067
| data | CommandKitButtonBuilderInteractionCollectorDispatchContextData || The context data to use for the interaction collector |
6168

62-
- [Source](https://github.com/underctrl-io/commandkit/blob/7e608cc8c859522925eced5a54de0a18e9cbc1e9/packages/commandkit/src/components/ButtonKit.ts#L74)
69+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/components/button/ButtonKit.ts#L92)
6370

6471
### public onEnd(handler): this
6572

6673
| Parameter | Type | Optional |
6774
| --------- | ---------------------------- | -------- |
6875
| handler | CommandKitButtonBuilderOnEnd ||
6976

70-
- [Source](https://github.com/underctrl-io/commandkit/blob/7e608cc8c859522925eced5a54de0a18e9cbc1e9/packages/commandkit/src/components/ButtonKit.ts#L98)
77+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/components/button/ButtonKit.ts#L125)
78+
79+
### public onError(handler): this
80+
81+
Sets the handler to run when the interaction collector ends.
82+
83+
| Parameter | Type | Optional | Description |
84+
| --------- | ---------------------------- | -------- | ------------------------------------------------------- |
85+
| handler | EventInterceptorErrorHandler || The handler to run when the interaction collector ends. |
86+
87+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/components/button/ButtonKit.ts#L147)
7188

7289
### public setCustomId(customId): this
7390

@@ -131,6 +148,6 @@ ComponentBuilder.toJSON
131148

132149
### public static from(other): ButtonBuilder
133150

134-
| Parameter | Type | Optional |
135-
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
136-
| 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)> | |
151+
| Parameter | Type | Optional |
152+
| --------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- | --- |
153+
| 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)> ||
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: CacheProvider
3+
description: No description provided
4+
---
5+
6+
## CacheProvider
7+
8+
```typescript
9+
new CacheProvider();
10+
```
11+
12+
## Methods
13+
14+
### public clear(): [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)>
15+
16+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/cache/CacheProvider.ts#L11)
17+
18+
### public delete(key): [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)>
19+
20+
| Parameter | Type | Optional |
21+
| --------- | ------------------------------------------------------------------------------------------------- | -------- |
22+
| key | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) ||
23+
24+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/cache/CacheProvider.ts#L10)
25+
26+
### public exists(key): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)>
27+
28+
| Parameter | Type | Optional |
29+
| --------- | ------------------------------------------------------------------------------------------------- | -------- |
30+
| key | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) ||
31+
32+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/cache/CacheProvider.ts#L9)
33+
34+
### public expire(key, ttl): [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)>
35+
36+
| Parameter | Type | Optional |
37+
| --------- | ------------------------------------------------------------------------------------------------- | -------- |
38+
| key | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) ||
39+
| ttl | [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) ||
40+
41+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/cache/CacheProvider.ts#L12)
42+
43+
### public get(key): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<undefined | CacheEntry\<T>>
44+
45+
| Parameter | Type | Optional |
46+
| --------- | ------------------------------------------------------------------------------------------------- | -------- |
47+
| key | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) ||
48+
49+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/cache/CacheProvider.ts#L7)
50+
51+
### public set(key, value, ttl?): [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)>
52+
53+
| Parameter | Type | Optional |
54+
| --------- | ------------------------------------------------------------------------------------------------- | -------- |
55+
| key | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) ||
56+
| value | T ||
57+
| ttl | [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) ||
58+
59+
- [Source](https://github.com/underctrl-io/commandkit/blob/f8cc07d11d2ae5ed7f529adff1649936223e27b2/packages/commandkit/src/cache/CacheProvider.ts#L8)

0 commit comments

Comments
 (0)