honocord 0.0.2 → 0.0.4

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
@@ -35,9 +35,9 @@ const bot = new Honocord();
35
35
  const pingCommand = new SlashCommandHandler().setName("ping").setDescription("Replies with Pong!");
36
36
 
37
37
  // Add handler to the command
38
- pingCommand.handler = async (interaction) => {
38
+ pingCommand.addHandler(async (interaction) => {
39
39
  await interaction.reply("Pong! 🏓");
40
- };
40
+ });
41
41
 
42
42
  // Register handlers
43
43
  bot.loadHandlers(pingCommand);
@@ -124,11 +124,11 @@ const searchCommand = new SlashCommandHandler()
124
124
  .addStringOption((option) =>
125
125
  option.setName("query").setDescription("What to search for").setRequired(true).setAutocomplete(true)
126
126
  )
127
- .handler(async (interaction) => {
127
+ .addHandler(async (interaction) => {
128
128
  const query = interaction.options.getString("query", true);
129
129
  await interaction.reply(`Searching for: ${query}`);
130
130
  })
131
- .autocomplete(async (interaction) => {
131
+ .addAutocompleteHandler(async (interaction) => {
132
132
  const focusedValue = interaction.options.getFocused();
133
133
  const choices = ["apple", "banana", "cherry", "dragon fruit", "elderberry"]
134
134
  .filter((choice) => choice.startsWith(focusedValue.toLowerCase()))
@@ -151,18 +151,18 @@ import { ApplicationCommandType } from "discord-api-types/v10";
151
151
  // User context command
152
152
  const userInfoCommand = new ContextCommandHandler().setName("User Info").setType(ApplicationCommandType.User);
153
153
 
154
- userInfoCommand.handler = async (interaction) => {
154
+ userInfoCommand.addHandler(async (interaction) => {
155
155
  const user = interaction.targetUser;
156
156
  await interaction.reply(`User: ${user.username} (${user.id})`);
157
- };
157
+ });
158
158
 
159
159
  // Message context command
160
160
  const translateCommand = new ContextCommandHandler().setName("Translate").setType(ApplicationCommandType.Message);
161
161
 
162
- translateCommand.handler = async (interaction) => {
162
+ translateCommand.addHandler(async (interaction) => {
163
163
  const message = interaction.targetMessage;
164
164
  await interaction.reply(`Translating: "${message.content}"`);
165
- };
165
+ });
166
166
 
167
167
  bot.loadHandlers(userInfoCommand, translateCommand);
168
168
  ```
@@ -244,10 +244,10 @@ const greetCommand = new SlashCommandHandler()
244
244
  .setDescription("Sends a greeting")
245
245
  .addStringOption((option) => option.setName("name").setDescription("Who to greet").setRequired(true));
246
246
 
247
- greetCommand.handler = async (interaction) => {
247
+ greetCommand.addHandler(async (interaction) => {
248
248
  const name = interaction.options.getString("name", true);
249
249
  await interaction.reply(`Hello, ${name}! 👋`);
250
- };
250
+ });
251
251
 
252
252
  // Component handler for buttons
253
253
  const confirmHandler = new ComponentHandler("confirm", async (interaction) => {
@@ -317,7 +317,7 @@ const bot = new Honocord();
317
317
  // Create command with type-safe environment access
318
318
  const pingCommand = new SlashCommandHandler().setName("ping").setDescription("Ping the bot");
319
319
 
320
- pingCommand.handler = async (interaction) => {
320
+ pingCommand.addHandler(async (interaction) => {
321
321
  const ctx = interaction.ctx as MyContext;
322
322
 
323
323
  // Type-safe access to bindings
@@ -325,18 +325,18 @@ pingCommand.handler = async (interaction) => {
325
325
  await cache.put("last_ping", new Date().toISOString());
326
326
 
327
327
  await interaction.reply("Pong! 🏓");
328
- };
328
+ });
329
329
 
330
330
  // Create command that queries database
331
331
  const statsCommand = new SlashCommandHandler().setName("stats").setDescription("Show bot stats");
332
332
 
333
- statsCommand.handler = async (interaction) => {
333
+ statsCommand.addHandler(async (interaction) => {
334
334
  const ctx = interaction.ctx as MyContext;
335
335
  const db = ctx.env.DATABASE;
336
336
 
337
337
  const result = await db.prepare("SELECT COUNT(*) as count FROM users").first();
338
338
  await interaction.reply(`Total users: ${result?.count ?? 0}`);
339
- };
339
+ });
340
340
 
341
341
  // Component handler
342
342
  const approveButton = new ComponentHandler("approve", async (interaction) => {
@@ -392,12 +392,13 @@ interface MyEnv {
392
392
  type MyContext = BaseInteractionContext<MyEnv>;
393
393
 
394
394
  // Use in your handlers
395
- const command = new SlashCommandHandler().setName("data").setDescription("Fetch data");
396
-
397
- command.handler = async (interaction: MyContext) => {
398
- const dbUrl = interaction.env.DATABASE_URL; // Fully typed!
399
- // ...
400
- };
395
+ const command = new SlashCommandHandler()
396
+ .setName("data")
397
+ .setDescription("Fetch data")
398
+ .addHandler(async (interaction: MyContext) => {
399
+ const dbUrl = interaction.env.DATABASE_URL; // Fully typed!
400
+ // ...
401
+ });
401
402
  ```
402
403
 
403
404
  ## Registering Commands with Discord
@@ -445,18 +446,18 @@ Main class for handling Discord interactions.
445
446
 
446
447
  Extends `SlashCommandBuilder` from `@discordjs/builders`.
447
448
 
448
- **Properties:**
449
+ **Methods:**
449
450
 
450
- - `handler: (interaction: ChatInputCommandInteraction) => Promise<void> | void` - Command execution handler
451
- - `autocomplete?: (interaction: AutocompleteInteraction) => Promise<void> | void` - Optional autocomplete handler
451
+ - `addHandler(handler: (interaction: ChatInputCommandInteraction) => Promise<void> | void)` - Adds the command execution handler
452
+ - `addAutocompleteHandler(handler: (interaction: AutocompleteInteraction) => Promise<void> | void)` - Adds an optional autocomplete handler
452
453
 
453
454
  ### `ContextCommandHandler`
454
455
 
455
456
  Extends `ContextMenuCommandBuilder` from `@discordjs/builders`.
456
457
 
457
- **Properties:**
458
+ **Methods:**
458
459
 
459
- - `handler: (interaction: UserCommandInteraction | MessageCommandInteraction) => Promise<void> | void` - Command execution handler
460
+ - `addHandler(handler: (interaction: UserCommandInteraction | MessageCommandInteraction) => Promise<void> | void)` - Adds the command execution handler
460
461
 
461
462
  ### `ComponentHandler`
462
463
 
@@ -464,7 +465,11 @@ Handler for message components.
464
465
 
465
466
  **Constructor:**
466
467
 
467
- - `new ComponentHandler(prefix: string, handler: Function)` - Creates a handler for components with the given prefix
468
+ - `new ComponentHandler(prefix: string, handler?: Function)` - Creates a handler for components with the given prefix
469
+
470
+ **Methods:**
471
+
472
+ - `addHandler(handler: (interaction: MessageComponentInteraction) => Promise<void> | void)` - Adds or replaces the component handler function
468
473
 
469
474
  ### `ModalHandler`
470
475
 
@@ -472,7 +477,11 @@ Handler for modal submissions.
472
477
 
473
478
  **Constructor:**
474
479
 
475
- - `new ModalHandler(prefix: string, handler: Function)` - Creates a handler for modals with the given prefix
480
+ - `new ModalHandler(prefix: string, handler?: Function)` - Creates a handler for modals with the given prefix
481
+
482
+ **Methods:**
483
+
484
+ - `addHandler(handler: (interaction: ModalInteraction) => Promise<void> | void)` - Adds or replaces the modal submit handler function
476
485
 
477
486
  ### `parseCustomId`
478
487
 
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import * as discord_api_types_v1027 from "discord-api-types/v10";
1
+ import * as discord_api_types_v100 from "discord-api-types/v10";
2
2
  import { APIApplicationCommandAutocompleteInteraction, APIApplicationCommandInteractionDataOption, APIApplicationCommandOptionChoice, APIAttachment, APIChatInputApplicationCommandInteraction, APIChatInputApplicationCommandInteraction as APIChatInputApplicationCommandInteraction$1, APIInteraction, APIInteraction as APIInteraction$1, APIInteractionDataResolved, APIInteractionDataResolvedChannel, APIInteractionDataResolvedGuildMember, APIInteractionResponseCallbackData, APIMessage, APIMessageApplicationCommandInteraction, APIMessageComponentInteraction, APIMessageComponentInteraction as APIMessageComponentInteraction$1, APIModalInteractionResponseCallbackData, APIModalSubmitInteraction, APIModalSubmitInteraction as APIModalSubmitInteraction$1, APIPartialInteractionGuild, APIRole, APIUser, APIUserApplicationCommandInteraction, ApplicationCommandOptionType, ApplicationCommandType, ChannelType, ComponentType, InteractionResponseType, InteractionType, Locale, ModalSubmitLabelComponent, ModalSubmitTextDisplayComponent, Snowflake } from "discord-api-types/v10";
3
3
  import { Collection, ReadonlyCollection } from "@discordjs/collection";
4
- import { ContextMenuCommandBuilder, ModalBuilder, SlashCommandBuilder } from "@discordjs/builders";
4
+ import { ContextMenuCommandBuilder, ModalBuilder, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandUserOption } from "@discordjs/builders";
5
5
  import { API } from "@discordjs/core/http-only";
6
6
  import { REST } from "@discordjs/rest";
7
7
  import * as hono0 from "hono";
@@ -57,27 +57,27 @@ declare class CommandInteractionOptionResolver {
57
57
  * @param required Whether to throw an error if the option is not found.
58
58
  * @returns The option, if found.
59
59
  */
60
- get<T extends ApplicationCommandOptionType>(name: string, type: T, required?: boolean): Extract<discord_api_types_v1027.APIApplicationCommandInteractionDataAttachmentOption, {
60
+ get<T extends ApplicationCommandOptionType>(name: string, type: T, required?: boolean): Extract<discord_api_types_v100.APIApplicationCommandInteractionDataAttachmentOption, {
61
61
  type: T;
62
- }> | Extract<discord_api_types_v1027.APIApplicationCommandInteractionDataBooleanOption, {
62
+ }> | Extract<discord_api_types_v100.APIApplicationCommandInteractionDataBooleanOption, {
63
63
  type: T;
64
- }> | Extract<discord_api_types_v1027.APIApplicationCommandInteractionDataChannelOption, {
64
+ }> | Extract<discord_api_types_v100.APIApplicationCommandInteractionDataChannelOption, {
65
65
  type: T;
66
- }> | Extract<discord_api_types_v1027.APIApplicationCommandInteractionDataMentionableOption, {
66
+ }> | Extract<discord_api_types_v100.APIApplicationCommandInteractionDataMentionableOption, {
67
67
  type: T;
68
- }> | Extract<discord_api_types_v1027.APIApplicationCommandInteractionDataRoleOption, {
68
+ }> | Extract<discord_api_types_v100.APIApplicationCommandInteractionDataRoleOption, {
69
69
  type: T;
70
- }> | Extract<discord_api_types_v1027.APIApplicationCommandInteractionDataStringOption, {
70
+ }> | Extract<discord_api_types_v100.APIApplicationCommandInteractionDataStringOption, {
71
71
  type: T;
72
- }> | Extract<discord_api_types_v1027.APIApplicationCommandInteractionDataUserOption, {
72
+ }> | Extract<discord_api_types_v100.APIApplicationCommandInteractionDataUserOption, {
73
73
  type: T;
74
- }> | Extract<discord_api_types_v1027.APIApplicationCommandInteractionDataIntegerOption<InteractionType.ApplicationCommand>, {
74
+ }> | Extract<discord_api_types_v100.APIApplicationCommandInteractionDataIntegerOption<InteractionType.ApplicationCommand>, {
75
75
  type: T;
76
- }> | Extract<discord_api_types_v1027.APIApplicationCommandInteractionDataNumberOption<InteractionType.ApplicationCommand>, {
76
+ }> | Extract<discord_api_types_v100.APIApplicationCommandInteractionDataNumberOption<InteractionType.ApplicationCommand>, {
77
77
  type: T;
78
- }> | Extract<discord_api_types_v1027.APIApplicationCommandInteractionDataSubcommandGroupOption<InteractionType.ApplicationCommand>, {
78
+ }> | Extract<discord_api_types_v100.APIApplicationCommandInteractionDataSubcommandGroupOption<InteractionType.ApplicationCommand>, {
79
79
  type: T;
80
- }> | Extract<discord_api_types_v1027.APIApplicationCommandInteractionDataSubcommandOption<InteractionType.ApplicationCommand>, {
80
+ }> | Extract<discord_api_types_v100.APIApplicationCommandInteractionDataSubcommandOption<InteractionType.ApplicationCommand>, {
81
81
  type: T;
82
82
  }> | null;
83
83
  /**
@@ -304,14 +304,14 @@ declare abstract class BaseInteraction<Type extends InteractionType> {
304
304
  readonly context: BaseInteractionContext;
305
305
  constructor(api: API, data: typeof this.data, context: BaseInteractionContext);
306
306
  get applicationId(): string;
307
- get entitlements(): discord_api_types_v1027.APIEntitlement[];
307
+ get entitlements(): discord_api_types_v100.APIEntitlement[];
308
308
  get channelId(): string | undefined;
309
- get channel(): (Partial<discord_api_types_v1027.APIAnnouncementThreadChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1027.APIDMChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1027.APIGroupDMChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1027.APIGuildCategoryChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1027.APIGuildForumChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1027.APIGuildMediaChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1027.APIGuildStageVoiceChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1027.APIGuildVoiceChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1027.APINewsChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1027.APIPrivateThreadChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1027.APIPublicThreadChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1027.APITextChannel> & Pick<discord_api_types_v1027.APIChannel, "id" | "type">) | undefined;
309
+ get channel(): (Partial<discord_api_types_v100.APIAnnouncementThreadChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | (Partial<discord_api_types_v100.APIDMChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | (Partial<discord_api_types_v100.APIGroupDMChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | (Partial<discord_api_types_v100.APIGuildCategoryChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | (Partial<discord_api_types_v100.APIGuildForumChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | (Partial<discord_api_types_v100.APIGuildMediaChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | (Partial<discord_api_types_v100.APIGuildStageVoiceChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | (Partial<discord_api_types_v100.APIGuildVoiceChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | (Partial<discord_api_types_v100.APINewsChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | (Partial<discord_api_types_v100.APIPrivateThreadChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | (Partial<discord_api_types_v100.APIPublicThreadChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | (Partial<discord_api_types_v100.APITextChannel> & Pick<discord_api_types_v100.APIChannel, "id" | "type">) | undefined;
310
310
  get guildId(): string | undefined;
311
311
  get guild(): APIPartialInteractionGuild | undefined;
312
312
  get userId(): string | undefined;
313
313
  get user(): APIUser;
314
- get member(): discord_api_types_v1027.APIInteractionGuildMember | undefined;
314
+ get member(): discord_api_types_v100.APIInteractionGuildMember | undefined;
315
315
  get locale(): Locale | undefined;
316
316
  get guildLocale(): Locale | undefined;
317
317
  get token(): string;
@@ -328,13 +328,13 @@ declare abstract class BaseInteraction<Type extends InteractionType> {
328
328
  guild: undefined;
329
329
  guild_locale: undefined;
330
330
  };
331
- getAppEntitlements(): discord_api_types_v1027.APIEntitlement[];
331
+ getAppEntitlements(): discord_api_types_v100.APIEntitlement[];
332
332
  guildHavePremium(): boolean;
333
333
  userHavePremium(): boolean;
334
334
  reply(options: APIInteractionResponseCallbackData | string, forceEphemeral?: boolean): Promise<undefined>;
335
335
  deferReply(forceEphemeral?: boolean): Promise<undefined>;
336
336
  deferUpdate(): Promise<undefined>;
337
- editReply(options: APIInteractionResponseCallbackData | string, messageId?: Snowflake | "@original"): Promise<discord_api_types_v1027.APIMessage>;
337
+ editReply(options: APIInteractionResponseCallbackData | string, messageId?: Snowflake | "@original"): Promise<discord_api_types_v100.APIMessage>;
338
338
  deleteReply(messageId?: Snowflake | "@original"): Promise<void>;
339
339
  update(options: APIInteractionResponseCallbackData | string): Promise<undefined>;
340
340
  isChatInputCommand(): this is ChatInputCommandInteraction;
@@ -433,12 +433,12 @@ interface BaseHonocordEnv<TBindings extends BaseBindings = BaseBindings, TVariab
433
433
  * .setName("query")
434
434
  * .setDescription("Query the database");
435
435
  *
436
- * command.handler = async (interaction: MyContext) => {
436
+ * command.addHandler(async (interaction: MyContext) => {
437
437
  * // Type-safe access to your environment
438
438
  * const db = interaction.env.DATABASE;
439
439
  * const result = await db.prepare("SELECT * FROM users").all();
440
440
  * await interaction.reply(`Found ${result.results.length} users`);
441
- * };
441
+ * });
442
442
  *
443
443
  * bot.loadHandlers([command]);
444
444
  * ```
@@ -480,6 +480,20 @@ declare class UserCommandInteraction extends BaseInteraction<InteractionType.App
480
480
  declare class SlashCommandHandler extends SlashCommandBuilder {
481
481
  private handlerFn?;
482
482
  private autocompleteFn?;
483
+ /**
484
+ * Adds the command handler function.
485
+ *
486
+ * @param handler The function to handle the command interaction
487
+ * @returns The current SlashCommandHandler instance
488
+ */
489
+ addHandler(handler: (interaction: ChatInputCommandInteraction) => Promise<void> | void): SlashCommandHandler;
490
+ /**
491
+ * Adds the autocomplete handler function.
492
+ *
493
+ * @param handler The function to handle the autocomplete interaction
494
+ * @returns The current SlashCommandHandler instance
495
+ */
496
+ addAutocompleteHandler(handler: (interaction: AutocompleteInteraction) => Promise<void> | void): SlashCommandHandler;
483
497
  /**
484
498
  * Executes the command handler
485
499
  */
@@ -488,9 +502,25 @@ declare class SlashCommandHandler extends SlashCommandBuilder {
488
502
  * Executes the autocomplete handler if it exists
489
503
  */
490
504
  executeAutocomplete(interaction: AutocompleteInteraction): Promise<void>;
505
+ /**
506
+ * Override option/subcommand adders so they return `this` (the handler),
507
+ * preserving chaining when options/subcommands are added.
508
+ */
509
+ addBooleanOption(input: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): this;
510
+ addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)): this;
511
+ addChannelOption(input: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): this;
512
+ addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): this;
513
+ addAttachmentOption(input: SlashCommandAttachmentOption | ((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption)): this;
514
+ addMentionableOption(input: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): this;
515
+ addStringOption(input: SlashCommandStringOption | ((builder: SlashCommandStringOption) => SlashCommandStringOption)): this;
516
+ addIntegerOption(input: SlashCommandIntegerOption | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption)): this;
517
+ addNumberOption(input: SlashCommandNumberOption | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption)): this;
518
+ addSubcommand(input: SlashCommandSubcommandBuilder | ((sub: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): this;
519
+ addSubcommandGroup(input: SlashCommandSubcommandGroupBuilder | ((group: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder)): this;
491
520
  }
492
521
  declare class ContextCommandHandler<T extends ApplicationCommandType = ApplicationCommandType, InteractionData = (T extends ApplicationCommandType.User ? UserCommandInteraction : MessageCommandInteraction)> extends ContextMenuCommandBuilder {
493
522
  private handlerFn?;
523
+ addHandler(handler: (interaction: InteractionData) => Promise<void> | void): ContextCommandHandler<T, InteractionData>;
494
524
  /**
495
525
  * Executes the command handler
496
526
  */
@@ -501,8 +531,9 @@ declare class ContextCommandHandler<T extends ApplicationCommandType = Applicati
501
531
  */
502
532
  declare class ComponentHandler {
503
533
  readonly prefix: string;
504
- private handlerFn;
505
- constructor(prefix: string, handler: (interaction: MessageComponentInteraction) => Promise<void> | void);
534
+ private handlerFn?;
535
+ constructor(prefix: string, handler?: (interaction: MessageComponentInteraction) => Promise<void> | void);
536
+ addHandler(handler: (interaction: MessageComponentInteraction) => Promise<void> | void): ComponentHandler;
506
537
  /**
507
538
  * Executes the component handler
508
539
  */
@@ -517,8 +548,9 @@ declare class ComponentHandler {
517
548
  */
518
549
  declare class ModalHandler {
519
550
  readonly prefix: string;
520
- private handlerFn;
521
- constructor(prefix: string, handler: (interaction: ModalInteraction) => Promise<void> | void);
551
+ private handlerFn?;
552
+ constructor(prefix: string, handler?: (interaction: ModalInteraction) => Promise<void> | void);
553
+ addHandler(handler: (interaction: ModalInteraction) => Promise<void> | void): ModalHandler;
522
554
  /**
523
555
  * Executes the modal handler
524
556
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/resolvers/CommandOptionResolver.ts","../src/resolvers/ModalComponentResolver.ts","../src/interactions/ModalInteraction.ts","../src/interactions/BaseInteraction.ts","../src/interactions/ChatInputInteraction.ts","../src/interactions/MessageComponentInteraction.ts","../src/types.ts","../src/interactions/AutocompleteInteraction.ts","../src/interactions/MessageContextCommandInteraction.ts","../src/interactions/UserContextCommandInteraction.ts","../src/interactions/handlers.ts","../src/Honocord.ts","../src/utils/Colors.ts","../src/utils/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;KAeK,yBAAA;;;;;;;;QAQG;;;;EARH,KAAA,EAAA,MAAA;EAsBC;;;EAqBE,OAAA,EAAA,OAAA;CAIM;;;;cAzBR,gCAAA,CA4DU;EAAkD;;;EAAmB,QAAA,MAAA;EAAA;;;;EAcgC;;;;;;EAAA,WAAA,CAAA,OAAA,EArD7G,0CAqD6G,CApD3G,eAAA,CAAgB,kBAoD2F,GApDtE,eAAA,CAAgB,8BAoDsD,CAAA,EAAA,GAAA,SAAA,EAAA,QAAA,EAjDvG,0BAiDuG,GAAA,SAAA;cA1BpG,2CAAA,eAAA,CAAA,qBAAA,eAAA,CAAA;;;;;;;;;EA0BoG,GAAA,CAAA,UAdrG,4BAcqG,CAAA,CAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAdnD,CAcmD,EAAA,QAAA,CAAA,EAAA,OAAA,CAAA,EAdhC,OAcgC,CAdlD,uBAAA,CAAkB,oDAAA,EAcgC;UAAA;eAdhC,uBAAA,CAAA,iDAAA;UAcgC;EAAA,CAAA,CAAA,UAAA,4EAAA;UAAA;;UAAA;EAAA,CAAA,CAAA,UAAA,yEAAA;UAAA;;UAAA;EAAA,CAAA,CAAA,UAAA,yEAAA;UAAA;EAmCrG,CAAA,CAAA,UAAA,0EAAA,mCAAA,CAAA,EAAA;IA0B0C,IAAA,EA7D2D,CA6D3D;EAAgB,CAAA,CAAA,UAAA,yEAAA,mCAAA,CAAA,EAAA;IACjB,IAAA,EA9D4D,CA8D5D;EAAgB,CAAA,CAAA,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AAA,OAAgB,EAAA,CAAA;EADvD,SAAA,OAAA,EAAA,QAAA;EAIM,SAAA,IAAA,EAAA,QAAA;EAuBG,SAAA,KAAA,EAAA,OAAA;EAAA,SAAA,IAAA,EAAA,OAAA;EAAA,SAAA,OAAA,EAAA,QAAA;EAYD,SAAA,SAAA,EAAA,QAAA;EAAkD,SAAA,iBAAA,EAAA,QAAA;EAAC,SAAA,IAAA,EAAA,OAAkB;EAcgC,SAAA,aAAA,EAAA,OAAA;EAdhC,SAAA,MAAA,EAAA,QAAA;EAAA,SAAA,MAAA,EAAA,QAAA;EAcgC,SAAA,GAAA,EAAA,QAAA;;;CAAA;;;iBa/GrG,aAAA;iBACA,aAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/resolvers/CommandOptionResolver.ts","../src/resolvers/ModalComponentResolver.ts","../src/interactions/ModalInteraction.ts","../src/interactions/BaseInteraction.ts","../src/interactions/ChatInputInteraction.ts","../src/interactions/MessageComponentInteraction.ts","../src/types.ts","../src/interactions/AutocompleteInteraction.ts","../src/interactions/MessageContextCommandInteraction.ts","../src/interactions/UserContextCommandInteraction.ts","../src/interactions/handlers.ts","../src/Honocord.ts","../src/utils/Colors.ts","../src/utils/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;KAeK,yBAAA;;;;;;;;QAQG;;;;EARH,KAAA,EAAA,MAAA;EAsBC;;;EAqBE,OAAA,EAAA,OAAA;CAIM;;;;cAzBR,gCAAA,CA4DU;EAAkD;;;EAAmB,QAAA,MAAA;EAAA;;;;EAcgC;;;;;;EAAA,WAAA,CAAA,OAAA,EArD7G,0CAqD6G,CApD3G,eAAA,CAAgB,kBAoD2F,GApDtE,eAAA,CAAgB,8BAoDsD,CAAA,EAAA,GAAA,SAAA,EAAA,QAAA,EAjDvG,0BAiDuG,GAAA,SAAA;cA1BpG,2CAAA,eAAA,CAAA,qBAAA,eAAA,CAAA;;;;;;;;;EA0BoG,GAAA,CAAA,UAdrG,4BAcqG,CAA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AA,CUmPd,QVnPc,GUmPd,KAAA,CAAA,aVnPc,CAAA,uBAAA,EAAA,GAAA,EAAA,MAAA,CAAA,CAAA,GAAA,CUmPd,QVnPc,SUmPd,aVnPc,CAAA;IAKxC,IAAA,yBAAoB;EACjC,CAAA,gDAAc,MAAA,CAAA,CAAA,GAAA,SAAA,sBAAA,CAAA,CAAA,CAAA,EAAA,GAAA,EAAA,MAAA,CAAA,CAAA,GAAA,SAAA,sBAAA,CAAA,wBAAA,EAAA,GAAA,EAAA,MAAA,CAAA,CAAA,GAAA,SAAA,CAAA;EACd;;;;;;;;;;;;EAQM,MAAA,CAAA,CAAA,EU0RF,IV1RE,CAAA;IACmB,SAAA,EU0RS,aV1RT;EAAW,CAAA,EU0RW,WAAA,CAAA,WAAA,EV1RX,GAAA,CAAA;;;;cWnC3B;;;;;;;;;;;;;EZcR,SAAA,UAAA,EAAA,OAAyB;EAsBxB,SAAA,OAAA,EAAA,QAAA;EAsBI,SAAA,aAAgB,EAAA,QAAA;EAAqB,SAAA,OAAgB,EAAA,CAAA;EADvD,SAAA,OAAA,EAAA,QAAA;EAIM,SAAA,IAAA,EAAA,QAAA;EAuBG,SAAA,KAAA,EAAA,OAAA;EAAA,SAAA,IAAA,EAAA,OAAA;EAAA,SAAA,OAAA,EAAA,QAAA;EAYD,SAAA,SAAA,EAAA,QAAA;EAAkD,SAAA,iBAAA,EAAA,QAAA;EAAC,SAAA,IAAA,EAAA,OAAkB;EAcgC,SAAA,aAAA,EAAA,OAAA;EAdhC,SAAA,MAAA,EAAA,QAAA;EAAA,SAAA,MAAA,EAAA,QAAA;EAcgC,SAAA,GAAA,EAAA,QAAA;;;CAAA;;;iBa/GrG,aAAA;iBACA,aAAA"}
package/dist/index.mjs CHANGED
@@ -572,6 +572,26 @@ var SlashCommandHandler = class extends SlashCommandBuilder {
572
572
  handlerFn;
573
573
  autocompleteFn;
574
574
  /**
575
+ * Adds the command handler function.
576
+ *
577
+ * @param handler The function to handle the command interaction
578
+ * @returns The current SlashCommandHandler instance
579
+ */
580
+ addHandler(handler) {
581
+ this.handlerFn = handler;
582
+ return this;
583
+ }
584
+ /**
585
+ * Adds the autocomplete handler function.
586
+ *
587
+ * @param handler The function to handle the autocomplete interaction
588
+ * @returns The current SlashCommandHandler instance
589
+ */
590
+ addAutocompleteHandler(handler) {
591
+ this.autocompleteFn = handler;
592
+ return this;
593
+ }
594
+ /**
575
595
  * Executes the command handler
576
596
  */
577
597
  async execute(interaction) {
@@ -585,9 +605,61 @@ var SlashCommandHandler = class extends SlashCommandBuilder {
585
605
  if (this.autocompleteFn == void 0) throw new Error(`Command "${this.name}" does not have an autocomplete handler`);
586
606
  await this.autocompleteFn(interaction);
587
607
  }
608
+ /**
609
+ * Override option/subcommand adders so they return `this` (the handler),
610
+ * preserving chaining when options/subcommands are added.
611
+ */
612
+ addBooleanOption(input) {
613
+ super.addBooleanOption(input);
614
+ return this;
615
+ }
616
+ addUserOption(input) {
617
+ super.addUserOption(input);
618
+ return this;
619
+ }
620
+ addChannelOption(input) {
621
+ super.addChannelOption(input);
622
+ return this;
623
+ }
624
+ addRoleOption(input) {
625
+ super.addRoleOption(input);
626
+ return this;
627
+ }
628
+ addAttachmentOption(input) {
629
+ super.addAttachmentOption(input);
630
+ return this;
631
+ }
632
+ addMentionableOption(input) {
633
+ super.addMentionableOption(input);
634
+ return this;
635
+ }
636
+ addStringOption(input) {
637
+ super.addStringOption(input);
638
+ return this;
639
+ }
640
+ addIntegerOption(input) {
641
+ super.addIntegerOption(input);
642
+ return this;
643
+ }
644
+ addNumberOption(input) {
645
+ super.addNumberOption(input);
646
+ return this;
647
+ }
648
+ addSubcommand(input) {
649
+ super.addSubcommand(input);
650
+ return this;
651
+ }
652
+ addSubcommandGroup(input) {
653
+ super.addSubcommandGroup(input);
654
+ return this;
655
+ }
588
656
  };
589
657
  var ContextCommandHandler = class extends ContextMenuCommandBuilder {
590
658
  handlerFn;
659
+ addHandler(handler) {
660
+ this.handlerFn = handler;
661
+ return this;
662
+ }
591
663
  /**
592
664
  * Executes the command handler
593
665
  */
@@ -604,22 +676,25 @@ var ComponentHandler = class {
604
676
  handlerFn;
605
677
  constructor(prefix, handler) {
606
678
  if (!prefix || typeof prefix !== "string") throw new TypeError("Component handler prefix must be a non-empty string");
607
- if (typeof handler !== "function") throw new TypeError("Component handler must be a function");
608
679
  this.prefix = prefix;
680
+ if (handler) this.handlerFn = handler;
681
+ }
682
+ addHandler(handler) {
609
683
  this.handlerFn = handler;
684
+ return this;
610
685
  }
611
686
  /**
612
687
  * Executes the component handler
613
688
  */
614
689
  async execute(interaction) {
690
+ if (!this.handlerFn) throw new Error(`Component handler with prefix "${this.prefix}" does not have a handler`);
615
691
  await this.handlerFn(interaction);
616
692
  }
617
693
  /**
618
694
  * Checks if this handler matches the given custom ID
619
695
  */
620
696
  matches(customId) {
621
- const match = customId.match(/^(.+?)(\/|\?|$)/);
622
- return (match ? match[1] : customId) === this.prefix;
697
+ return parseCustomId(customId, true) === this.prefix;
623
698
  }
624
699
  };
625
700
  /**
@@ -632,20 +707,24 @@ var ModalHandler = class {
632
707
  if (!prefix || typeof prefix !== "string") throw new TypeError("Modal handler prefix must be a non-empty string");
633
708
  if (typeof handler !== "function") throw new TypeError("Modal handler must be a function");
634
709
  this.prefix = prefix;
710
+ if (handler) this.handlerFn = handler;
711
+ }
712
+ addHandler(handler) {
635
713
  this.handlerFn = handler;
714
+ return this;
636
715
  }
637
716
  /**
638
717
  * Executes the modal handler
639
718
  */
640
719
  async execute(interaction) {
720
+ if (!this.handlerFn) throw new Error(`Modal handler with prefix "${this.prefix}" does not have a handler`);
641
721
  await this.handlerFn(interaction);
642
722
  }
643
723
  /**
644
724
  * Checks if this handler matches the given custom ID
645
725
  */
646
726
  matches(customId) {
647
- const match = customId.match(/^(.+?)(\/|\?|$)/);
648
- return (match ? match[1] : customId) === this.prefix;
727
+ return parseCustomId(customId, true) === this.prefix;
649
728
  }
650
729
  };
651
730
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/resolvers/CommandOptionResolver.ts","../src/interactions/BaseInteraction.ts","../src/interactions/ChatInputInteraction.ts","../src/utils/discordVerify.ts","../src/utils/index.ts","../src/interactions/UserContextCommandInteraction.ts","../src/interactions/MessageContextCommandInteraction.ts","../src/interactions/MessageComponentInteraction.ts","../src/resolvers/ModalComponentResolver.ts","../src/interactions/ModalInteraction.ts","../src/interactions/AutocompleteInteraction.ts","../src/interactions/handlers.ts","../src/Honocord.ts","../src/utils/Colors.ts"],"sourcesContent":["import { Collection } from \"@discordjs/collection\";\nimport {\n APIApplicationCommandInteractionDataOption,\n APIAttachment,\n APIInteractionDataResolved,\n APIInteractionDataResolvedChannel,\n APIInteractionDataResolvedGuildMember,\n APIRole,\n APIUser,\n ApplicationCommandOptionType,\n ChannelType,\n InteractionType,\n} from \"discord-api-types/v10\";\nimport { APIInteractionDataResolvedCollections } from \"../types\";\n\ntype AutocompleteFocusedOption = {\n /**\n * The name of the option.\n */\n name: string;\n /**\n * The type of the application command option.\n */\n type: ApplicationCommandOptionType;\n /**\n * The value of the option.\n */\n value: string;\n /**\n * Whether the option is focused.\n */\n focused: boolean;\n};\n\n/**\n * A resolver for command interaction options.\n */\nclass CommandInteractionOptionResolver {\n /**\n * The name of the subcommand group.\n */\n private _group: string | null = null;\n /**\n * The name of the subcommand.\n */\n private _subcommand: string | null = null;\n /**\n * The bottom-level options for the interaction.\n * If there is a subcommand (or subcommand and group), this is the options for the subcommand.\n */\n private _hoistedOptions: APIApplicationCommandInteractionDataOption<\n InteractionType.ApplicationCommand | InteractionType.ApplicationCommandAutocomplete\n >[];\n\n private _resolved: APIInteractionDataResolvedCollections;\n\n constructor(\n options:\n | APIApplicationCommandInteractionDataOption<\n InteractionType.ApplicationCommand | InteractionType.ApplicationCommandAutocomplete\n >[]\n | undefined,\n resolved: APIInteractionDataResolved | undefined\n ) {\n this._hoistedOptions = options ?? [];\n this._resolved = Object.keys(resolved ?? {}).reduce((acc, key) => {\n const resolvedData = resolved?.[key as keyof APIInteractionDataResolved];\n const collection = new Collection(resolvedData ? Object.entries(resolvedData) : []);\n acc[key as keyof APIInteractionDataResolvedCollections] = collection;\n return acc;\n }, {} as Partial<APIInteractionDataResolvedCollections>);\n\n // Hoist subcommand group if present\n if (this._hoistedOptions[0]?.type === ApplicationCommandOptionType.SubcommandGroup) {\n this._group = this._hoistedOptions[0].name;\n this._hoistedOptions = this._hoistedOptions[0].options ?? [];\n }\n\n // Hoist subcommand if present\n if (this._hoistedOptions[0]?.type === ApplicationCommandOptionType.Subcommand) {\n this._subcommand = this._hoistedOptions[0].name;\n this._hoistedOptions = this._hoistedOptions[0].options ?? [];\n }\n }\n\n public get data() {\n return this._hoistedOptions;\n }\n\n /**\n * Gets an option by its name.\n *\n * @param name The name of the option.\n * @param type The expected type of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The option, if found.\n */\n get<T extends ApplicationCommandOptionType>(name: string, type: T, required = false) {\n const option = this._hoistedOptions.find((opt) => opt.name === name);\n if (!option) {\n if (required) {\n throw new TypeError(\"Option not found\", { cause: { name } });\n }\n\n return null;\n }\n\n if (option.type !== type) {\n throw new TypeError(\"Option type mismatch\", { cause: { name, type: option.type, expected: type } });\n }\n\n return option as Extract<APIApplicationCommandInteractionDataOption<InteractionType.ApplicationCommand>, { type: T }>;\n }\n\n /**\n * Gets the selected subcommand.\n *\n * @param {boolean} [required=true] Whether to throw an error if there is no subcommand.\n * @returns {?string} The name of the selected subcommand, or null if not set and not required.\n */\n getSubcommand(): string | null;\n getSubcommand(required: true): string;\n getSubcommand(required: boolean = true): string | null {\n if (required && !this._subcommand) {\n throw new TypeError(\"No subcommand selected\");\n }\n\n return this._subcommand;\n }\n\n /**\n * Gets the selected subcommand group.\n *\n * @param required Whether to throw an error if there is no subcommand group.\n * @returns The name of the selected subcommand group, or null if not set and not required.\n */\n getSubcommandGroup(required?: boolean): string | null;\n getSubcommandGroup(required: true): string;\n getSubcommandGroup(required: boolean = false): string | null {\n if (required && !this._group) {\n throw new TypeError(\"No subcommand group selected\");\n }\n\n return this._group;\n }\n\n getFocused(): AutocompleteFocusedOption | null {\n return (this._hoistedOptions as AutocompleteFocusedOption[]).find((option) => option.focused) || null;\n }\n\n /**\n * Gets a boolean option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getBoolean(name: string, required?: boolean): boolean | null;\n getBoolean(name: string, required: true): boolean;\n getBoolean(name: string, required: boolean = false): boolean | null {\n const option = this.get(name, ApplicationCommandOptionType.Boolean, required);\n return option ? option.value : null;\n }\n\n /**\n * Gets a channel option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @param channelTypes The allowed types of channels. If empty, all channel types are allowed.\n * @returns The value of the option, or null if not set and not required.\n */\n getChannel(name: string, required: false, channelTypes: ChannelType[]): APIInteractionDataResolvedChannel | null;\n getChannel(name: string, required: true, channelTypes: ChannelType[]): APIInteractionDataResolvedChannel;\n getChannel(\n name: string,\n required: boolean = false,\n channelTypes: ChannelType[] = []\n ): APIInteractionDataResolvedChannel | null {\n const option = this.get(name, ApplicationCommandOptionType.Channel, required);\n const channel = option ? this._resolved.channels?.get(option.value) || null : null;\n\n if (channel && channelTypes.length > 0 && !channelTypes.includes(channel.type)) {\n throw new TypeError(\"Invalid channel type\", { cause: { name, type: channel.type, expected: channelTypes.join(\", \") } });\n }\n\n return channel;\n }\n\n /**\n * Gets a string option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getString<T extends string = string>(name: string, required?: boolean): T | null;\n getString<T extends string = string>(name: string, required: true): T;\n getString<T extends string = string>(name: string, required: boolean = false): T | null {\n const option = this.get(name, ApplicationCommandOptionType.String, required);\n return (option?.value as T) ?? null;\n }\n\n /**\n * Gets an integer option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getInteger(name: string, required?: boolean): number | null;\n getInteger(name: string, required: true): number;\n getInteger(name: string, required: boolean = false): number | null {\n const option = this.get(name, ApplicationCommandOptionType.Integer, required);\n return option?.value ?? null;\n }\n\n /**\n * Gets a number option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getNumber(name: string, required?: boolean): number | null;\n getNumber(name: string, required: true): number;\n getNumber(name: string, required: boolean = false): number | null {\n const option = this.get(name, ApplicationCommandOptionType.Number, required);\n return option?.value ?? null;\n }\n\n /**\n * Gets a user option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getUser(name: string, required?: boolean): APIUser | null;\n getUser(name: string, required: true): APIUser;\n getUser(name: string, required: boolean = false): APIUser | null {\n const option = this.get(name, ApplicationCommandOptionType.User, required);\n const user = option ? this._resolved.users?.get(option.value) || null : null;\n return user;\n }\n\n /**\n * Gets a member option.\n *\n * @param name The name of the option.\n * @returns The value of the option, or null if the user is not present in the guild or the option is not set.\n */\n getMember(name: string, required?: boolean): APIInteractionDataResolvedGuildMember | null;\n getMember(name: string, required: true): APIInteractionDataResolvedGuildMember;\n getMember(name: string, required: boolean = false): APIInteractionDataResolvedGuildMember | null {\n const option = this.get(name, ApplicationCommandOptionType.User, required);\n const member = option ? this._resolved.members?.get(option.value) || null : null;\n return member;\n }\n\n /**\n * Gets a role option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getRole(name: string, required?: boolean): APIRole | null;\n getRole(name: string, required: true): APIRole;\n getRole(name: string, required: boolean = false): APIRole | null {\n const option = this.get(name, ApplicationCommandOptionType.Role, required);\n const role = option ? this._resolved.roles?.get(option.value) || null : null;\n return role;\n }\n\n /**\n * Gets an attachment option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getAttachment(name: string, required?: boolean): APIAttachment | null;\n getAttachment(name: string, required: true): APIAttachment;\n getAttachment(name: string, required: boolean = false): APIAttachment | null {\n const option = this.get(name, ApplicationCommandOptionType.Attachment, required);\n const attachment = option ? this._resolved.attachments?.get(option.value) || null : null;\n return attachment;\n }\n\n /**\n * Gets a mentionable option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getMentionable(name: string, required?: boolean): APIInteractionDataResolvedGuildMember | APIUser | APIRole | null;\n getMentionable(name: string, required: true): APIInteractionDataResolvedGuildMember | APIUser | APIRole;\n getMentionable(name: string, required: boolean = false): (APIInteractionDataResolvedGuildMember | APIUser | APIRole) | null {\n const option = this.get(name, ApplicationCommandOptionType.Mentionable, required);\n const user = option ? this._resolved.users?.get(option.value) || null : null;\n const member = option ? this._resolved.members?.get(option.value) || null : null;\n const role = option ? this._resolved.roles?.get(option.value) || null : null;\n return member ?? user ?? role ?? null;\n }\n}\n\nexport { CommandInteractionOptionResolver };\n","import {\n type APIInteractionResponseCallbackData,\n type Snowflake,\n APIApplicationCommandAutocompleteInteraction,\n APIApplicationCommandInteraction,\n APIChatInputApplicationCommandInteraction,\n APIInteraction,\n APIMessageApplicationCommandInteraction,\n APIMessageComponentInteraction,\n APIModalSubmitInteraction,\n APIPartialInteractionGuild,\n APIUser,\n ComponentType,\n InteractionType,\n Locale,\n} from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { REST } from \"@discordjs/rest\";\nimport { ChatInputCommandInteraction } from \"./ChatInputInteraction\";\nimport { ModalInteraction } from \"./ModalInteraction\";\nimport type { BaseInteractionContext } from \"../types\";\n\nabstract class BaseInteraction<Type extends InteractionType> {\n public readonly type: Type;\n protected readonly data: Extract<APIInteraction, { type: Type }>;\n public readonly rest: REST;\n protected _ephemeral: boolean | null = null;\n protected replied: boolean = false;\n protected deferred: boolean = false;\n public readonly context: BaseInteractionContext;\n\n constructor(\n protected api: API,\n data: typeof this.data,\n context: BaseInteractionContext\n ) {\n this.type = data.type as Type;\n this.data = data;\n this.rest = api.rest;\n this.context = context;\n }\n\n get applicationId() {\n return this.data.application_id;\n }\n\n get entitlements() {\n return this.data.entitlements;\n }\n\n get channelId() {\n return this.data.channel?.id;\n }\n\n get channel() {\n return this.data.channel;\n }\n\n get guildId() {\n return this.data.guild_id;\n }\n\n get guild() {\n return this.data.guild;\n }\n\n get userId() {\n return this.data.user?.id;\n }\n\n get user() {\n return (this.data.member?.user || this.data.user) as APIUser; // One is always given.\n }\n\n get member() {\n return this.data.member;\n }\n\n get locale() {\n return this.data.guild_locale;\n }\n\n get guildLocale() {\n return this.data.guild_locale;\n }\n\n get token() {\n return this.data.token;\n }\n\n get id() {\n return this.data.id;\n }\n\n get appPermissions() {\n return this.data.app_permissions;\n }\n\n get version() {\n return this.data.version;\n }\n\n inGuild(): this is BaseInteraction<Type> & { guild_id: Snowflake; guild: APIPartialInteractionGuild; guild_locale: Locale } {\n return Boolean(this.data.guild_id && this.data.guild && this.data.guild_locale);\n }\n\n inDM(): this is BaseInteraction<Type> & { guild_id: undefined; guild: undefined; guild_locale: undefined } {\n return !this.inGuild();\n }\n\n getAppEntitlements() {\n return this.entitlements.filter((entitlement) => entitlement.application_id === this.applicationId);\n }\n\n guildHavePremium(): boolean {\n return (\n this.getAppEntitlements().filter(\n (entitlement) =>\n entitlement.guild_id === this.guildId && (!entitlement.ends_at || new Date(entitlement.ends_at) > new Date())\n ).length > 0\n );\n }\n\n userHavePremium(): boolean {\n return (\n this.getAppEntitlements().filter(\n (entitlement) =>\n entitlement.user_id === this.userId && (!entitlement.ends_at || new Date(entitlement.ends_at) > new Date())\n ).length > 0\n );\n }\n\n async reply(options: APIInteractionResponseCallbackData | string, forceEphemeral = true) {\n const replyOptions = typeof options === \"string\" ? { content: options } : options;\n if (forceEphemeral) {\n replyOptions.flags = (replyOptions.flags ?? 0) | 64;\n }\n const response = await this.api.interactions.reply(this.id, this.token, replyOptions, {\n signal: AbortSignal.timeout(5000),\n });\n this.replied = true;\n return response;\n }\n\n async deferReply(forceEphemeral = true) {\n const response = await this.api.interactions.defer(this.id, this.token, {\n flags: forceEphemeral ? 64 : undefined,\n });\n this.deferred = true;\n return response;\n }\n\n deferUpdate() {\n return this.api.interactions.deferMessageUpdate(this.id, this.token);\n }\n\n async editReply(options: APIInteractionResponseCallbackData | string, messageId: Snowflake | \"@original\" = \"@original\") {\n const replyOptions = typeof options === \"string\" ? { content: options } : options;\n const response = await this.api.interactions.editReply(this.applicationId, this.token, replyOptions, messageId, {\n signal: AbortSignal.timeout(5000),\n });\n this.replied = true;\n return response;\n }\n\n deleteReply(messageId?: Snowflake | \"@original\") {\n return this.api.interactions.deleteReply(this.applicationId, this.token, messageId);\n }\n\n async update(options: APIInteractionResponseCallbackData | string) {\n const updateOptions = typeof options === \"string\" ? { content: options } : options;\n const response = await this.api.interactions.updateMessage(this.id, this.token, updateOptions, {\n signal: AbortSignal.timeout(5000),\n });\n this.replied = true;\n return response;\n }\n\n // Typeguards\n isChatInputCommand(): this is ChatInputCommandInteraction {\n return this.type === InteractionType.ApplicationCommand;\n }\n\n isMessageContext(): this is APIMessageApplicationCommandInteraction {\n return this.type === InteractionType.ApplicationCommand && \"message\" in this.data;\n }\n\n isModal(): this is ModalInteraction {\n return this.type === InteractionType.ModalSubmit;\n }\n\n isMessageComponent(): this is APIMessageComponentInteraction {\n return this.type === InteractionType.MessageComponent;\n }\n\n isButton(): this is APIMessageComponentInteraction & { data: { component_type: ComponentType.Button } } {\n return this.isMessageComponent() && this.data.component_type === ComponentType.Button;\n }\n\n isStringSelect(): this is APIMessageComponentInteraction & {\n data: { component_type: Exclude<ComponentType, ComponentType.StringSelect> };\n } {\n return this.isMessageComponent() && this.data.component_type === ComponentType.StringSelect;\n }\n}\n\nexport { BaseInteraction };\n","import {\n InteractionType,\n type APIChatInputApplicationCommandInteraction,\n type APIModalInteractionResponseCallbackData,\n} from \"discord-api-types/v10\";\nimport { CommandInteractionOptionResolver } from \"@resolvers/CommandOptionResolver\";\nimport { ModalBuilder } from \"@discordjs/builders\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { BaseInteractionContext } from \"../types\";\n\nclass ChatInputCommandInteraction extends BaseInteraction<InteractionType.ApplicationCommand> {\n public readonly options: CommandInteractionOptionResolver;\n\n constructor(api: API, interaction: APIChatInputApplicationCommandInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.options = new CommandInteractionOptionResolver(interaction.data.options, interaction.data.resolved);\n }\n\n get commandName() {\n return this.data.data.name;\n }\n\n get commandId() {\n return this.data.data.id;\n }\n\n showModal(data: APIModalInteractionResponseCallbackData | ModalBuilder) {\n return this.api.interactions.createModal(this.id, this.token, data instanceof ModalBuilder ? data.toJSON() : data);\n }\n}\n\nexport { ChatInputCommandInteraction };\n","import type { APIInteraction, APIWebhookEvent } from \"discord-api-types/v10\";\nimport { cloneRawRequest, type HonoRequest } from \"hono/request\";\n\nexport const subtleCrypto = crypto.subtle;\n\n/**\n * Converts different types to Uint8Array.\n *\n * @param value - Value to convert. Strings are parsed as hex.\n * @param format - Format of value. Valid options: 'hex'. Defaults to utf-8.\n * @returns Value in Uint8Array form.\n */\nexport function valueToUint8Array(value: Uint8Array | ArrayBuffer | Buffer | string, format?: string): Uint8Array {\n if (value == null) {\n return new Uint8Array();\n }\n if (typeof value === \"string\") {\n if (format === \"hex\") {\n const matches = value.match(/.{1,2}/g);\n if (matches == null) {\n throw new Error(\"Value is not a valid hex string\");\n }\n const hexVal = matches.map((byte: string) => Number.parseInt(byte, 16));\n return new Uint8Array(hexVal);\n }\n\n return new TextEncoder().encode(value);\n }\n try {\n if (Buffer.isBuffer(value)) {\n return new Uint8Array(value);\n }\n } catch (_ex) {\n // Runtime doesn't have Buffer\n }\n if (value instanceof ArrayBuffer) {\n return new Uint8Array(value);\n }\n if (value instanceof Uint8Array) {\n return value;\n }\n throw new Error(\"Unrecognized value type, must be one of: string, Buffer, ArrayBuffer, Uint8Array\");\n}\n\n/**\n * Merge two arrays.\n *\n * @param arr1 - First array\n * @param arr2 - Second array\n * @returns Concatenated arrays\n */\nexport function concatUint8Arrays(arr1: Uint8Array, arr2: Uint8Array): Uint8Array {\n const merged = new Uint8Array(arr1.length + arr2.length);\n merged.set(arr1);\n merged.set(arr2, arr1.length);\n return merged;\n}\n\n/**\n * Validates a payload from Discord against its signature and key.\n *\n * @param rawBody - The raw payload data\n * @param signature - The signature from the `X-Signature-Ed25519` header\n * @param timestamp - The timestamp from the `X-Signature-Timestamp` header\n * @param clientPublicKey - The public key from the Discord developer dashboard\n * @returns Whether or not validation was successful\n */\nexport async function verifyKey(\n rawBody: Uint8Array | ArrayBuffer | Buffer | string,\n signature: string | null,\n timestamp: string | null,\n clientPublicKey: string | CryptoKey\n): Promise<boolean> {\n if (!signature || !timestamp) return false;\n try {\n const timestampData = valueToUint8Array(timestamp);\n const bodyData = valueToUint8Array(rawBody);\n const message = concatUint8Arrays(timestampData, bodyData);\n const publicKey =\n typeof clientPublicKey === \"string\"\n ? await subtleCrypto.importKey(\n \"raw\",\n valueToUint8Array(clientPublicKey, \"hex\"),\n {\n name: \"ed25519\",\n namedCurve: \"ed25519\",\n },\n false,\n [\"verify\"]\n )\n : clientPublicKey;\n const isValid = await subtleCrypto.verify(\n {\n name: \"ed25519\",\n },\n publicKey,\n valueToUint8Array(signature, \"hex\"),\n message\n );\n return isValid;\n } catch (_ex) {\n return false;\n }\n}\n\nexport async function verifyDiscordRequest<T extends APIInteraction | APIWebhookEvent = APIInteraction>(\n req: HonoRequest,\n discordPublicKey: string | CryptoKey\n) {\n const signature = req.header(\"x-signature-ed25519\");\n const timestamp = req.header(\"x-signature-timestamp\");\n const body = await (await cloneRawRequest(req)).text();\n const isValidRequest = signature && timestamp && (await verifyKey(body, signature, timestamp, discordPublicKey));\n if (!isValidRequest) {\n return { isValid: false } as const;\n }\n\n return { interaction: JSON.parse(body) as T, isValid: true } as const;\n}\n","export function parseCustomId(customId: string, onlyPrefix: true): string;\nexport function parseCustomId(\n customId: string,\n onlyPrefix?: false\n): {\n compPath: string[];\n prefix: string;\n lastPathItem: string;\n component: string | null;\n params: string[];\n firstParam: string | null;\n lastParam: string | null;\n};\n\n/**\n * Parses a custom ID into its components.\n *\n * @param customId - The custom ID to parse.\n * @param onlyPrefix - If true, only returns the prefix of the custom ID.\n * @returns An object containing the parsed components or just the prefix.\n *\n * A custom ID is expected to be in the format: \"prefix/component/other/path?param1/param2\"\n */\nexport function parseCustomId(customId: string, onlyPrefix: boolean = false) {\n if (onlyPrefix) {\n const match = customId.match(/^(.+?)(\\/|\\?)/i);\n return match ? match[1] : customId;\n }\n const [path, params] = customId.split(\"?\") as [string, string | undefined];\n const pathS = path.split(\"/\");\n const parms = params?.split(\"/\") || [];\n return {\n compPath: pathS,\n prefix: pathS[0],\n lastPathItem: pathS[pathS.length - 1],\n component: pathS[1] || null,\n params: parms || [],\n firstParam: parms[0] || null,\n lastParam: parms[parms.length - 1] || null,\n };\n}\n","import {\n APIUserApplicationCommandInteraction,\n APIUser,\n InteractionType,\n type APIModalInteractionResponseCallbackData,\n} from \"discord-api-types/v10\";\nimport { ModalBuilder } from \"@discordjs/builders\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { BaseInteractionContext } from \"../types\";\n\nclass UserCommandInteraction extends BaseInteraction<InteractionType.ApplicationCommand> {\n public readonly targetUser: APIUser;\n\n constructor(api: API, interaction: APIUserApplicationCommandInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.targetUser = interaction.data.resolved.users[interaction.data.target_id];\n }\n\n get commandName() {\n return this.data.data.name;\n }\n\n get commandId() {\n return this.data.data.id;\n }\n\n showModal(data: APIModalInteractionResponseCallbackData | ModalBuilder) {\n return this.api.interactions.createModal(this.id, this.token, data instanceof ModalBuilder ? data.toJSON() : data);\n }\n}\n\nexport { UserCommandInteraction };\n","import {\n APIMessage,\n APIMessageApplicationCommandInteraction,\n InteractionType,\n type APIModalInteractionResponseCallbackData,\n} from \"discord-api-types/v10\";\nimport { ModalBuilder } from \"@discordjs/builders\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { BaseInteractionContext } from \"../types\";\n\nclass MessageCommandInteraction extends BaseInteraction<InteractionType.ApplicationCommand> {\n public readonly targetMessage: APIMessage;\n\n constructor(api: API, interaction: APIMessageApplicationCommandInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.targetMessage = interaction.data.resolved.messages[interaction.data.target_id];\n }\n\n get commandName() {\n return this.data.data.name;\n }\n\n get commandId() {\n return this.data.data.id;\n }\n\n showModal(data: APIModalInteractionResponseCallbackData | ModalBuilder) {\n return this.api.interactions.createModal(this.id, this.token, data instanceof ModalBuilder ? data.toJSON() : data);\n }\n}\n\nexport { MessageCommandInteraction };\n","import {\n APIMessage,\n APIMessageComponentInteraction,\n APIModalInteractionResponseCallbackData,\n InteractionType,\n} from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { ModalBuilder } from \"@discordjs/builders\";\nimport type { BaseInteractionContext } from \"../types\";\n\nclass MessageComponentInteraction extends BaseInteraction<InteractionType.MessageComponent> {\n public readonly message?: APIMessage;\n public readonly custom_id: string;\n constructor(api: API, interaction: APIMessageComponentInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.custom_id = interaction.data.custom_id;\n\n if (\"message\" in interaction && interaction.message) {\n this.message = interaction.message;\n }\n }\n\n showModal(data: APIModalInteractionResponseCallbackData | ModalBuilder) {\n return this.api.interactions.createModal(this.id, this.token, data instanceof ModalBuilder ? data.toJSON() : data);\n }\n}\n\nexport { MessageComponentInteraction };\n","import {\n APIBaseComponent,\n APIInteractionDataResolved,\n APIInteractionDataResolvedChannel,\n APIInteractionDataResolvedGuildMember,\n APIRole,\n APIUser,\n ComponentType,\n ModalSubmitLabelComponent,\n ModalSubmitTextDisplayComponent,\n Snowflake,\n} from \"discord-api-types/v10\";\nimport { APIInteractionDataResolvedCollections } from \"../types\";\nimport { Collection, ReadonlyCollection } from \"@discordjs/collection\";\n\nexport interface BaseModalData<Type extends ComponentType> {\n id?: number;\n type: Type;\n}\n\nexport interface TextInputModalData extends BaseModalData<ComponentType.TextInput> {\n custom_id: string;\n value: string;\n}\n\nexport interface SelectMenuModalData extends BaseModalData<\n | ComponentType.ChannelSelect\n | ComponentType.MentionableSelect\n | ComponentType.RoleSelect\n | ComponentType.StringSelect\n | ComponentType.UserSelect\n> {\n channels?: ReadonlyCollection<Snowflake, APIInteractionDataResolvedChannel>;\n custom_id: string;\n members?: ReadonlyCollection<Snowflake, APIInteractionDataResolvedGuildMember>;\n roles?: ReadonlyCollection<Snowflake, APIRole>;\n users?: ReadonlyCollection<Snowflake, APIUser>;\n /**\n * The raw values selected by the user.\n */\n values: readonly string[];\n}\n\n// Technically, we had to add file uploads too, but we ain't using them anyway\ntype APIModalData = TextInputModalData | SelectMenuModalData;\n\nexport class ModalComponentResolver {\n private _resolved: APIInteractionDataResolvedCollections;\n private hoistedComponents: Collection<string, APIModalData>;\n\n constructor(\n private components: (ModalSubmitLabelComponent | ModalSubmitTextDisplayComponent)[],\n resolved?: APIInteractionDataResolved\n ) {\n this._resolved = Object.keys(resolved ?? {}).reduce((acc, key) => {\n const resolvedData = resolved?.[key as keyof APIInteractionDataResolved];\n const collection = new Collection(resolvedData ? Object.entries(resolvedData) : []);\n acc[key] = collection;\n return acc;\n }, {} as any);\n\n this.hoistedComponents = this.components.reduce(\n (accumulator, next) => {\n // For label components\n if (next.type === ComponentType.Label && next.component.type !== ComponentType.FileUpload) {\n accumulator.set(next.component.custom_id, next.component);\n }\n\n return accumulator;\n },\n new Collection() as Collection<string, APIModalData>\n );\n }\n\n public get data() {\n return this.hoistedComponents.map((component) => component);\n }\n\n getComponent(custom_id: string): APIModalData {\n const component = this.hoistedComponents.get(custom_id);\n\n if (!component) throw new TypeError(\"No component found with the provided custom_id.\");\n\n return component;\n }\n\n /**\n * Gets the value of a text input component.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a text input.\n * @returns The value of the text input, or null if not set and not required.\n */\n getString(custom_id: string, required?: boolean): string | null;\n getString(custom_id: string, required: true): string;\n getString(custom_id: string, required: boolean = false): string | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.TextInput) {\n throw new TypeError(\"Component is not a text input\", { cause: { custom_id, type: component.type } });\n }\n return component.value;\n }\n\n /**\n * Gets the selected values of a select menu component.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a select menu.\n * @returns The selected values, or null if not set and not required.\n */\n getSelectedValues(custom_id: string, required?: boolean): readonly string[] | null;\n getSelectedValues(custom_id: string, required: true): readonly string[];\n getSelectedValues(custom_id: string, required: boolean = false): readonly string[] | null {\n const component = this.getComponent(custom_id);\n if (!(\"values\" in component)) {\n throw new TypeError(\"Component is not a select menu\", { cause: { custom_id, type: component.type } });\n }\n return component.values;\n }\n\n /**\n * Gets the selected channels from a channel select menu.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a channel select.\n * @returns The selected channels, or null if not set and not required.\n */\n getSelectedChannels(custom_id: string, required?: boolean): APIInteractionDataResolvedChannel[] | null;\n getSelectedChannels(custom_id: string, required: true): APIInteractionDataResolvedChannel[];\n getSelectedChannels(custom_id: string, required: boolean = false): APIInteractionDataResolvedChannel[] | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.ChannelSelect) {\n throw new TypeError(\"Component is not a channel select\", { cause: { custom_id, type: component.type } });\n }\n const values = component.values;\n const channels = values.map((id) => this._resolved.channels?.get(id)).filter(Boolean) as APIInteractionDataResolvedChannel[];\n return channels.length > 0 ? channels : required ? [] : null;\n }\n\n /**\n * Gets the selected users from a user select menu.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a user select.\n * @returns The selected users, or null if not set and not required.\n */\n getSelectedUsers(custom_id: string, required?: boolean): APIUser[] | null;\n getSelectedUsers(custom_id: string, required: true): APIUser[];\n getSelectedUsers(custom_id: string, required: boolean = false): APIUser[] | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.UserSelect) {\n throw new TypeError(\"Component is not a user select\", { cause: { custom_id, type: component.type } });\n }\n const values = component.values;\n const users = values.map((id) => this._resolved.users?.get(id)).filter(Boolean) as APIUser[];\n return users.length > 0 ? users : required ? [] : null;\n }\n\n /**\n * Gets the selected members from a user select menu (if in guild).\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a user select.\n * @returns The selected members, or null if not set and not required.\n */\n getSelectedMembers(custom_id: string, required?: boolean): APIInteractionDataResolvedGuildMember[] | null;\n getSelectedMembers(custom_id: string, required: true): APIInteractionDataResolvedGuildMember[];\n getSelectedMembers(custom_id: string, required: boolean = false): APIInteractionDataResolvedGuildMember[] | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.UserSelect) {\n throw new TypeError(\"Component is not a user select\", { cause: { custom_id, type: component.type } });\n }\n const values = component.values;\n const members = values\n .map((id) => this._resolved.members?.get(id))\n .filter(Boolean) as APIInteractionDataResolvedGuildMember[];\n return members.length > 0 ? members : required ? [] : null;\n }\n\n /**\n * Gets the selected roles from a role select menu.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a role select.\n * @returns The selected roles, or null if not set and not required.\n */\n getSelectedRoles(custom_id: string, required?: boolean): APIRole[] | null;\n getSelectedRoles(custom_id: string, required: true): APIRole[];\n getSelectedRoles(custom_id: string, required: boolean = false): APIRole[] | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.RoleSelect) {\n throw new TypeError(\"Component is not a role select\", { cause: { custom_id, type: component.type } });\n }\n const values = component.values;\n const roles = values.map((id) => this._resolved.roles?.get(id)).filter(Boolean) as APIRole[];\n return roles.length > 0 ? roles : required ? [] : null;\n }\n\n /**\n * Gets the selected mentionables from a mentionable select menu.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a mentionable select.\n * @returns The selected mentionables (users, members, or roles), or null if not set and not required.\n */\n getSelectedMentionables(\n custom_id: string,\n required?: boolean\n ): (APIInteractionDataResolvedGuildMember | APIUser | APIRole)[] | null;\n getSelectedMentionables(custom_id: string, required: true): (APIInteractionDataResolvedGuildMember | APIUser | APIRole)[];\n getSelectedMentionables(\n custom_id: string,\n required: boolean = false\n ): (APIInteractionDataResolvedGuildMember | APIUser | APIRole)[] | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.MentionableSelect) {\n throw new TypeError(\"Component is not a mentionable select\", { cause: { custom_id, type: component.type } });\n }\n const values = component.values;\n const mentionables: (APIInteractionDataResolvedGuildMember | APIUser | APIRole)[] = [];\n for (const id of values) {\n const member = this._resolved.members?.get(id);\n if (member) mentionables.push(member);\n else {\n const user = this._resolved.users?.get(id);\n if (user) mentionables.push(user);\n else {\n const role = this._resolved.roles?.get(id);\n if (role) mentionables.push(role);\n }\n }\n }\n return mentionables.length > 0 ? mentionables : required ? [] : null;\n }\n}\n","import {\n APIMessage,\n APIModalSubmitInteraction,\n InteractionType,\n ModalSubmitLabelComponent,\n ModalSubmitTextDisplayComponent,\n} from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { ModalComponentResolver } from \"@resolvers/ModalComponentResolver\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { BaseInteractionContext } from \"../types\";\n\nclass ModalInteraction extends BaseInteraction<InteractionType.ModalSubmit> {\n public readonly fields: ModalComponentResolver;\n public readonly message?: APIMessage;\n public readonly custom_id: string;\n\n constructor(api: API, interaction: APIModalSubmitInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.custom_id = interaction.data.custom_id;\n this.fields = new ModalComponentResolver(\n interaction.data.components as (ModalSubmitLabelComponent | ModalSubmitTextDisplayComponent)[],\n interaction.data.resolved\n );\n if (\"message\" in interaction && interaction.message) {\n this.message = interaction.message;\n }\n }\n}\n\nexport { ModalInteraction };\n","import {\n APIApplicationCommandAutocompleteInteraction,\n APIApplicationCommandOptionChoice,\n InteractionType,\n type APIChatInputApplicationCommandInteraction,\n} from \"discord-api-types/v10\";\nimport { CommandInteractionOptionResolver } from \"@resolvers/CommandOptionResolver\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { BaseInteractionContext } from \"../types\";\n\nclass AutocompleteInteraction extends BaseInteraction<InteractionType.ApplicationCommandAutocomplete> {\n public readonly options: CommandInteractionOptionResolver;\n public responded = false;\n\n constructor(api: API, interaction: APIApplicationCommandAutocompleteInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.options = new CommandInteractionOptionResolver(interaction.data.options, interaction.data.resolved);\n }\n\n get commandName() {\n return this.data.data.name;\n }\n\n get commandId() {\n return this.data.data.id;\n }\n\n async respond(choices: APIApplicationCommandOptionChoice[]) {\n await this.api.interactions.createAutocompleteResponse(this.id, this.token, { choices });\n this.responded = true;\n }\n}\n\nexport { AutocompleteInteraction };\n","import type { ChatInputCommandInteraction } from \"./ChatInputInteraction\";\nimport type { AutocompleteInteraction } from \"./AutocompleteInteraction\";\nimport type { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport type { ModalInteraction } from \"./ModalInteraction\";\nimport { ContextMenuCommandBuilder, SlashCommandBuilder } from \"@discordjs/builders\";\nimport { ApplicationCommandType } from \"discord-api-types/v10\";\nimport { MessageCommandInteraction } from \"./MessageContextCommandInteraction\";\nimport { UserCommandInteraction } from \"./UserContextCommandInteraction\";\n\n/**\n * Handler for chat input commands with optional autocomplete support\n */\nexport class SlashCommandHandler extends SlashCommandBuilder {\n private handlerFn?: (interaction: ChatInputCommandInteraction) => Promise<void> | void;\n private autocompleteFn?: (interaction: AutocompleteInteraction) => Promise<void> | void;\n\n /**\n * Executes the command handler\n */\n async execute(interaction: ChatInputCommandInteraction): Promise<void> {\n if (!this.handlerFn) {\n throw new Error(`Command \"${this.name}\" does not have a handler`);\n }\n await this.handlerFn(interaction);\n }\n\n /**\n * Executes the autocomplete handler if it exists\n */\n async executeAutocomplete(interaction: AutocompleteInteraction): Promise<void> {\n if (this.autocompleteFn == undefined) {\n throw new Error(`Command \"${this.name}\" does not have an autocomplete handler`);\n }\n await this.autocompleteFn(interaction);\n }\n}\n\nexport class ContextCommandHandler<\n T extends ApplicationCommandType = ApplicationCommandType,\n InteractionData = T extends ApplicationCommandType.User ? UserCommandInteraction : MessageCommandInteraction,\n> extends ContextMenuCommandBuilder {\n private handlerFn?: (interaction: InteractionData) => Promise<void> | void;\n\n /**\n * Executes the command handler\n */\n async execute(interaction: InteractionData): Promise<void> {\n if (!this.handlerFn) {\n throw new Error(`Command \"${this.name}\" does not have a handler`);\n }\n await this.handlerFn(interaction);\n }\n}\n\n/**\n * Handler for message components (buttons, select menus) based on custom ID prefix\n */\nexport class ComponentHandler {\n public readonly prefix: string;\n private handlerFn: (interaction: MessageComponentInteraction) => Promise<void> | void;\n\n constructor(prefix: string, handler: (interaction: MessageComponentInteraction) => Promise<void> | void) {\n if (!prefix || typeof prefix !== \"string\") {\n throw new TypeError(\"Component handler prefix must be a non-empty string\");\n }\n if (typeof handler !== \"function\") {\n throw new TypeError(\"Component handler must be a function\");\n }\n\n this.prefix = prefix;\n this.handlerFn = handler;\n }\n\n /**\n * Executes the component handler\n */\n async execute(interaction: MessageComponentInteraction): Promise<void> {\n await this.handlerFn(interaction);\n }\n\n /**\n * Checks if this handler matches the given custom ID\n */\n matches(customId: string): boolean {\n // Extract prefix from custom ID (everything before first / or ?)\n const match = customId.match(/^(.+?)(\\/|\\?|$)/);\n const prefix = match ? match[1] : customId;\n return prefix === this.prefix;\n }\n}\n\n/**\n * Handler for modal submits based on custom ID prefix\n */\nexport class ModalHandler {\n public readonly prefix: string;\n private handlerFn: (interaction: ModalInteraction) => Promise<void> | void;\n\n constructor(prefix: string, handler: (interaction: ModalInteraction) => Promise<void> | void) {\n if (!prefix || typeof prefix !== \"string\") {\n throw new TypeError(\"Modal handler prefix must be a non-empty string\");\n }\n if (typeof handler !== \"function\") {\n throw new TypeError(\"Modal handler must be a function\");\n }\n\n this.prefix = prefix;\n this.handlerFn = handler;\n }\n\n /**\n * Executes the modal handler\n */\n async execute(interaction: ModalInteraction): Promise<void> {\n await this.handlerFn(interaction);\n }\n\n /**\n * Checks if this handler matches the given custom ID\n */\n matches(customId: string): boolean {\n // Extract prefix from custom ID (everything before first / or ?)\n const match = customId.match(/^(.+?)(\\/|\\?|$)/);\n const prefix = match ? match[1] : customId;\n return prefix === this.prefix;\n }\n}\n\n/**\n * Union type of all possible handlers\n */\nexport type Handler = SlashCommandHandler | ContextCommandHandler | ComponentHandler | ModalHandler;\n","import {\n APIApplicationCommandAutocompleteInteraction,\n APIApplicationCommandInteraction,\n ApplicationCommandType,\n InteractionResponseType,\n InteractionType,\n} from \"discord-api-types/v10\";\nimport { ChatInputCommandInteraction } from \"@ctx/ChatInputInteraction\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { REST } from \"@discordjs/rest\";\nimport { Hono } from \"hono\";\nimport { verifyDiscordRequest } from \"@utils/discordVerify\";\nimport { parseCustomId } from \"@utils/index\";\nimport type { BaseVariables, BaseInteractionContext, ValidInteraction } from \"./types\";\nimport { UserCommandInteraction } from \"@ctx/UserContextCommandInteraction\";\nimport { MessageCommandInteraction } from \"@ctx/MessageContextCommandInteraction\";\nimport { MessageComponentInteraction } from \"@ctx/MessageComponentInteraction\";\nimport { ModalInteraction } from \"@ctx/ModalInteraction\";\nimport { AutocompleteInteraction } from \"@ctx/AutocompleteInteraction\";\nimport { SlashCommandHandler, ContextCommandHandler, ComponentHandler, ModalHandler, type Handler } from \"@ctx/handlers\";\n\ninterface HonocordOptions {\n /**\n * Indicates whether the Honocord instance is running on Cloudflare Workers.\n *\n * This affects how interactions are processed, allowing for asynchronous handling using the Workers' execution context.\n *\n * @default process.env.IS_CF_WORKER === \"true\"\n */\n isCFWorker?: boolean;\n}\n\nexport class Honocord {\n private commandHandlers: Map<string, SlashCommandHandler | ContextCommandHandler> = new Map();\n private componentHandlers: ComponentHandler[] = [];\n private modalHandlers: ModalHandler[] = [];\n private isCFWorker: boolean;\n\n constructor({ isCFWorker }: { isCFWorker?: boolean } = {}) {\n this.isCFWorker = isCFWorker ?? process.env.IS_CF_WORKER === \"true\";\n }\n\n /**\n * Registers handlers for interactions.\n *\n * @param handlers - Array of CommandHandler, ComponentHandler, or ModalHandler instances\n *\n * @example\n * ```typescript\n * import { HonoCord, CommandHandler, ComponentHandler, ModalHandler, HonocordSlashCommandBuilder } from \"honocord\";\n *\n * const honoCord = new Honocord();\n *\n * // Command handler with autocomplete\n * const searchCommand = new HonocordSlashCommandBuilder()\n * .setName(\"search\")\n * .setDescription(\"Search for something\")\n * .addStringOption(option =>\n * option.setName(\"query\")\n * .setDescription(\"Search query\")\n * .setAutocomplete(true)\n * )\n * .handler(async (interaction) => {\n * const query = interaction.options.getString(\"query\", true);\n * await interaction.reply(`Searching for: ${query}`);\n * })\n * .autocomplete(async (interaction) => {\n * const focused = interaction.options.getFocused();\n * await interaction.respond([\n * { name: \"Option 1\", value: \"opt1\" },\n * { name: \"Option 2\", value: \"opt2\" }\n * ]);\n * });\n *\n * // Component handler (for buttons, select menus with custom_id prefix)\n * const buttonHandler = new ComponentHandler(\"mybutton\", async (interaction) => {\n * await interaction.reply(\"Button clicked!\");\n * });\n *\n * // Modal handler (for modals with custom_id prefix)\n * const modalHandler = new ModalHandler(\"mymodal\", async (interaction) => {\n * const value = interaction.fields.getTextInputValue(\"field_id\");\n * await interaction.reply(`You submitted: ${value}`);\n * });\n *\n * honoCord.loadHandlers(\n * new CommandHandler(searchCommand),\n * buttonHandler,\n * modalHandler\n * );\n * ```\n */\n loadHandlers(...handlers: Handler[]): void {\n for (const handler of handlers) {\n if (handler instanceof SlashCommandHandler || handler instanceof ContextCommandHandler) {\n if (this.commandHandlers.has(handler.name)) {\n console.warn(`Command handler for \"${handler.name}\" already exists. Overwriting.`);\n }\n this.commandHandlers.set(handler.name, handler);\n } else if (handler instanceof ComponentHandler) {\n // Check for duplicate prefixes\n const existing = this.componentHandlers.find((h) => h.prefix === handler.prefix);\n if (existing) {\n console.warn(`Component handler with prefix \"${handler.prefix}\" already exists. Overwriting.`);\n this.componentHandlers = this.componentHandlers.filter((h) => h.prefix !== handler.prefix);\n }\n this.componentHandlers.push(handler);\n } else if (handler instanceof ModalHandler) {\n // Check for duplicate prefixes\n const existing = this.modalHandlers.find((h) => h.prefix === handler.prefix);\n if (existing) {\n console.warn(`Modal handler with prefix \"${handler.prefix}\" already exists. Overwriting.`);\n this.modalHandlers = this.modalHandlers.filter((h) => h.prefix !== handler.prefix);\n }\n this.modalHandlers.push(handler);\n }\n }\n }\n\n private createCommandInteraction(ctx: BaseInteractionContext, interaction: APIApplicationCommandInteraction, api: API) {\n switch (interaction.data.type) {\n case ApplicationCommandType.ChatInput:\n return new ChatInputCommandInteraction(api, interaction as any, ctx);\n case ApplicationCommandType.User:\n return new UserCommandInteraction(api, interaction as any, ctx);\n case ApplicationCommandType.Message:\n return new MessageCommandInteraction(api, interaction as any, ctx);\n default:\n throw new Error(\n `Unsupported application command type: ${interaction.data.type} (${ApplicationCommandType[interaction.data.type]})`\n );\n }\n }\n\n private async handleCommandInteraction(ctx: BaseInteractionContext, interaction: APIApplicationCommandInteraction, api: API) {\n const interactionObj = this.createCommandInteraction(ctx, interaction, api);\n const commandName = interaction.data.name;\n const handler = this.commandHandlers.get(commandName);\n\n if (handler) {\n try {\n if (handler instanceof SlashCommandHandler && interaction.data.type === ApplicationCommandType.ChatInput) {\n await handler.execute(interactionObj as ChatInputCommandInteraction);\n } else if (handler instanceof ContextCommandHandler) {\n if (interaction.data.type === ApplicationCommandType.User) {\n await handler.execute(interactionObj as UserCommandInteraction);\n } else if (interaction.data.type === ApplicationCommandType.Message) {\n await handler.execute(interactionObj as MessageCommandInteraction);\n }\n }\n } catch (error) {\n console.error(`Error executing command handler for \"${commandName}\":`, error);\n throw error;\n }\n }\n\n return interactionObj;\n }\n\n private async handleAutocompleteInteraction(\n ctx: BaseInteractionContext,\n interaction: APIApplicationCommandAutocompleteInteraction,\n api: API\n ) {\n const interactionObj = new AutocompleteInteraction(api, interaction, ctx);\n const commandName = interaction.data.name;\n const handler = this.commandHandlers.get(commandName);\n\n if (handler && handler instanceof SlashCommandHandler) {\n try {\n await handler.executeAutocomplete(interactionObj);\n } catch (error) {\n console.error(`Error executing autocomplete handler for \"${commandName}\":`, error);\n throw error;\n }\n }\n\n return interactionObj;\n }\n\n private async handleComponentInteraction(\n ctx: BaseInteractionContext,\n interaction: Extract<ValidInteraction, { type: InteractionType.MessageComponent }>,\n api: API\n ) {\n const interactionObj = new MessageComponentInteraction(api, interaction, ctx);\n const customId = interaction.data.custom_id;\n const prefix = parseCustomId(customId, true);\n\n // Find matching handler by prefix\n const handler = this.componentHandlers.find((h) => h.matches(customId));\n\n if (handler) {\n try {\n await handler.execute(interactionObj);\n } catch (error) {\n console.error(`Error executing component handler for prefix \"${prefix}\":`, error);\n throw error;\n }\n }\n\n return interactionObj;\n }\n\n private async handleModalInteraction(\n ctx: BaseInteractionContext,\n interaction: Extract<ValidInteraction, { type: InteractionType.ModalSubmit }>,\n api: API\n ) {\n const interactionObj = new ModalInteraction(api, interaction, ctx);\n const customId = interaction.data.custom_id;\n const prefix = parseCustomId(customId, true);\n\n // Find matching handler by prefix\n const handler = this.modalHandlers.find((h) => h.matches(customId));\n\n if (handler) {\n try {\n await handler.execute(interactionObj);\n } catch (error) {\n console.error(`Error executing modal handler for prefix \"${prefix}\":`, error);\n throw error;\n }\n }\n\n return interactionObj;\n }\n\n private async createInteraction(ctx: BaseInteractionContext, interaction: ValidInteraction) {\n const api = new API(new REST({ authPrefix: \"Bot\" }).setToken(ctx.env.DISCORD_TOKEN as string));\n\n switch (interaction.type) {\n case InteractionType.ApplicationCommand:\n return await this.handleCommandInteraction(ctx, interaction, api);\n case InteractionType.MessageComponent:\n return await this.handleComponentInteraction(ctx, interaction, api);\n case InteractionType.ModalSubmit:\n return await this.handleModalInteraction(ctx, interaction, api);\n case InteractionType.ApplicationCommandAutocomplete:\n return await this.handleAutocompleteInteraction(ctx, interaction, api);\n default:\n throw new Error(`Unknown interaction type: ${(interaction as any).type} (${InteractionType[(interaction as any).type]})`);\n }\n }\n\n /**\n * Returns a Hono handler for POST Requests handling Discord interactions.\n *\n * It is important, that\n *\n * @example\n * ```typescript\n * import { Hono } from \"hono\";\n * import { HonoCord } from \"honocord\";\n *\n * const app = new Hono();\n * const honoCord = new Honocord();\n *\n * app.post(\"/interactions\", honoCord.handle);\n *\n * export default app;\n * ```\n */\n handle = async (c: BaseInteractionContext) => {\n // Check if running on CF Workers\n const isCFWorker = this.isCFWorker || c.env.IS_CF_WORKER === \"true\";\n\n // Verify the request\n const { isValid, interaction } = await verifyDiscordRequest(c.req, c.env.DISCORD_PUBLIC_KEY as string);\n if (!isValid) {\n return c.text(\"Bad request signature.\", 401);\n } else if (!interaction) {\n console.log(\"No interaction found in request\");\n return c.text(\"No interaction found.\", 400);\n }\n\n if (interaction.type === InteractionType.Ping) {\n return c.json({ type: InteractionResponseType.Pong });\n }\n\n // Handle CF Workers execution context\n if (isCFWorker && c.executionCtx?.waitUntil) {\n // Process interaction asynchronously\n c.executionCtx.waitUntil(\n new Promise(async (resolve) => {\n try {\n await this.createInteraction(c, interaction);\n } catch (error) {\n console.error(\"Error handling interaction:\", error);\n }\n resolve(undefined);\n })\n );\n return c.json({}, 202); // Accepted for processing\n }\n\n // Standard non-CF Workers execution\n try {\n await this.createInteraction(c, interaction);\n } catch (error) {\n console.error(\"Error handling interaction:\", error);\n return c.text(\"Internal server error.\", 500);\n }\n };\n\n /**\n * Returns a Hono App instance with the interaction handler mounted at the root path and a GET Handler for all paths, which returns a simple Health response.\n *\n * @exampletypescript\n * ```typescript\n * import { Honocord } from \"honocord\";\n *\n * const honoCord = new Honocord();\n *\n * export default honoCord.getApp();\n * ```\n */\n getApp() {\n const app = new Hono<{ Variables: BaseVariables }>();\n app.get(\"*\", (c) => c.text(\"🔥 HonoCord is running!\"));\n app.post(\"/\", this.handle);\n return app;\n }\n}\n","// From discord.js\nexport const Colors = {\n Aqua: 0x1abc9c,\n Blue: 0x3498db,\n Blurple: 0x5865f2,\n DarkAqua: 0x11806a,\n DarkBlue: 0x206694,\n DarkButNotBlack: 0x2c2f33,\n DarkerGrey: 0x7f8c8d,\n DarkGold: 0xc27c0e,\n DarkGreen: 0x1f8b4c,\n DarkGrey: 0x979c9f,\n DarkNavy: 0x2c3e50,\n DarkOrange: 0xa84300,\n DarkPurple: 0x71368a,\n DarkRed: 0x992d22,\n DarkVividPink: 0xad1457,\n Default: 0x000000,\n Fuchsia: 0xeb459e,\n Gold: 0xf1c40f,\n Green: 0x57f287,\n Grey: 0x95a5a6,\n Greyple: 0x99aab5,\n LightGrey: 0xbcc0c0,\n LuminousVividPink: 0xe91e63,\n Navy: 0x34495e,\n NotQuiteBlack: 0x23272a,\n Orange: 0xe67e22,\n Purple: 0x9b59b6,\n Red: 0xed4245,\n White: 0xffffff,\n Yellow: 0xfee75c,\n} as const;\n"],"mappings":";;;;;;;;;;;;AAqCA,IAAM,mCAAN,MAAuC;;;;CAIrC,AAAQ,SAAwB;;;;CAIhC,AAAQ,cAA6B;;;;;CAKrC,AAAQ;CAIR,AAAQ;CAER,YACE,SAKA,UACA;AACA,OAAK,kBAAkB,WAAW,EAAE;AACpC,OAAK,YAAY,OAAO,KAAK,YAAY,EAAE,CAAC,CAAC,QAAQ,KAAK,QAAQ;GAChE,MAAM,eAAe,WAAW;AAEhC,OAAI,OADe,IAAI,WAAW,eAAe,OAAO,QAAQ,aAAa,GAAG,EAAE,CAAC;AAEnF,UAAO;KACN,EAAE,CAAmD;AAGxD,MAAI,KAAK,gBAAgB,IAAI,SAAS,6BAA6B,iBAAiB;AAClF,QA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E3C,KAAE,aAAa,UACb,IAAI,QAAQ,OAAO,YAAY;AAC7B,QAAI;AACF,WAAM,KAAK,kBAAkB,GAAG,YAAY;aACrC,OAAO;AACd,aAAQ,MAAM,+BAA+B,MAAM;;AAErD,YAAQ,OAAU;KAClB,CACH;AACD,UAAO,EAAE,KAAK,EAAE,EAAE,IAAI;;AAIxB,MAAI;AACF,SAAM,KAAK,kBAAkB,GAAG,YAAY;WACrC,OAAO;AACd,WAAQ,MAAM,+BAA+B,MAAM;AACnD,UAAO,EAAE,KAAK,0BAA0B,IAAI;;;;;;;;;;;;;;;CAgBhD,SAAS;EACP,MAAM,MAAM,IAAI,MAAoC;AACpD,MAAI,IAAI,MAAM,MAAM,EAAE,KAAK,0BAA0B,CAAC;AACtD,MAAI,KAAK,KAAK,KAAK,OAAO;AAC1B,SAAO;;;;;;AChUX,MAAa,SAAS;CACpB,MAAM;CACN,MAAM;CACN,SAAS;CACT,UAAU;CACV,UAAU;CACV,iBAAiB;CACjB,YAAY;CACZ,UAAU;CACV,WAAW;CACX,UAAU;CACV,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,SAAS;CACT,eAAe;CACf,SAAS;CACT,SAAS;CACT,MAAM;CACN,OAAO;CACP,MAAM;CACN,SAAS;CACT,WAAW;CACX,mBAAmB;CACnB,MAAM;CACN,eAAe;CACf,QAAQ;CACR,QAAQ;CACR,KAAK;CACL,OAAO;CACP,QAAQ;CACT"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/resolvers/CommandOptionResolver.ts","../src/interactions/BaseInteraction.ts","../src/interactions/ChatInputInteraction.ts","../src/utils/discordVerify.ts","../src/utils/index.ts","../src/interactions/UserContextCommandInteraction.ts","../src/interactions/MessageContextCommandInteraction.ts","../src/interactions/MessageComponentInteraction.ts","../src/resolvers/ModalComponentResolver.ts","../src/interactions/ModalInteraction.ts","../src/interactions/AutocompleteInteraction.ts","../src/interactions/handlers.ts","../src/Honocord.ts","../src/utils/Colors.ts"],"sourcesContent":["import { Collection } from \"@discordjs/collection\";\nimport {\n APIApplicationCommandInteractionDataOption,\n APIAttachment,\n APIInteractionDataResolved,\n APIInteractionDataResolvedChannel,\n APIInteractionDataResolvedGuildMember,\n APIRole,\n APIUser,\n ApplicationCommandOptionType,\n ChannelType,\n InteractionType,\n} from \"discord-api-types/v10\";\nimport { APIInteractionDataResolvedCollections } from \"../types\";\n\ntype AutocompleteFocusedOption = {\n /**\n * The name of the option.\n */\n name: string;\n /**\n * The type of the application command option.\n */\n type: ApplicationCommandOptionType;\n /**\n * The value of the option.\n */\n value: string;\n /**\n * Whether the option is focused.\n */\n focused: boolean;\n};\n\n/**\n * A resolver for command interaction options.\n */\nclass CommandInteractionOptionResolver {\n /**\n * The name of the subcommand group.\n */\n private _group: string | null = null;\n /**\n * The name of the subcommand.\n */\n private _subcommand: string | null = null;\n /**\n * The bottom-level options for the interaction.\n * If there is a subcommand (or subcommand and group), this is the options for the subcommand.\n */\n private _hoistedOptions: APIApplicationCommandInteractionDataOption<\n InteractionType.ApplicationCommand | InteractionType.ApplicationCommandAutocomplete\n >[];\n\n private _resolved: APIInteractionDataResolvedCollections;\n\n constructor(\n options:\n | APIApplicationCommandInteractionDataOption<\n InteractionType.ApplicationCommand | InteractionType.ApplicationCommandAutocomplete\n >[]\n | undefined,\n resolved: APIInteractionDataResolved | undefined\n ) {\n this._hoistedOptions = options ?? [];\n this._resolved = Object.keys(resolved ?? {}).reduce((acc, key) => {\n const resolvedData = resolved?.[key as keyof APIInteractionDataResolved];\n const collection = new Collection(resolvedData ? Object.entries(resolvedData) : []);\n acc[key as keyof APIInteractionDataResolvedCollections] = collection;\n return acc;\n }, {} as Partial<APIInteractionDataResolvedCollections>);\n\n // Hoist subcommand group if present\n if (this._hoistedOptions[0]?.type === ApplicationCommandOptionType.SubcommandGroup) {\n this._group = this._hoistedOptions[0].name;\n this._hoistedOptions = this._hoistedOptions[0].options ?? [];\n }\n\n // Hoist subcommand if present\n if (this._hoistedOptions[0]?.type === ApplicationCommandOptionType.Subcommand) {\n this._subcommand = this._hoistedOptions[0].name;\n this._hoistedOptions = this._hoistedOptions[0].options ?? [];\n }\n }\n\n public get data() {\n return this._hoistedOptions;\n }\n\n /**\n * Gets an option by its name.\n *\n * @param name The name of the option.\n * @param type The expected type of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The option, if found.\n */\n get<T extends ApplicationCommandOptionType>(name: string, type: T, required = false) {\n const option = this._hoistedOptions.find((opt) => opt.name === name);\n if (!option) {\n if (required) {\n throw new TypeError(\"Option not found\", { cause: { name } });\n }\n\n return null;\n }\n\n if (option.type !== type) {\n throw new TypeError(\"Option type mismatch\", { cause: { name, type: option.type, expected: type } });\n }\n\n return option as Extract<APIApplicationCommandInteractionDataOption<InteractionType.ApplicationCommand>, { type: T }>;\n }\n\n /**\n * Gets the selected subcommand.\n *\n * @param {boolean} [required=true] Whether to throw an error if there is no subcommand.\n * @returns {?string} The name of the selected subcommand, or null if not set and not required.\n */\n getSubcommand(): string | null;\n getSubcommand(required: true): string;\n getSubcommand(required: boolean = true): string | null {\n if (required && !this._subcommand) {\n throw new TypeError(\"No subcommand selected\");\n }\n\n return this._subcommand;\n }\n\n /**\n * Gets the selected subcommand group.\n *\n * @param required Whether to throw an error if there is no subcommand group.\n * @returns The name of the selected subcommand group, or null if not set and not required.\n */\n getSubcommandGroup(required?: boolean): string | null;\n getSubcommandGroup(required: true): string;\n getSubcommandGroup(required: boolean = false): string | null {\n if (required && !this._group) {\n throw new TypeError(\"No subcommand group selected\");\n }\n\n return this._group;\n }\n\n getFocused(): AutocompleteFocusedOption | null {\n return (this._hoistedOptions as AutocompleteFocusedOption[]).find((option) => option.focused) || null;\n }\n\n /**\n * Gets a boolean option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getBoolean(name: string, required?: boolean): boolean | null;\n getBoolean(name: string, required: true): boolean;\n getBoolean(name: string, required: boolean = false): boolean | null {\n const option = this.get(name, ApplicationCommandOptionType.Boolean, required);\n return option ? option.value : null;\n }\n\n /**\n * Gets a channel option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @param channelTypes The allowed types of channels. If empty, all channel types are allowed.\n * @returns The value of the option, or null if not set and not required.\n */\n getChannel(name: string, required: false, channelTypes: ChannelType[]): APIInteractionDataResolvedChannel | null;\n getChannel(name: string, required: true, channelTypes: ChannelType[]): APIInteractionDataResolvedChannel;\n getChannel(\n name: string,\n required: boolean = false,\n channelTypes: ChannelType[] = []\n ): APIInteractionDataResolvedChannel | null {\n const option = this.get(name, ApplicationCommandOptionType.Channel, required);\n const channel = option ? this._resolved.channels?.get(option.value) || null : null;\n\n if (channel && channelTypes.length > 0 && !channelTypes.includes(channel.type)) {\n throw new TypeError(\"Invalid channel type\", { cause: { name, type: channel.type, expected: channelTypes.join(\", \") } });\n }\n\n return channel;\n }\n\n /**\n * Gets a string option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getString<T extends string = string>(name: string, required?: boolean): T | null;\n getString<T extends string = string>(name: string, required: true): T;\n getString<T extends string = string>(name: string, required: boolean = false): T | null {\n const option = this.get(name, ApplicationCommandOptionType.String, required);\n return (option?.value as T) ?? null;\n }\n\n /**\n * Gets an integer option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getInteger(name: string, required?: boolean): number | null;\n getInteger(name: string, required: true): number;\n getInteger(name: string, required: boolean = false): number | null {\n const option = this.get(name, ApplicationCommandOptionType.Integer, required);\n return option?.value ?? null;\n }\n\n /**\n * Gets a number option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getNumber(name: string, required?: boolean): number | null;\n getNumber(name: string, required: true): number;\n getNumber(name: string, required: boolean = false): number | null {\n const option = this.get(name, ApplicationCommandOptionType.Number, required);\n return option?.value ?? null;\n }\n\n /**\n * Gets a user option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getUser(name: string, required?: boolean): APIUser | null;\n getUser(name: string, required: true): APIUser;\n getUser(name: string, required: boolean = false): APIUser | null {\n const option = this.get(name, ApplicationCommandOptionType.User, required);\n const user = option ? this._resolved.users?.get(option.value) || null : null;\n return user;\n }\n\n /**\n * Gets a member option.\n *\n * @param name The name of the option.\n * @returns The value of the option, or null if the user is not present in the guild or the option is not set.\n */\n getMember(name: string, required?: boolean): APIInteractionDataResolvedGuildMember | null;\n getMember(name: string, required: true): APIInteractionDataResolvedGuildMember;\n getMember(name: string, required: boolean = false): APIInteractionDataResolvedGuildMember | null {\n const option = this.get(name, ApplicationCommandOptionType.User, required);\n const member = option ? this._resolved.members?.get(option.value) || null : null;\n return member;\n }\n\n /**\n * Gets a role option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getRole(name: string, required?: boolean): APIRole | null;\n getRole(name: string, required: true): APIRole;\n getRole(name: string, required: boolean = false): APIRole | null {\n const option = this.get(name, ApplicationCommandOptionType.Role, required);\n const role = option ? this._resolved.roles?.get(option.value) || null : null;\n return role;\n }\n\n /**\n * Gets an attachment option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getAttachment(name: string, required?: boolean): APIAttachment | null;\n getAttachment(name: string, required: true): APIAttachment;\n getAttachment(name: string, required: boolean = false): APIAttachment | null {\n const option = this.get(name, ApplicationCommandOptionType.Attachment, required);\n const attachment = option ? this._resolved.attachments?.get(option.value) || null : null;\n return attachment;\n }\n\n /**\n * Gets a mentionable option.\n *\n * @param name The name of the option.\n * @param required Whether to throw an error if the option is not found.\n * @returns The value of the option, or null if not set and not required.\n */\n getMentionable(name: string, required?: boolean): APIInteractionDataResolvedGuildMember | APIUser | APIRole | null;\n getMentionable(name: string, required: true): APIInteractionDataResolvedGuildMember | APIUser | APIRole;\n getMentionable(name: string, required: boolean = false): (APIInteractionDataResolvedGuildMember | APIUser | APIRole) | null {\n const option = this.get(name, ApplicationCommandOptionType.Mentionable, required);\n const user = option ? this._resolved.users?.get(option.value) || null : null;\n const member = option ? this._resolved.members?.get(option.value) || null : null;\n const role = option ? this._resolved.roles?.get(option.value) || null : null;\n return member ?? user ?? role ?? null;\n }\n}\n\nexport { CommandInteractionOptionResolver };\n","import {\n type APIInteractionResponseCallbackData,\n type Snowflake,\n APIApplicationCommandAutocompleteInteraction,\n APIApplicationCommandInteraction,\n APIChatInputApplicationCommandInteraction,\n APIInteraction,\n APIMessageApplicationCommandInteraction,\n APIMessageComponentInteraction,\n APIModalSubmitInteraction,\n APIPartialInteractionGuild,\n APIUser,\n ComponentType,\n InteractionType,\n Locale,\n} from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { REST } from \"@discordjs/rest\";\nimport { ChatInputCommandInteraction } from \"./ChatInputInteraction\";\nimport { ModalInteraction } from \"./ModalInteraction\";\nimport type { BaseInteractionContext } from \"../types\";\n\nabstract class BaseInteraction<Type extends InteractionType> {\n public readonly type: Type;\n protected readonly data: Extract<APIInteraction, { type: Type }>;\n public readonly rest: REST;\n protected _ephemeral: boolean | null = null;\n protected replied: boolean = false;\n protected deferred: boolean = false;\n public readonly context: BaseInteractionContext;\n\n constructor(\n protected api: API,\n data: typeof this.data,\n context: BaseInteractionContext\n ) {\n this.type = data.type as Type;\n this.data = data;\n this.rest = api.rest;\n this.context = context;\n }\n\n get applicationId() {\n return this.data.application_id;\n }\n\n get entitlements() {\n return this.data.entitlements;\n }\n\n get channelId() {\n return this.data.channel?.id;\n }\n\n get channel() {\n return this.data.channel;\n }\n\n get guildId() {\n return this.data.guild_id;\n }\n\n get guild() {\n return this.data.guild;\n }\n\n get userId() {\n return this.data.user?.id;\n }\n\n get user() {\n return (this.data.member?.user || this.data.user) as APIUser; // One is always given.\n }\n\n get member() {\n return this.data.member;\n }\n\n get locale() {\n return this.data.guild_locale;\n }\n\n get guildLocale() {\n return this.data.guild_locale;\n }\n\n get token() {\n return this.data.token;\n }\n\n get id() {\n return this.data.id;\n }\n\n get appPermissions() {\n return this.data.app_permissions;\n }\n\n get version() {\n return this.data.version;\n }\n\n inGuild(): this is BaseInteraction<Type> & { guild_id: Snowflake; guild: APIPartialInteractionGuild; guild_locale: Locale } {\n return Boolean(this.data.guild_id && this.data.guild && this.data.guild_locale);\n }\n\n inDM(): this is BaseInteraction<Type> & { guild_id: undefined; guild: undefined; guild_locale: undefined } {\n return !this.inGuild();\n }\n\n getAppEntitlements() {\n return this.entitlements.filter((entitlement) => entitlement.application_id === this.applicationId);\n }\n\n guildHavePremium(): boolean {\n return (\n this.getAppEntitlements().filter(\n (entitlement) =>\n entitlement.guild_id === this.guildId && (!entitlement.ends_at || new Date(entitlement.ends_at) > new Date())\n ).length > 0\n );\n }\n\n userHavePremium(): boolean {\n return (\n this.getAppEntitlements().filter(\n (entitlement) =>\n entitlement.user_id === this.userId && (!entitlement.ends_at || new Date(entitlement.ends_at) > new Date())\n ).length > 0\n );\n }\n\n async reply(options: APIInteractionResponseCallbackData | string, forceEphemeral = true) {\n const replyOptions = typeof options === \"string\" ? { content: options } : options;\n if (forceEphemeral) {\n replyOptions.flags = (replyOptions.flags ?? 0) | 64;\n }\n const response = await this.api.interactions.reply(this.id, this.token, replyOptions, {\n signal: AbortSignal.timeout(5000),\n });\n this.replied = true;\n return response;\n }\n\n async deferReply(forceEphemeral = true) {\n const response = await this.api.interactions.defer(this.id, this.token, {\n flags: forceEphemeral ? 64 : undefined,\n });\n this.deferred = true;\n return response;\n }\n\n deferUpdate() {\n return this.api.interactions.deferMessageUpdate(this.id, this.token);\n }\n\n async editReply(options: APIInteractionResponseCallbackData | string, messageId: Snowflake | \"@original\" = \"@original\") {\n const replyOptions = typeof options === \"string\" ? { content: options } : options;\n const response = await this.api.interactions.editReply(this.applicationId, this.token, replyOptions, messageId, {\n signal: AbortSignal.timeout(5000),\n });\n this.replied = true;\n return response;\n }\n\n deleteReply(messageId?: Snowflake | \"@original\") {\n return this.api.interactions.deleteReply(this.applicationId, this.token, messageId);\n }\n\n async update(options: APIInteractionResponseCallbackData | string) {\n const updateOptions = typeof options === \"string\" ? { content: options } : options;\n const response = await this.api.interactions.updateMessage(this.id, this.token, updateOptions, {\n signal: AbortSignal.timeout(5000),\n });\n this.replied = true;\n return response;\n }\n\n // Typeguards\n isChatInputCommand(): this is ChatInputCommandInteraction {\n return this.type === InteractionType.ApplicationCommand;\n }\n\n isMessageContext(): this is APIMessageApplicationCommandInteraction {\n return this.type === InteractionType.ApplicationCommand && \"message\" in this.data;\n }\n\n isModal(): this is ModalInteraction {\n return this.type === InteractionType.ModalSubmit;\n }\n\n isMessageComponent(): this is APIMessageComponentInteraction {\n return this.type === InteractionType.MessageComponent;\n }\n\n isButton(): this is APIMessageComponentInteraction & { data: { component_type: ComponentType.Button } } {\n return this.isMessageComponent() && this.data.component_type === ComponentType.Button;\n }\n\n isStringSelect(): this is APIMessageComponentInteraction & {\n data: { component_type: Exclude<ComponentType, ComponentType.StringSelect> };\n } {\n return this.isMessageComponent() && this.data.component_type === ComponentType.StringSelect;\n }\n}\n\nexport { BaseInteraction };\n","import {\n InteractionType,\n type APIChatInputApplicationCommandInteraction,\n type APIModalInteractionResponseCallbackData,\n} from \"discord-api-types/v10\";\nimport { CommandInteractionOptionResolver } from \"@resolvers/CommandOptionResolver\";\nimport { ModalBuilder } from \"@discordjs/builders\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { BaseInteractionContext } from \"../types\";\n\nclass ChatInputCommandInteraction extends BaseInteraction<InteractionType.ApplicationCommand> {\n public readonly options: CommandInteractionOptionResolver;\n\n constructor(api: API, interaction: APIChatInputApplicationCommandInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.options = new CommandInteractionOptionResolver(interaction.data.options, interaction.data.resolved);\n }\n\n get commandName() {\n return this.data.data.name;\n }\n\n get commandId() {\n return this.data.data.id;\n }\n\n showModal(data: APIModalInteractionResponseCallbackData | ModalBuilder) {\n return this.api.interactions.createModal(this.id, this.token, data instanceof ModalBuilder ? data.toJSON() : data);\n }\n}\n\nexport { ChatInputCommandInteraction };\n","import type { APIInteraction, APIWebhookEvent } from \"discord-api-types/v10\";\nimport { cloneRawRequest, type HonoRequest } from \"hono/request\";\n\nexport const subtleCrypto = crypto.subtle;\n\n/**\n * Converts different types to Uint8Array.\n *\n * @param value - Value to convert. Strings are parsed as hex.\n * @param format - Format of value. Valid options: 'hex'. Defaults to utf-8.\n * @returns Value in Uint8Array form.\n */\nexport function valueToUint8Array(value: Uint8Array | ArrayBuffer | Buffer | string, format?: string): Uint8Array {\n if (value == null) {\n return new Uint8Array();\n }\n if (typeof value === \"string\") {\n if (format === \"hex\") {\n const matches = value.match(/.{1,2}/g);\n if (matches == null) {\n throw new Error(\"Value is not a valid hex string\");\n }\n const hexVal = matches.map((byte: string) => Number.parseInt(byte, 16));\n return new Uint8Array(hexVal);\n }\n\n return new TextEncoder().encode(value);\n }\n try {\n if (Buffer.isBuffer(value)) {\n return new Uint8Array(value);\n }\n } catch (_ex) {\n // Runtime doesn't have Buffer\n }\n if (value instanceof ArrayBuffer) {\n return new Uint8Array(value);\n }\n if (value instanceof Uint8Array) {\n return value;\n }\n throw new Error(\"Unrecognized value type, must be one of: string, Buffer, ArrayBuffer, Uint8Array\");\n}\n\n/**\n * Merge two arrays.\n *\n * @param arr1 - First array\n * @param arr2 - Second array\n * @returns Concatenated arrays\n */\nexport function concatUint8Arrays(arr1: Uint8Array, arr2: Uint8Array): Uint8Array {\n const merged = new Uint8Array(arr1.length + arr2.length);\n merged.set(arr1);\n merged.set(arr2, arr1.length);\n return merged;\n}\n\n/**\n * Validates a payload from Discord against its signature and key.\n *\n * @param rawBody - The raw payload data\n * @param signature - The signature from the `X-Signature-Ed25519` header\n * @param timestamp - The timestamp from the `X-Signature-Timestamp` header\n * @param clientPublicKey - The public key from the Discord developer dashboard\n * @returns Whether or not validation was successful\n */\nexport async function verifyKey(\n rawBody: Uint8Array | ArrayBuffer | Buffer | string,\n signature: string | null,\n timestamp: string | null,\n clientPublicKey: string | CryptoKey\n): Promise<boolean> {\n if (!signature || !timestamp) return false;\n try {\n const timestampData = valueToUint8Array(timestamp);\n const bodyData = valueToUint8Array(rawBody);\n const message = concatUint8Arrays(timestampData, bodyData);\n const publicKey =\n typeof clientPublicKey === \"string\"\n ? await subtleCrypto.importKey(\n \"raw\",\n valueToUint8Array(clientPublicKey, \"hex\"),\n {\n name: \"ed25519\",\n namedCurve: \"ed25519\",\n },\n false,\n [\"verify\"]\n )\n : clientPublicKey;\n const isValid = await subtleCrypto.verify(\n {\n name: \"ed25519\",\n },\n publicKey,\n valueToUint8Array(signature, \"hex\"),\n message\n );\n return isValid;\n } catch (_ex) {\n return false;\n }\n}\n\nexport async function verifyDiscordRequest<T extends APIInteraction | APIWebhookEvent = APIInteraction>(\n req: HonoRequest,\n discordPublicKey: string | CryptoKey\n) {\n const signature = req.header(\"x-signature-ed25519\");\n const timestamp = req.header(\"x-signature-timestamp\");\n const body = await (await cloneRawRequest(req)).text();\n const isValidRequest = signature && timestamp && (await verifyKey(body, signature, timestamp, discordPublicKey));\n if (!isValidRequest) {\n return { isValid: false } as const;\n }\n\n return { interaction: JSON.parse(body) as T, isValid: true } as const;\n}\n","export function parseCustomId(customId: string, onlyPrefix: true): string;\nexport function parseCustomId(\n customId: string,\n onlyPrefix?: false\n): {\n compPath: string[];\n prefix: string;\n lastPathItem: string;\n component: string | null;\n params: string[];\n firstParam: string | null;\n lastParam: string | null;\n};\n\n/**\n * Parses a custom ID into its components.\n *\n * @param customId - The custom ID to parse.\n * @param onlyPrefix - If true, only returns the prefix of the custom ID.\n * @returns An object containing the parsed components or just the prefix.\n *\n * A custom ID is expected to be in the format: \"prefix/component/other/path?param1/param2\"\n */\nexport function parseCustomId(customId: string, onlyPrefix: boolean = false) {\n if (onlyPrefix) {\n const match = customId.match(/^(.+?)(\\/|\\?)/i);\n return match ? match[1] : customId;\n }\n const [path, params] = customId.split(\"?\") as [string, string | undefined];\n const pathS = path.split(\"/\");\n const parms = params?.split(\"/\") || [];\n return {\n compPath: pathS,\n prefix: pathS[0],\n lastPathItem: pathS[pathS.length - 1],\n component: pathS[1] || null,\n params: parms || [],\n firstParam: parms[0] || null,\n lastParam: parms[parms.length - 1] || null,\n };\n}\n","import {\n APIUserApplicationCommandInteraction,\n APIUser,\n InteractionType,\n type APIModalInteractionResponseCallbackData,\n} from \"discord-api-types/v10\";\nimport { ModalBuilder } from \"@discordjs/builders\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { BaseInteractionContext } from \"../types\";\n\nclass UserCommandInteraction extends BaseInteraction<InteractionType.ApplicationCommand> {\n public readonly targetUser: APIUser;\n\n constructor(api: API, interaction: APIUserApplicationCommandInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.targetUser = interaction.data.resolved.users[interaction.data.target_id];\n }\n\n get commandName() {\n return this.data.data.name;\n }\n\n get commandId() {\n return this.data.data.id;\n }\n\n showModal(data: APIModalInteractionResponseCallbackData | ModalBuilder) {\n return this.api.interactions.createModal(this.id, this.token, data instanceof ModalBuilder ? data.toJSON() : data);\n }\n}\n\nexport { UserCommandInteraction };\n","import {\n APIMessage,\n APIMessageApplicationCommandInteraction,\n InteractionType,\n type APIModalInteractionResponseCallbackData,\n} from \"discord-api-types/v10\";\nimport { ModalBuilder } from \"@discordjs/builders\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { BaseInteractionContext } from \"../types\";\n\nclass MessageCommandInteraction extends BaseInteraction<InteractionType.ApplicationCommand> {\n public readonly targetMessage: APIMessage;\n\n constructor(api: API, interaction: APIMessageApplicationCommandInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.targetMessage = interaction.data.resolved.messages[interaction.data.target_id];\n }\n\n get commandName() {\n return this.data.data.name;\n }\n\n get commandId() {\n return this.data.data.id;\n }\n\n showModal(data: APIModalInteractionResponseCallbackData | ModalBuilder) {\n return this.api.interactions.createModal(this.id, this.token, data instanceof ModalBuilder ? data.toJSON() : data);\n }\n}\n\nexport { MessageCommandInteraction };\n","import {\n APIMessage,\n APIMessageComponentInteraction,\n APIModalInteractionResponseCallbackData,\n InteractionType,\n} from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { ModalBuilder } from \"@discordjs/builders\";\nimport type { BaseInteractionContext } from \"../types\";\n\nclass MessageComponentInteraction extends BaseInteraction<InteractionType.MessageComponent> {\n public readonly message?: APIMessage;\n public readonly custom_id: string;\n constructor(api: API, interaction: APIMessageComponentInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.custom_id = interaction.data.custom_id;\n\n if (\"message\" in interaction && interaction.message) {\n this.message = interaction.message;\n }\n }\n\n showModal(data: APIModalInteractionResponseCallbackData | ModalBuilder) {\n return this.api.interactions.createModal(this.id, this.token, data instanceof ModalBuilder ? data.toJSON() : data);\n }\n}\n\nexport { MessageComponentInteraction };\n","import {\n APIBaseComponent,\n APIInteractionDataResolved,\n APIInteractionDataResolvedChannel,\n APIInteractionDataResolvedGuildMember,\n APIRole,\n APIUser,\n ComponentType,\n ModalSubmitLabelComponent,\n ModalSubmitTextDisplayComponent,\n Snowflake,\n} from \"discord-api-types/v10\";\nimport { APIInteractionDataResolvedCollections } from \"../types\";\nimport { Collection, ReadonlyCollection } from \"@discordjs/collection\";\n\nexport interface BaseModalData<Type extends ComponentType> {\n id?: number;\n type: Type;\n}\n\nexport interface TextInputModalData extends BaseModalData<ComponentType.TextInput> {\n custom_id: string;\n value: string;\n}\n\nexport interface SelectMenuModalData extends BaseModalData<\n | ComponentType.ChannelSelect\n | ComponentType.MentionableSelect\n | ComponentType.RoleSelect\n | ComponentType.StringSelect\n | ComponentType.UserSelect\n> {\n channels?: ReadonlyCollection<Snowflake, APIInteractionDataResolvedChannel>;\n custom_id: string;\n members?: ReadonlyCollection<Snowflake, APIInteractionDataResolvedGuildMember>;\n roles?: ReadonlyCollection<Snowflake, APIRole>;\n users?: ReadonlyCollection<Snowflake, APIUser>;\n /**\n * The raw values selected by the user.\n */\n values: readonly string[];\n}\n\n// Technically, we had to add file uploads too, but we ain't using them anyway\ntype APIModalData = TextInputModalData | SelectMenuModalData;\n\nexport class ModalComponentResolver {\n private _resolved: APIInteractionDataResolvedCollections;\n private hoistedComponents: Collection<string, APIModalData>;\n\n constructor(\n private components: (ModalSubmitLabelComponent | ModalSubmitTextDisplayComponent)[],\n resolved?: APIInteractionDataResolved\n ) {\n this._resolved = Object.keys(resolved ?? {}).reduce((acc, key) => {\n const resolvedData = resolved?.[key as keyof APIInteractionDataResolved];\n const collection = new Collection(resolvedData ? Object.entries(resolvedData) : []);\n acc[key] = collection;\n return acc;\n }, {} as any);\n\n this.hoistedComponents = this.components.reduce(\n (accumulator, next) => {\n // For label components\n if (next.type === ComponentType.Label && next.component.type !== ComponentType.FileUpload) {\n accumulator.set(next.component.custom_id, next.component);\n }\n\n return accumulator;\n },\n new Collection() as Collection<string, APIModalData>\n );\n }\n\n public get data() {\n return this.hoistedComponents.map((component) => component);\n }\n\n getComponent(custom_id: string): APIModalData {\n const component = this.hoistedComponents.get(custom_id);\n\n if (!component) throw new TypeError(\"No component found with the provided custom_id.\");\n\n return component;\n }\n\n /**\n * Gets the value of a text input component.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a text input.\n * @returns The value of the text input, or null if not set and not required.\n */\n getString(custom_id: string, required?: boolean): string | null;\n getString(custom_id: string, required: true): string;\n getString(custom_id: string, required: boolean = false): string | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.TextInput) {\n throw new TypeError(\"Component is not a text input\", { cause: { custom_id, type: component.type } });\n }\n return component.value;\n }\n\n /**\n * Gets the selected values of a select menu component.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a select menu.\n * @returns The selected values, or null if not set and not required.\n */\n getSelectedValues(custom_id: string, required?: boolean): readonly string[] | null;\n getSelectedValues(custom_id: string, required: true): readonly string[];\n getSelectedValues(custom_id: string, required: boolean = false): readonly string[] | null {\n const component = this.getComponent(custom_id);\n if (!(\"values\" in component)) {\n throw new TypeError(\"Component is not a select menu\", { cause: { custom_id, type: component.type } });\n }\n return component.values;\n }\n\n /**\n * Gets the selected channels from a channel select menu.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a channel select.\n * @returns The selected channels, or null if not set and not required.\n */\n getSelectedChannels(custom_id: string, required?: boolean): APIInteractionDataResolvedChannel[] | null;\n getSelectedChannels(custom_id: string, required: true): APIInteractionDataResolvedChannel[];\n getSelectedChannels(custom_id: string, required: boolean = false): APIInteractionDataResolvedChannel[] | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.ChannelSelect) {\n throw new TypeError(\"Component is not a channel select\", { cause: { custom_id, type: component.type } });\n }\n const values = component.values;\n const channels = values.map((id) => this._resolved.channels?.get(id)).filter(Boolean) as APIInteractionDataResolvedChannel[];\n return channels.length > 0 ? channels : required ? [] : null;\n }\n\n /**\n * Gets the selected users from a user select menu.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a user select.\n * @returns The selected users, or null if not set and not required.\n */\n getSelectedUsers(custom_id: string, required?: boolean): APIUser[] | null;\n getSelectedUsers(custom_id: string, required: true): APIUser[];\n getSelectedUsers(custom_id: string, required: boolean = false): APIUser[] | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.UserSelect) {\n throw new TypeError(\"Component is not a user select\", { cause: { custom_id, type: component.type } });\n }\n const values = component.values;\n const users = values.map((id) => this._resolved.users?.get(id)).filter(Boolean) as APIUser[];\n return users.length > 0 ? users : required ? [] : null;\n }\n\n /**\n * Gets the selected members from a user select menu (if in guild).\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a user select.\n * @returns The selected members, or null if not set and not required.\n */\n getSelectedMembers(custom_id: string, required?: boolean): APIInteractionDataResolvedGuildMember[] | null;\n getSelectedMembers(custom_id: string, required: true): APIInteractionDataResolvedGuildMember[];\n getSelectedMembers(custom_id: string, required: boolean = false): APIInteractionDataResolvedGuildMember[] | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.UserSelect) {\n throw new TypeError(\"Component is not a user select\", { cause: { custom_id, type: component.type } });\n }\n const values = component.values;\n const members = values\n .map((id) => this._resolved.members?.get(id))\n .filter(Boolean) as APIInteractionDataResolvedGuildMember[];\n return members.length > 0 ? members : required ? [] : null;\n }\n\n /**\n * Gets the selected roles from a role select menu.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a role select.\n * @returns The selected roles, or null if not set and not required.\n */\n getSelectedRoles(custom_id: string, required?: boolean): APIRole[] | null;\n getSelectedRoles(custom_id: string, required: true): APIRole[];\n getSelectedRoles(custom_id: string, required: boolean = false): APIRole[] | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.RoleSelect) {\n throw new TypeError(\"Component is not a role select\", { cause: { custom_id, type: component.type } });\n }\n const values = component.values;\n const roles = values.map((id) => this._resolved.roles?.get(id)).filter(Boolean) as APIRole[];\n return roles.length > 0 ? roles : required ? [] : null;\n }\n\n /**\n * Gets the selected mentionables from a mentionable select menu.\n *\n * @param custom_id The custom ID of the component.\n * @param required Whether to throw an error if the component is not found or not a mentionable select.\n * @returns The selected mentionables (users, members, or roles), or null if not set and not required.\n */\n getSelectedMentionables(\n custom_id: string,\n required?: boolean\n ): (APIInteractionDataResolvedGuildMember | APIUser | APIRole)[] | null;\n getSelectedMentionables(custom_id: string, required: true): (APIInteractionDataResolvedGuildMember | APIUser | APIRole)[];\n getSelectedMentionables(\n custom_id: string,\n required: boolean = false\n ): (APIInteractionDataResolvedGuildMember | APIUser | APIRole)[] | null {\n const component = this.getComponent(custom_id);\n if (component.type !== ComponentType.MentionableSelect) {\n throw new TypeError(\"Component is not a mentionable select\", { cause: { custom_id, type: component.type } });\n }\n const values = component.values;\n const mentionables: (APIInteractionDataResolvedGuildMember | APIUser | APIRole)[] = [];\n for (const id of values) {\n const member = this._resolved.members?.get(id);\n if (member) mentionables.push(member);\n else {\n const user = this._resolved.users?.get(id);\n if (user) mentionables.push(user);\n else {\n const role = this._resolved.roles?.get(id);\n if (role) mentionables.push(role);\n }\n }\n }\n return mentionables.length > 0 ? mentionables : required ? [] : null;\n }\n}\n","import {\n APIMessage,\n APIModalSubmitInteraction,\n InteractionType,\n ModalSubmitLabelComponent,\n ModalSubmitTextDisplayComponent,\n} from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { ModalComponentResolver } from \"@resolvers/ModalComponentResolver\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { BaseInteractionContext } from \"../types\";\n\nclass ModalInteraction extends BaseInteraction<InteractionType.ModalSubmit> {\n public readonly fields: ModalComponentResolver;\n public readonly message?: APIMessage;\n public readonly custom_id: string;\n\n constructor(api: API, interaction: APIModalSubmitInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.custom_id = interaction.data.custom_id;\n this.fields = new ModalComponentResolver(\n interaction.data.components as (ModalSubmitLabelComponent | ModalSubmitTextDisplayComponent)[],\n interaction.data.resolved\n );\n if (\"message\" in interaction && interaction.message) {\n this.message = interaction.message;\n }\n }\n}\n\nexport { ModalInteraction };\n","import {\n APIApplicationCommandAutocompleteInteraction,\n APIApplicationCommandOptionChoice,\n InteractionType,\n type APIChatInputApplicationCommandInteraction,\n} from \"discord-api-types/v10\";\nimport { CommandInteractionOptionResolver } from \"@resolvers/CommandOptionResolver\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport { BaseInteractionContext } from \"../types\";\n\nclass AutocompleteInteraction extends BaseInteraction<InteractionType.ApplicationCommandAutocomplete> {\n public readonly options: CommandInteractionOptionResolver;\n public responded = false;\n\n constructor(api: API, interaction: APIApplicationCommandAutocompleteInteraction, c: BaseInteractionContext) {\n super(api, interaction, c);\n this.options = new CommandInteractionOptionResolver(interaction.data.options, interaction.data.resolved);\n }\n\n get commandName() {\n return this.data.data.name;\n }\n\n get commandId() {\n return this.data.data.id;\n }\n\n async respond(choices: APIApplicationCommandOptionChoice[]) {\n await this.api.interactions.createAutocompleteResponse(this.id, this.token, { choices });\n this.responded = true;\n }\n}\n\nexport { AutocompleteInteraction };\n","import type { ChatInputCommandInteraction } from \"./ChatInputInteraction\";\nimport type { AutocompleteInteraction } from \"./AutocompleteInteraction\";\nimport type { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport type { ModalInteraction } from \"./ModalInteraction\";\nimport { ContextMenuCommandBuilder, SlashCommandBuilder } from \"@discordjs/builders\";\nimport type {\n SlashCommandBooleanOption,\n SlashCommandUserOption,\n SlashCommandChannelOption,\n SlashCommandRoleOption,\n SlashCommandAttachmentOption,\n SlashCommandMentionableOption,\n SlashCommandStringOption,\n SlashCommandIntegerOption,\n SlashCommandNumberOption,\n SlashCommandSubcommandBuilder,\n SlashCommandSubcommandGroupBuilder,\n} from \"@discordjs/builders\";\nimport { ApplicationCommandType } from \"discord-api-types/v10\";\nimport { MessageCommandInteraction } from \"./MessageContextCommandInteraction\";\nimport { UserCommandInteraction } from \"./UserContextCommandInteraction\";\nimport { parseCustomId } from \"@utils/index\";\n\n/**\n * Handler for chat input commands with optional autocomplete support\n */\nexport class SlashCommandHandler extends SlashCommandBuilder {\n private handlerFn?: (interaction: ChatInputCommandInteraction) => Promise<void> | void;\n private autocompleteFn?: (interaction: AutocompleteInteraction) => Promise<void> | void;\n\n /**\n * Adds the command handler function.\n *\n * @param handler The function to handle the command interaction\n * @returns The current SlashCommandHandler instance\n */\n public addHandler(handler: (interaction: ChatInputCommandInteraction) => Promise<void> | void): SlashCommandHandler {\n this.handlerFn = handler;\n return this;\n }\n\n /**\n * Adds the autocomplete handler function.\n *\n * @param handler The function to handle the autocomplete interaction\n * @returns The current SlashCommandHandler instance\n */\n public addAutocompleteHandler(handler: (interaction: AutocompleteInteraction) => Promise<void> | void): SlashCommandHandler {\n this.autocompleteFn = handler;\n return this;\n }\n\n /**\n * Executes the command handler\n */\n async execute(interaction: ChatInputCommandInteraction): Promise<void> {\n if (!this.handlerFn) {\n throw new Error(`Command \"${this.name}\" does not have a handler`);\n }\n await this.handlerFn(interaction);\n }\n\n /**\n * Executes the autocomplete handler if it exists\n */\n async executeAutocomplete(interaction: AutocompleteInteraction): Promise<void> {\n if (this.autocompleteFn == undefined) {\n throw new Error(`Command \"${this.name}\" does not have an autocomplete handler`);\n }\n await this.autocompleteFn(interaction);\n }\n\n /**\n * Override option/subcommand adders so they return `this` (the handler),\n * preserving chaining when options/subcommands are added.\n */\n addBooleanOption(input: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): this {\n super.addBooleanOption(input);\n return this;\n }\n\n addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)): this {\n super.addUserOption(input);\n return this;\n }\n\n addChannelOption(input: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): this {\n super.addChannelOption(input);\n return this;\n }\n\n addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): this {\n super.addRoleOption(input);\n return this;\n }\n\n addAttachmentOption(\n input: SlashCommandAttachmentOption | ((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption)\n ): this {\n super.addAttachmentOption(input);\n return this;\n }\n\n addMentionableOption(\n input: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)\n ): this {\n super.addMentionableOption(input);\n return this;\n }\n\n addStringOption(input: SlashCommandStringOption | ((builder: SlashCommandStringOption) => SlashCommandStringOption)): this {\n super.addStringOption(input);\n return this;\n }\n\n addIntegerOption(input: SlashCommandIntegerOption | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption)): this {\n super.addIntegerOption(input);\n return this;\n }\n\n addNumberOption(input: SlashCommandNumberOption | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption)): this {\n super.addNumberOption(input);\n return this;\n }\n\n addSubcommand(\n input: SlashCommandSubcommandBuilder | ((sub: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)\n ): this {\n super.addSubcommand(input);\n return this;\n }\n\n addSubcommandGroup(\n input:\n | SlashCommandSubcommandGroupBuilder\n | ((group: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder)\n ): this {\n super.addSubcommandGroup(input);\n return this;\n }\n}\n\nexport class ContextCommandHandler<\n T extends ApplicationCommandType = ApplicationCommandType,\n InteractionData = T extends ApplicationCommandType.User ? UserCommandInteraction : MessageCommandInteraction,\n> extends ContextMenuCommandBuilder {\n private handlerFn?: (interaction: InteractionData) => Promise<void> | void;\n\n public addHandler(handler: (interaction: InteractionData) => Promise<void> | void): ContextCommandHandler<T, InteractionData> {\n this.handlerFn = handler;\n return this;\n }\n\n /**\n * Executes the command handler\n */\n async execute(interaction: InteractionData): Promise<void> {\n if (!this.handlerFn) {\n throw new Error(`Command \"${this.name}\" does not have a handler`);\n }\n await this.handlerFn(interaction);\n }\n}\n\n/**\n * Handler for message components (buttons, select menus) based on custom ID prefix\n */\nexport class ComponentHandler {\n public readonly prefix: string;\n private handlerFn?: (interaction: MessageComponentInteraction) => Promise<void> | void;\n\n constructor(prefix: string, handler?: (interaction: MessageComponentInteraction) => Promise<void> | void) {\n if (!prefix || typeof prefix !== \"string\") {\n throw new TypeError(\"Component handler prefix must be a non-empty string\");\n }\n\n this.prefix = prefix;\n if (handler) this.handlerFn = handler;\n }\n\n addHandler(handler: (interaction: MessageComponentInteraction) => Promise<void> | void): ComponentHandler {\n this.handlerFn = handler;\n return this;\n }\n\n /**\n * Executes the component handler\n */\n async execute(interaction: MessageComponentInteraction): Promise<void> {\n if (!this.handlerFn) {\n throw new Error(`Component handler with prefix \"${this.prefix}\" does not have a handler`);\n }\n await this.handlerFn(interaction);\n }\n\n /**\n * Checks if this handler matches the given custom ID\n */\n matches(customId: string): boolean {\n const prefix = parseCustomId(customId, true);\n return prefix === this.prefix;\n }\n}\n\n/**\n * Handler for modal submits based on custom ID prefix\n */\nexport class ModalHandler {\n public readonly prefix: string;\n private handlerFn?: (interaction: ModalInteraction) => Promise<void> | void;\n\n constructor(prefix: string, handler?: (interaction: ModalInteraction) => Promise<void> | void) {\n if (!prefix || typeof prefix !== \"string\") {\n throw new TypeError(\"Modal handler prefix must be a non-empty string\");\n }\n if (typeof handler !== \"function\") {\n throw new TypeError(\"Modal handler must be a function\");\n }\n\n this.prefix = prefix;\n if (handler) this.handlerFn = handler;\n }\n\n addHandler(handler: (interaction: ModalInteraction) => Promise<void> | void): ModalHandler {\n this.handlerFn = handler;\n return this;\n }\n\n /**\n * Executes the modal handler\n */\n async execute(interaction: ModalInteraction): Promise<void> {\n if (!this.handlerFn) {\n throw new Error(`Modal handler with prefix \"${this.prefix}\" does not have a handler`);\n }\n await this.handlerFn(interaction);\n }\n\n /**\n * Checks if this handler matches the given custom ID\n */\n matches(customId: string): boolean {\n const prefix = parseCustomId(customId, true);\n return prefix === this.prefix;\n }\n}\n\n/**\n * Union type of all possible handlers\n */\nexport type Handler = SlashCommandHandler | ContextCommandHandler | ComponentHandler | ModalHandler;\n","import {\n APIApplicationCommandAutocompleteInteraction,\n APIApplicationCommandInteraction,\n ApplicationCommandType,\n InteractionResponseType,\n InteractionType,\n} from \"discord-api-types/v10\";\nimport { ChatInputCommandInteraction } from \"@ctx/ChatInputInteraction\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { REST } from \"@discordjs/rest\";\nimport { Hono } from \"hono\";\nimport { verifyDiscordRequest } from \"@utils/discordVerify\";\nimport { parseCustomId } from \"@utils/index\";\nimport type { BaseVariables, BaseInteractionContext, ValidInteraction } from \"./types\";\nimport { UserCommandInteraction } from \"@ctx/UserContextCommandInteraction\";\nimport { MessageCommandInteraction } from \"@ctx/MessageContextCommandInteraction\";\nimport { MessageComponentInteraction } from \"@ctx/MessageComponentInteraction\";\nimport { ModalInteraction } from \"@ctx/ModalInteraction\";\nimport { AutocompleteInteraction } from \"@ctx/AutocompleteInteraction\";\nimport { SlashCommandHandler, ContextCommandHandler, ComponentHandler, ModalHandler, type Handler } from \"@ctx/handlers\";\n\ninterface HonocordOptions {\n /**\n * Indicates whether the Honocord instance is running on Cloudflare Workers.\n *\n * This affects how interactions are processed, allowing for asynchronous handling using the Workers' execution context.\n *\n * @default process.env.IS_CF_WORKER === \"true\"\n */\n isCFWorker?: boolean;\n}\n\nexport class Honocord {\n private commandHandlers: Map<string, SlashCommandHandler | ContextCommandHandler> = new Map();\n private componentHandlers: ComponentHandler[] = [];\n private modalHandlers: ModalHandler[] = [];\n private isCFWorker: boolean;\n\n constructor({ isCFWorker }: { isCFWorker?: boolean } = {}) {\n this.isCFWorker = isCFWorker ?? process.env.IS_CF_WORKER === \"true\";\n }\n\n /**\n * Registers handlers for interactions.\n *\n * @param handlers - Array of CommandHandler, ComponentHandler, or ModalHandler instances\n *\n * @example\n * ```typescript\n * import { HonoCord, CommandHandler, ComponentHandler, ModalHandler, HonocordSlashCommandBuilder } from \"honocord\";\n *\n * const honoCord = new Honocord();\n *\n * // Command handler with autocomplete\n * const searchCommand = new HonocordSlashCommandBuilder()\n * .setName(\"search\")\n * .setDescription(\"Search for something\")\n * .addStringOption(option =>\n * option.setName(\"query\")\n * .setDescription(\"Search query\")\n * .setAutocomplete(true)\n * )\n * .handler(async (interaction) => {\n * const query = interaction.options.getString(\"query\", true);\n * await interaction.reply(`Searching for: ${query}`);\n * })\n * .autocomplete(async (interaction) => {\n * const focused = interaction.options.getFocused();\n * await interaction.respond([\n * { name: \"Option 1\", value: \"opt1\" },\n * { name: \"Option 2\", value: \"opt2\" }\n * ]);\n * });\n *\n * // Component handler (for buttons, select menus with custom_id prefix)\n * const buttonHandler = new ComponentHandler(\"mybutton\", async (interaction) => {\n * await interaction.reply(\"Button clicked!\");\n * });\n *\n * // Modal handler (for modals with custom_id prefix)\n * const modalHandler = new ModalHandler(\"mymodal\", async (interaction) => {\n * const value = interaction.fields.getTextInputValue(\"field_id\");\n * await interaction.reply(`You submitted: ${value}`);\n * });\n *\n * honoCord.loadHandlers(\n * new CommandHandler(searchCommand),\n * buttonHandler,\n * modalHandler\n * );\n * ```\n */\n loadHandlers(...handlers: Handler[]): void {\n for (const handler of handlers) {\n if (handler instanceof SlashCommandHandler || handler instanceof ContextCommandHandler) {\n if (this.commandHandlers.has(handler.name)) {\n console.warn(`Command handler for \"${handler.name}\" already exists. Overwriting.`);\n }\n this.commandHandlers.set(handler.name, handler);\n } else if (handler instanceof ComponentHandler) {\n // Check for duplicate prefixes\n const existing = this.componentHandlers.find((h) => h.prefix === handler.prefix);\n if (existing) {\n console.warn(`Component handler with prefix \"${handler.prefix}\" already exists. Overwriting.`);\n this.componentHandlers = this.componentHandlers.filter((h) => h.prefix !== handler.prefix);\n }\n this.componentHandlers.push(handler);\n } else if (handler instanceof ModalHandler) {\n // Check for duplicate prefixes\n const existing = this.modalHandlers.find((h) => h.prefix === handler.prefix);\n if (existing) {\n console.warn(`Modal handler with prefix \"${handler.prefix}\" already exists. Overwriting.`);\n this.modalHandlers = this.modalHandlers.filter((h) => h.prefix !== handler.prefix);\n }\n this.modalHandlers.push(handler);\n }\n }\n }\n\n private createCommandInteraction(ctx: BaseInteractionContext, interaction: APIApplicationCommandInteraction, api: API) {\n switch (interaction.data.type) {\n case ApplicationCommandType.ChatInput:\n return new ChatInputCommandInteraction(api, interaction as any, ctx);\n case ApplicationCommandType.User:\n return new UserCommandInteraction(api, interaction as any, ctx);\n case ApplicationCommandType.Message:\n return new MessageCommandInteraction(api, interaction as any, ctx);\n default:\n throw new Error(\n `Unsupported application command type: ${interaction.data.type} (${ApplicationCommandType[interaction.data.type]})`\n );\n }\n }\n\n private async handleCommandInteraction(ctx: BaseInteractionContext, interaction: APIApplicationCommandInteraction, api: API) {\n const interactionObj = this.createCommandInteraction(ctx, interaction, api);\n const commandName = interaction.data.name;\n const handler = this.commandHandlers.get(commandName);\n\n if (handler) {\n try {\n if (handler instanceof SlashCommandHandler && interaction.data.type === ApplicationCommandType.ChatInput) {\n await handler.execute(interactionObj as ChatInputCommandInteraction);\n } else if (handler instanceof ContextCommandHandler) {\n if (interaction.data.type === ApplicationCommandType.User) {\n await handler.execute(interactionObj as UserCommandInteraction);\n } else if (interaction.data.type === ApplicationCommandType.Message) {\n await handler.execute(interactionObj as MessageCommandInteraction);\n }\n }\n } catch (error) {\n console.error(`Error executing command handler for \"${commandName}\":`, error);\n throw error;\n }\n }\n\n return interactionObj;\n }\n\n private async handleAutocompleteInteraction(\n ctx: BaseInteractionContext,\n interaction: APIApplicationCommandAutocompleteInteraction,\n api: API\n ) {\n const interactionObj = new AutocompleteInteraction(api, interaction, ctx);\n const commandName = interaction.data.name;\n const handler = this.commandHandlers.get(commandName);\n\n if (handler && handler instanceof SlashCommandHandler) {\n try {\n await handler.executeAutocomplete(interactionObj);\n } catch (error) {\n console.error(`Error executing autocomplete handler for \"${commandName}\":`, error);\n throw error;\n }\n }\n\n return interactionObj;\n }\n\n private async handleComponentInteraction(\n ctx: BaseInteractionContext,\n interaction: Extract<ValidInteraction, { type: InteractionType.MessageComponent }>,\n api: API\n ) {\n const interactionObj = new MessageComponentInteraction(api, interaction, ctx);\n const customId = interaction.data.custom_id;\n const prefix = parseCustomId(customId, true);\n\n // Find matching handler by prefix\n const handler = this.componentHandlers.find((h) => h.matches(customId));\n\n if (handler) {\n try {\n await handler.execute(interactionObj);\n } catch (error) {\n console.error(`Error executing component handler for prefix \"${prefix}\":`, error);\n throw error;\n }\n }\n\n return interactionObj;\n }\n\n private async handleModalInteraction(\n ctx: BaseInteractionContext,\n interaction: Extract<ValidInteraction, { type: InteractionType.ModalSubmit }>,\n api: API\n ) {\n const interactionObj = new ModalInteraction(api, interaction, ctx);\n const customId = interaction.data.custom_id;\n const prefix = parseCustomId(customId, true);\n\n // Find matching handler by prefix\n const handler = this.modalHandlers.find((h) => h.matches(customId));\n\n if (handler) {\n try {\n await handler.execute(interactionObj);\n } catch (error) {\n console.error(`Error executing modal handler for prefix \"${prefix}\":`, error);\n throw error;\n }\n }\n\n return interactionObj;\n }\n\n private async createInteraction(ctx: BaseInteractionContext, interaction: ValidInteraction) {\n const api = new API(new REST({ authPrefix: \"Bot\" }).setToken(ctx.env.DISCORD_TOKEN as string));\n\n switch (interaction.type) {\n case InteractionType.ApplicationCommand:\n return await this.handleCommandInteraction(ctx, interaction, api);\n case InteractionType.MessageComponent:\n return await this.handleComponentInteraction(ctx, interaction, api);\n case InteractionType.ModalSubmit:\n return await this.handleModalInteraction(ctx, interaction, api);\n case InteractionType.ApplicationCommandAutocomplete:\n return await this.handleAutocompleteInteraction(ctx, interaction, api);\n default:\n throw new Error(`Unknown interaction type: ${(interaction as any).type} (${InteractionType[(interaction as any).type]})`);\n }\n }\n\n /**\n * Returns a Hono handler for POST Requests handling Discord interactions.\n *\n * It is important, that\n *\n * @example\n * ```typescript\n * import { Hono } from \"hono\";\n * import { HonoCord } from \"honocord\";\n *\n * const app = new Hono();\n * const honoCord = new Honocord();\n *\n * app.post(\"/interactions\", honoCord.handle);\n *\n * export default app;\n * ```\n */\n handle = async (c: BaseInteractionContext) => {\n // Check if running on CF Workers\n const isCFWorker = this.isCFWorker || c.env.IS_CF_WORKER === \"true\";\n\n // Verify the request\n const { isValid, interaction } = await verifyDiscordRequest(c.req, c.env.DISCORD_PUBLIC_KEY as string);\n if (!isValid) {\n return c.text(\"Bad request signature.\", 401);\n } else if (!interaction) {\n console.log(\"No interaction found in request\");\n return c.text(\"No interaction found.\", 400);\n }\n\n if (interaction.type === InteractionType.Ping) {\n return c.json({ type: InteractionResponseType.Pong });\n }\n\n // Handle CF Workers execution context\n if (isCFWorker && c.executionCtx?.waitUntil) {\n // Process interaction asynchronously\n c.executionCtx.waitUntil(\n new Promise(async (resolve) => {\n try {\n await this.createInteraction(c, interaction);\n } catch (error) {\n console.error(\"Error handling interaction:\", error);\n }\n resolve(undefined);\n })\n );\n return c.json({}, 202); // Accepted for processing\n }\n\n // Standard non-CF Workers execution\n try {\n await this.createInteraction(c, interaction);\n } catch (error) {\n console.error(\"Error handling interaction:\", error);\n return c.text(\"Internal server error.\", 500);\n }\n };\n\n /**\n * Returns a Hono App instance with the interaction handler mounted at the root path and a GET Handler for all paths, which returns a simple Health response.\n *\n * @exampletypescript\n * ```typescript\n * import { Honocord } from \"honocord\";\n *\n * const honoCord = new Honocord();\n *\n * export default honoCord.getApp();\n * ```\n */\n getApp() {\n const app = new Hono<{ Variables: BaseVariables }>();\n app.get(\"*\", (c) => c.text(\"🔥 HonoCord is running!\"));\n app.post(\"/\", this.handle);\n return app;\n }\n}\n","// From discord.js\nexport const Colors = {\n Aqua: 0x1abc9c,\n Blue: 0x3498db,\n Blurple: 0x5865f2,\n DarkAqua: 0x11806a,\n DarkBlue: 0x206694,\n DarkButNotBlack: 0x2c2f33,\n DarkerGrey: 0x7f8c8d,\n DarkGold: 0xc27c0e,\n DarkGreen: 0x1f8b4c,\n DarkGrey: 0x979c9f,\n DarkNavy: 0x2c3e50,\n DarkOrange: 0xa84300,\n DarkPurple: 0x71368a,\n DarkRed: 0x992d22,\n DarkVividPink: 0xad1457,\n Default: 0x000000,\n Fuchsia: 0xeb459e,\n Gold: 0xf1c40f,\n Green: 0x57f287,\n Grey: 0x95a5a6,\n Greyple: 0x99aab5,\n LightGrey: 0xbcc0c0,\n LuminousVividPink: 0xe91e63,\n Navy: 0x34495e,\n NotQuiteBlack: 0x23272a,\n Orange: 0xe67e22,\n Purple: 0x9b59b6,\n Red: 0xed4245,\n White: 0xffffff,\n Yellow: 0xfee75c,\n} as const;\n"],"mappings":";;;;;;;;;;;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,IAAI,kCAAkC;AAC9C,UAAO,EAAE,KAAK,yBAAyB,IAAI;;AAG7C,MAAI,YAAY,SAAS,gBAAgB,KACvC,QAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,MAAM,CAAC;AAIvD,MAAI,cAAc,EAAE,cAAc,WAAW;AAE3C,KAAE,aAAa,UACb,IAAI,QAAQ,OAAO,YAAY;AAC7B,QAAI;AACF,WAAM,KAAK,kBAAkB,GAAG,YAAY;aACrC,OAAO;AACd,aAAQ,MAAM,+BAA+B,MAAM;;AAErD,YAAQ,OAAU;KAClB,CACH;AACD,UAAO,EAAE,KAAK,EAAE,EAAE,IAAI;;AAIxB,MAAI;AACF,SAAM,KAAK,kBAAkB,GAAG,YAAY;WACrC,OAAO;AACd,WAAQ,MAAM,+BAA+B,MAAM;AACnD,UAAO,EAAE,KAAK,0BAA0B,IAAI;;;;;;;;;;;;;;;CAgBhD,SAAS;EACP,MAAM,MAAM,IAAI,MAAoC;AACpD,MAAI,IAAI,MAAM,MAAM,EAAE,KAAK,0BAA0B,CAAC;AACtD,MAAI,KAAK,KAAK,KAAK,OAAO;AAC1B,SAAO;;;;;;AChUX,MAAa,SAAS;CACpB,MAAM;CACN,MAAM;CACN,SAAS;CACT,UAAU;CACV,UAAU;CACV,iBAAiB;CACjB,YAAY;CACZ,UAAU;CACV,WAAW;CACX,UAAU;CACV,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,SAAS;CACT,eAAe;CACf,SAAS;CACT,SAAS;CACT,MAAM;CACN,OAAO;CACP,MAAM;CACN,SAAS;CACT,WAAW;CACX,mBAAmB;CACnB,MAAM;CACN,eAAe;CACf,QAAQ;CACR,QAAQ;CACR,KAAK;CACL,OAAO;CACP,QAAQ;CACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "honocord",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",