Skip to content

Commit

Permalink
fix(website): ignore mdx formatting for api-references
Browse files Browse the repository at this point in the history
  • Loading branch information
notunderctrl committed Dec 16, 2024
1 parent 6e189b1 commit b44628b
Show file tree
Hide file tree
Showing 26 changed files with 225 additions and 238 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules

**/docs/.next/
**/website/docs/api-reference
.astro
dist
.commandkit
Expand Down
116 changes: 51 additions & 65 deletions apps/website/docs/api-reference/classes/ButtonKit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,26 @@ title: ButtonKit
description: No description provided
---


## ButtonKit extends ButtonBuilder


```typescript
new ButtonKit(data);
new ButtonKit(data)
```
| Parameter | Type | Optional |
| ----------- | ----------- | ----------- |
| data | Partial\<ButtonComponentData> \| Partial\<APIButtonComponent> ||

| Parameter | Type | Optional |
| --------- | ------------------------------------------------------------- | -------- |
| data | Partial\<ButtonComponentData> \| Partial\<APIButtonComponent> ||

## Properties

### public data: any

The API data associated with this component.

## Methods

### public dispose(): ButtonKit

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/components/ButtonKit.ts#L165)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/components/ButtonKit.ts#L165)
### public onClick(handler, data?): this

Sets up an inline interaction collector for this button. This collector by default allows as many interactions as possible if it is actively used.
If unused, this expires after 24 hours or custom time if specified.

Expand All @@ -38,99 +34,89 @@ const button = new ButtonKit()

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

const message = await channel.send({
content: 'Click the button',
components: [row],
});
const message = await channel.send({ content: 'Click the button', components: [row] });

button.onClick(
async (interaction) => {
await interaction.reply('You clicked me!');
},
{ message },
);
button.onClick(async (interaction) => {
await interaction.reply('You clicked me!');
}, { message });

