honocord 1.1.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -7
- package/dist/index.d.mts +268 -210
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +214 -121
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -21,9 +21,11 @@ A Discord interaction handler library for [Hono](https://hono.dev/), designed to
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
pnpm
|
|
24
|
+
pnpm add honocord@latest
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
The most important stuff from the dependencies is already exported through honocord itselfy but if you need more from `discord-api-types` for example, you should install it yourself as well.
|
|
28
|
+
|
|
27
29
|
## Quick Start
|
|
28
30
|
|
|
29
31
|
```typescript
|
|
@@ -206,13 +208,17 @@ const modal = new ModalBuilder()
|
|
|
206
208
|
.setCustomId("feedback/feature") // prefix: "feedback"
|
|
207
209
|
.setTitle("Feature Feedback");
|
|
208
210
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
// ActionRows in modals are deprecated and should not be used because Honocord doesn't process them!
|
|
212
|
+
const input = new LabelBuilder()
|
|
211
213
|
.setLabel("What would you like to see?")
|
|
212
|
-
.
|
|
213
|
-
|
|
214
|
+
.setTextInputComponent(
|
|
215
|
+
new TextInputBuilder()
|
|
216
|
+
.setCustomId("feedback_text")
|
|
217
|
+
.setStyle(TextInputStyle.Paragraph)
|
|
218
|
+
.setRequired(true)
|
|
219
|
+
);
|
|
214
220
|
|
|
215
|
-
modal.
|
|
221
|
+
modal.addLabelComponents(input);
|
|
216
222
|
|
|
217
223
|
// Handler for all modals with the "feedback" prefix
|
|
218
224
|
const feedbackHandler = new ModalHandler("feedback", async (interaction) => {
|
|
@@ -338,7 +344,7 @@ Extends `ContextMenuCommandBuilder` from `@discordjs/builders`.
|
|
|
338
344
|
```ts
|
|
339
345
|
new ContextCommandHandler<
|
|
340
346
|
T extends ContextCommandType = ContextCommandType,
|
|
341
|
-
InteractionData = T extends ContextCommandType.User ?
|
|
347
|
+
InteractionData = T extends ContextCommandType.User ? UserContextInteraction : MessageContextInteraction,
|
|
342
348
|
> ()
|
|
343
349
|
```
|
|
344
350
|
|