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 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 install honocord @discordjs/core @discordjs/builders @discordjs/rest discord-api-types
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
- const input = new TextInputBuilder()
210
- .setCustomId("feedback_text")
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
- .setStyle(TextInputStyle.Paragraph)
213
- .setRequired(true);
214
+ .setTextInputComponent(
215
+ new TextInputBuilder()
216
+ .setCustomId("feedback_text")
217
+ .setStyle(TextInputStyle.Paragraph)
218
+ .setRequired(true)
219
+ );
214
220
 
215
- modal.addComponents(new ActionRowBuilder().addComponents(input));
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 ? UserCommandInteraction : MessageCommandInteraction,
347
+ InteractionData = T extends ContextCommandType.User ? UserContextInteraction : MessageContextInteraction,
342
348
  > ()
343
349
  ```
344
350