// Remove onClick handler and destroy the interaction collector
button.onClick(null);
```

| Parameter | Type | Optional | Description |
| --------- | -------------------------------------------------------------- | -------- | ----------------------------------------------------- |
| handler | CommandKitButtonBuilderInteractionCollectorDispatch | | The handler to run when the button is clicked |
| data | CommandKitButtonBuilderInteractionCollectorDispatchContextData | | The context data to use for the interaction collector |
| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| handler | CommandKitButtonBuilderInteractionCollectorDispatch || The handler to run when the button is clicked |
| data | CommandKitButtonBuilderInteractionCollectorDispatchContextData || The context data to use for the interaction collector |

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/components/ButtonKit.ts#L74)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/components/ButtonKit.ts#L74)
### public onEnd(handler): this
| Parameter | Type | Optional |
| ----------- | ----------- | ----------- |
| handler | CommandKitButtonBuilderOnEnd ||

| Parameter | Type | Optional |
| --------- | ---------------------------- | -------- |
| handler | CommandKitButtonBuilderOnEnd ||

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/components/ButtonKit.ts#L98)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/components/ButtonKit.ts#L98)
### public setCustomId(customId): this

Sets the custom id for this button.

| Parameter | Type | Optional | Description |
| --------- | ------------------------------------------------------------------------------------------------- | -------- | -------------------- |
| customId | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The custom id to use |

### public setDisabled(disabled?): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| customId | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The custom id to use |
### public setDisabled(disabled?): this
Sets whether this button is disabled.

| Parameter | Type | Optional | Description |
| --------- | --------------------------------------------------------------------------------------------------- | -------- | ------------------------------ |
| disabled | [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) || Whether to disable this button |

### public setEmoji(emoji): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| disabled | [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) || Whether to disable this button |
### public setEmoji(emoji): this
Sets the emoji to display on this button.

| Parameter | Type | Optional | Description |
| --------- | ------------------------------------------------------------------------------------------------------------------- | -------- | ---------------- |
| emoji | [ComponentEmojiResolvable](https://discord.js.org/docs/packages/discord.js/main/ComponentEmojiResolvable:TypeAlias) || The emoji to use |

### public setLabel(label): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| emoji | [ComponentEmojiResolvable](https://discord.js.org/docs/packages/discord.js/main/ComponentEmojiResolvable:TypeAlias) || The emoji to use |
### public setLabel(label): this
Sets the label for this button.

| Parameter | Type | Optional | Description |
| --------- | ------------------------------------------------------------------------------------------------- | -------- | ---------------- |
| label | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The label to use |

### public setSKUId(skuId): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| label | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The label to use |
### public setSKUId(skuId): this
Sets the SKU id that represents a purchasable SKU for this button.

| Parameter | Type | Optional | Description |
| --------- | ------------------------------------------------------------------------------------------------- | -------- | ----------------- |
| skuId | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The SKU id to use |

### public setStyle(style): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| skuId | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The SKU id to use |
### public setStyle(style): this
Sets the style of this button.

| Parameter | Type | Optional | Description |
| --------- | --------------------------------------------------------------------------------------- | -------- | ---------------- |
| style | [ButtonStyle](https://discord-api-types.dev/api/discord-api-types-v10/enum/ButtonStyle) || The style to use |

### public setURL(url): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| style | [ButtonStyle](https://discord-api-types.dev/api/discord-api-types-v10/enum/ButtonStyle) || The style to use |
### public setURL(url): this
Sets the URL for this button.

| Parameter | Type | Optional | Description |
| --------- | ------------------------------------------------------------------------------------------------- | -------- | -------------- |
| url | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The URL to use |

### public toJSON(): [APIButtonComponent](https://discord-api-types.dev/api/discord-api-types-v10#APIButtonComponent)

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| url | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The URL to use |
### public toJSON(): [APIButtonComponent](https://discord-api-types.dev/api/discord-api-types-v10#APIButtonComponent)
ComponentBuilder.toJSON

### public static from(other): ButtonBuilder

| Parameter | Type | Optional |
| --------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- | --- |
| 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)> ||
| Parameter | Type | Optional |
| ----------- | ----------- | ----------- |
| 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)> ||
73 changes: 28 additions & 45 deletions apps/website/docs/api-reference/classes/CommandKit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,65 @@ title: CommandKit
description: No description provided
---


## CommandKit


```typescript
new CommandKit(options);
new CommandKit(options)
```
| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| options | CommandKitOptions || The default CommandKit configuration. |

| Parameter | Type | Optional | Description |
| --------- | ----------------- | -------- | ------------------------------------- |
| options | CommandKitOptions || The default CommandKit configuration. |

## Properties

### public static \_instance: any

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L12)

### public static _instance: any
- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L12)
### public client: any

Get the client attached to this CommandKit instance.

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L42)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L42)
### public commandHandler: any

Get command handler instance.

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L49)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L49)
### public commands: any

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L128)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L128)
### public commandsPath: any

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L144)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L144)
### public devGuildIds: any

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L172)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L172)
### public devRoleIds: any

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L179)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L179)
### public devUserIds: any

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L165)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L165)
### public eventsPath: any

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L151)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L151)
### public validationsPath: any

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L158)
- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L158)

## Methods

### 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)>

Updates application commands with the latest from "commandsPath".

| Parameter | Type | Optional |
| --------- | ------------- | -------- |
| type | ReloadOptions ||

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L104)

### 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)>
| Parameter | Type | Optional |
| ----------- | ----------- | ----------- |
| type | ReloadOptions ||


- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L104)
### 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)>
Updates application events with the latest from "eventsPath".

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L112)

### 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)>

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L112)
### 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)>
Updates application command validations with the latest from "validationsPath".

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/CommandKit.ts#L120)


- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/CommandKit.ts#L120)
11 changes: 6 additions & 5 deletions apps/website/docs/api-reference/enums/ReloadType.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ description: No description provided

## ReloadType

| Property | Type | Value | Description |
| --------- | -------- | ----- | -------------------------------- |
| Developer | 'dev' | N/A | Reload developer/guild commands. |
| Global | 'global' | N/A | Reload global commands. |
| Property | Type | Value | Description |
| ----------- | ----------- | ----------- | ----------- |
| Developer | 'dev' | N/A | Reload developer/guild commands. |
| Global | 'global' | N/A | Reload global commands. |

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/types.ts#L275)

- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/types.ts#L275)
10 changes: 6 additions & 4 deletions apps/website/docs/api-reference/functions/defineConfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ title: defineConfig
description: No description provided
---


### defineConfig(config): Partial\<[CommandKitConfig](/docs/api-reference/types/CommandKitConfig)>

| Parameter | Type | Optional |
| --------- | ------------------------------------------------------------------------------ | -------- |
| config | PartialConfig\<[CommandKitConfig](/docs/api-reference/types/CommandKitConfig)> ||
| Parameter | Type | Optional |
| ----------- | ----------- | ----------- |
| config | PartialConfig\<[CommandKitConfig](/docs/api-reference/types/CommandKitConfig)> ||


- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/config.ts#L71)
- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/config.ts#L71)
3 changes: 2 additions & 1 deletion apps/website/docs/api-reference/functions/getConfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: getConfig
description: No description provided
---


### getConfig(): [CommandKitConfig](/docs/api-reference/types/CommandKitConfig)

- [Source](https://github.com/underctrl-io/commandkit/blob/d276a8377813631933aebfa66545130a52f7a7cb/packages/commandkit/src/config.ts#L60)
- [Source](https://github.com/underctrl-io/commandkit/blob/6e189b13079ad78949d9ad2ddda0cbfd45677e1d/packages/commandkit/src/config.ts#L60)
Loading

0 comments on commit b44628b

Please sign in to comment.