honocord 1.5.0 → 1.5.2

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/dist/index.d.mts CHANGED
@@ -159,8 +159,8 @@ declare class CommandInteractionOptionResolver {
159
159
  * @param name The name of the option.
160
160
  * @returns The value of the option, or null if the user is not present in the guild or the option is not set.
161
161
  */
162
- getMember(name: string, required?: boolean): APIInteractionDataResolvedGuildMember | null;
163
- getMember(name: string, required: true): APIInteractionDataResolvedGuildMember;
162
+ getMember(name: string, required?: boolean): ResolvedSelectedGuildMember | null;
163
+ getMember(name: string, required: true): ResolvedSelectedGuildMember;
164
164
  /**
165
165
  * Gets a role option.
166
166
  *
@@ -186,8 +186,8 @@ declare class CommandInteractionOptionResolver {
186
186
  * @param required Whether to throw an error if the option is not found.
187
187
  * @returns The value of the option, or null if not set and not required.
188
188
  */
189
- getMentionable(name: string, required?: boolean): APIInteractionDataResolvedGuildMember | APIUser | APIRole | null;
190
- getMentionable(name: string, required: true): APIInteractionDataResolvedGuildMember | APIUser | APIRole;
189
+ getMentionable(name: string, required?: boolean): ResolvedSelectedGuildMember | APIUser | APIRole | null;
190
+ getMentionable(name: string, required: true): ResolvedSelectedGuildMember | APIUser | APIRole;
191
191
  }
192
192
  //#endregion
193
193
  //#region src/resolvers/ModalComponentResolver.d.ts
@@ -243,8 +243,8 @@ declare class ModalComponentResolver {
243
243
  * @param required Whether to throw an error if the component is not found or not a channel select.
244
244
  * @returns The selected channels, or null if not set and not required.
245
245
  */
246
- getSelectedChannels(custom_id: string, required?: boolean): APIInteractionDataResolvedChannel[] | null;
247
- getSelectedChannels(custom_id: string, required: true): APIInteractionDataResolvedChannel[];
246
+ getSelectedChannels(custom_id: string, required?: boolean): Collection$1<string, APIInteractionDataResolvedChannel> | null;
247
+ getSelectedChannels(custom_id: string, required: true): Collection$1<string, APIInteractionDataResolvedChannel>;
248
248
  /**
249
249
  * Gets the selected users from a user select menu.
250
250
  *
@@ -252,8 +252,8 @@ declare class ModalComponentResolver {
252
252
  * @param required Whether to throw an error if the component is not found or not a user select.
253
253
  * @returns The selected users, or null if not set and not required.
254
254
  */
255
- getSelectedUsers(custom_id: string, required?: boolean): APIUser[] | null;
256
- getSelectedUsers(custom_id: string, required: true): APIUser[];
255
+ getSelectedUsers(custom_id: string, required?: boolean): Collection$1<string, APIUser> | null;
256
+ getSelectedUsers(custom_id: string, required: true): Collection$1<string, APIUser>;
257
257
  /**
258
258
  * Gets the selected members from a user select menu (if in guild).
259
259
  *
@@ -261,8 +261,8 @@ declare class ModalComponentResolver {
261
261
  * @param required Whether to throw an error if the component is not found or not a user select.
262
262
  * @returns The selected members, or null if not set and not required.
263
263
  */
264
- getSelectedMembers(custom_id: string, required?: boolean): APIInteractionDataResolvedGuildMember[] | null;
265
- getSelectedMembers(custom_id: string, required: true): APIInteractionDataResolvedGuildMember[];
264
+ getSelectedMembers(custom_id: string, required?: boolean): Collection$1<string, ResolvedSelectedGuildMember> | null;
265
+ getSelectedMembers(custom_id: string, required: true): Collection$1<string, ResolvedSelectedGuildMember>;
266
266
  /**
267
267
  * Gets the selected roles from a role select menu.
268
268
  *
@@ -279,8 +279,8 @@ declare class ModalComponentResolver {
279
279
  * @param required Whether to throw an error if the component is not found or not a mentionable select.
280
280
  * @returns The selected mentionables (users, members, or roles), or null if not set and not required.
281
281
  */
282
- getSelectedMentionables(custom_id: string, required?: boolean): (APIInteractionDataResolvedGuildMember | APIUser | APIRole)[] | null;
283
- getSelectedMentionables(custom_id: string, required: true): (APIInteractionDataResolvedGuildMember | APIUser | APIRole)[];
282
+ getSelectedMentionables(custom_id: string, required?: boolean): (ResolvedSelectedGuildMember | APIUser | APIRole)[] | null;
283
+ getSelectedMentionables(custom_id: string, required: true): (ResolvedSelectedGuildMember | APIUser | APIRole)[];
284
284
  }
285
285
  //#endregion
286
286
  //#region src/interactions/ModalInteraction.d.ts
@@ -355,6 +355,7 @@ declare class StringSelectInteraction<Context$1 extends BaseInteractionContext =
355
355
  declare class UserSelectInteraction<Context$1 extends BaseInteractionContext = BaseInteractionContext> extends MessageComponentInteraction<Context$1, ComponentType$1.UserSelect> {
356
356
  readonly values: string[];
357
357
  readonly users: Collection$1<string, APIUser>;
358
+ readonly members: Collection$1<string, ResolvedSelectedGuildMember>;
358
359
  constructor(api: API$1, interaction: MessageComponentInteractionPayload<ComponentType$1.UserSelect>, c: Context$1);
359
360
  }
360
361
  //#endregion
@@ -399,7 +400,7 @@ declare abstract class BaseInteraction<Type extends InteractionType$1, Context$1
399
400
  get applicationId(): string;
400
401
  get entitlements(): discord_api_types_v1030.APIEntitlement[];
401
402
  get channelId(): string | undefined;
402
- get channel(): (Partial<discord_api_types_v1030.APIAnnouncementThreadChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1030.APIDMChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1030.APIGroupDMChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1030.APIGuildCategoryChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1030.APIGuildForumChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1030.APIGuildMediaChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1030.APIGuildStageVoiceChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1030.APIGuildVoiceChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1030.APINewsChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1030.APIPrivateThreadChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1030.APIPublicThreadChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | (Partial<discord_api_types_v1030.APITextChannel> & Pick<discord_api_types_v1030.APIChannel, "id" | "type">) | undefined;
403
+ get channel(): (Partial<discord_api_types_v1030.APIAnnouncementThreadChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | (Partial<discord_api_types_v1030.APIDMChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | (Partial<discord_api_types_v1030.APIGroupDMChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | (Partial<discord_api_types_v1030.APIGuildCategoryChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | (Partial<discord_api_types_v1030.APIGuildForumChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | (Partial<discord_api_types_v1030.APIGuildMediaChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | (Partial<discord_api_types_v1030.APIGuildStageVoiceChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | (Partial<discord_api_types_v1030.APIGuildVoiceChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | (Partial<discord_api_types_v1030.APINewsChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | (Partial<discord_api_types_v1030.APIPrivateThreadChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | (Partial<discord_api_types_v1030.APIPublicThreadChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | (Partial<discord_api_types_v1030.APITextChannel> & Pick<discord_api_types_v1030.APIChannel, "type" | "id">) | undefined;
403
404
  get guildId(): string | undefined;
404
405
  get guild(): APIPartialInteractionGuild | undefined;
405
406
  get userId(): string | undefined;
@@ -598,6 +599,14 @@ interface BaseHonocordEnv<TBindings extends Bindings = any, TVariables extends V
598
599
  * ```
599
600
  */
600
601
  type BaseInteractionContext<TBindings extends Bindings = any, TVariables extends Variables = any, TPath extends string = "/"> = Context<BaseHonocordEnv<TBindings, TVariables>, TPath, BlankInput>;
602
+ /**
603
+ * Represents a guild member resolved from an interaction, including the associated user data.
604
+ *
605
+ * To be used by user selects.
606
+ */
607
+ type ResolvedSelectedGuildMember = APIInteractionDataResolvedGuildMember & {
608
+ user: APIUser;
609
+ };
601
610
  /**
602
611
  * Collections of resolved data from Discord API interactions.
603
612
  *
@@ -610,7 +619,7 @@ interface APIInteractionDataResolvedCollections {
610
619
  /** Map of role IDs to role objects */
611
620
  roles?: Collection$1<Snowflake$2, APIRole>;
612
621
  /** Map of user IDs to guild member objects */
613
- members?: Collection$1<Snowflake$2, APIInteractionDataResolvedGuildMember>;
622
+ members?: Collection$1<Snowflake$2, ResolvedSelectedGuildMember>;
614
623
  /** Map of channel IDs to channel objects */
615
624
  channels?: Collection$1<Snowflake$2, APIInteractionDataResolvedChannel>;
616
625
  /** Map of attachment IDs to attachment objects */
@@ -1061,5 +1070,5 @@ declare function parseCustomId(customId: string, onlyPrefix?: false): {
1061
1070
  lastParam: string | null;
1062
1071
  };
1063
1072
  //#endregion
1064
- export { type API, type APIChatInputApplicationCommandInteraction, type APIInteraction, APIInteractionDataResolvedCollections, type APIMessageComponentInteraction, type APIModalSubmitInteraction, ActionRowBuilder, AnyInteraction, ApplicationCommandType, BaseHonocordEnv, BaseInteraction, BaseInteractionContext, BaseVariables, BufferSource, ButtonBuilder, ChannelSelectMenuBuilder, ChannelType, ChatInputCommandInteraction, Collection, Colors, type CommandHandler, CommandInteractionOptionResolver, ComponentHandler, ComponentType, ContainerBuilder, ContextCommandHandler, ContextCommandType, EmbedBuilder, FileBuilder, FileUploadBuilder, FlatOrNestedArray, type Handler, HandlerFunction, Honocord, InteractionResponseCallbackData, InteractionType, JSONEncodable, LabelBuilder, MediaGalleryBuilder, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, MessageComponentDataTypes, MessageComponentInteraction, MessageComponentInteractionObj, MessageComponentInteractionPayload, MessageComponentType, MiddlewareFunction, ModalBuilder, ModalComponentResolver, ModalHandler, ModalInteraction, ModalInteractionResponseCallbackData, type REST, type ReadonlyCollection, RoleSelectMenuBuilder, SectionBuilder, SelectMenuOptionBuilder, SeparatorBuilder, SlashCommandHandler, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, type Snowflake, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TMessageComponentInteraction, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserSelectMenuBuilder, ValidInteraction, parseCustomId, registerCommands };
1073
+ export { type API, type APIChatInputApplicationCommandInteraction, type APIInteraction, APIInteractionDataResolvedCollections, type APIMessageComponentInteraction, type APIModalSubmitInteraction, ActionRowBuilder, AnyInteraction, ApplicationCommandType, BaseHonocordEnv, BaseInteraction, BaseInteractionContext, BaseVariables, BufferSource, ButtonBuilder, type ButtonInteraction, type ChannelSelectInteraction, ChannelSelectMenuBuilder, ChannelType, ChatInputCommandInteraction, Collection, Colors, type CommandHandler, CommandInteractionOptionResolver, ComponentHandler, ComponentType, ContainerBuilder, ContextCommandHandler, ContextCommandType, EmbedBuilder, FileBuilder, FileUploadBuilder, FlatOrNestedArray, type Handler, HandlerFunction, Honocord, InteractionResponseCallbackData, InteractionType, JSONEncodable, LabelBuilder, MediaGalleryBuilder, MediaGalleryItemBuilder, type MentionableSelectInteraction, MentionableSelectMenuBuilder, MessageComponentDataTypes, MessageComponentInteraction, MessageComponentInteractionObj, MessageComponentInteractionPayload, MessageComponentType, MiddlewareFunction, ModalBuilder, ModalComponentResolver, ModalHandler, ModalInteraction, ModalInteractionResponseCallbackData, type REST, type ReadonlyCollection, ResolvedSelectedGuildMember, type RoleSelectInteraction, RoleSelectMenuBuilder, SectionBuilder, SelectMenuOptionBuilder, SeparatorBuilder, SlashCommandHandler, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, type Snowflake, type StringSelectInteraction, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TMessageComponentInteraction, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, type UserSelectInteraction, UserSelectMenuBuilder, ValidInteraction, parseCustomId, registerCommands };
1065
1074
  //# sourceMappingURL=index.d.mts.map
@@ -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/ModalCapableInteraction.ts","../src/interactions/MessageComponentInteraction.ts","../src/interactions/CommandInteraction.ts","../src/interactions/ChatInputInteraction.ts","../src/interactions/UserContextCommandInteraction.ts","../src/interactions/MessageContextCommandInteraction.ts","../src/interactions/ButtonInteraction.ts","../src/interactions/StringSelectInteraction.ts","../src/interactions/UserSelectInteraction.ts","../src/interactions/RoleSelectInteraction.ts","../src/interactions/MentionableSelectInteraction.ts","../src/interactions/ChannelSelectInteraction.ts","../src/interactions/BaseInteraction.ts","../src/interactions/AutocompleteInteraction.ts","../src/types.ts","../src/interactions/handlers.ts","../src/Honocord.ts","../src/utils/Colors.ts","../src/utils/registerCommands.ts","../src/utils/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;KAeK,yBAAA;;;;;;;;QAQG;;;;;EARH;AAQ+B;;EAoCW,OAAA,EAAA,OAAgB;CADvD;;;;cArBF,gCAAA,CAgDW;EAYD;;;EAcqG,QAAA,MAAA;EAdhC;;;;;;;;EAcgC,QAAA,eAAA;;uBArD7G,2CACE,iBAAA,CAAgB,qBAAqB,iBAAA,CAAgB,yDAGjD;EAiDuG,IAAA,IAAA,CAAA,CAAA,EA1BpG,0CA0BoG,CA1BpG,iBAAA,CAAA,kBA0BoG,GA1BpG,iBAAA,CAAA,8BA0BoG,CAAA,EAAA;;;;;;;;;gBAdrG,kDAAkD,wBAAmB,QAAlB,uBAAA,CAAkB,oDAAA;IAcgC,IAAA,EAAA,CAAA;eAdhC,uBAAA,CAAA,iDAAA;UAcgC;;IAAA,IAAA,EAAA,CAAA;;UAAA;;IAAA,IAAA,EAAA,CAAA;;UAAA;;IAAA,IAAA,EAAA,CAAA;;IAmCrG,IAAA,EAnCqG,CAmCrG;EA0B0C,CAAA,CAAA,UAAA,yEAAA,qCAAA,CAAA,EAAA;IA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AA;;;;UmB/MrD,MAAA;;;;;;;;;;;;;;EpBcL,UAAA,EAAA,MAAA;EAsBC;EAsBI,QAAA,EAAA,MAAgB;EAAqB;EADvC,SAAA,EAAA,MAAA;EAIM;EAuBG,QAAA,EAAA,MAAA;EAAA;EAAA,QAAA,EAAA,MAAA;EAYD;EAAkD,UAAA,EAAA,MAAA;EAAC;EAckD,UAAA,EAAA,MAAA;EAdhC;EAAA,OAAA,EAAA,MAAA;EAcgC;;;EAAA,OAAA,EAAA,MAAA;;;EAAA;;;EAAA,KAAA,EAAA,MAAA;;;EAAA;;;EAAA,SAAA,EAAA,MAAA;;;;EAAA,IAAA,EAAA,MAAA;;;;EAAA,MAAA,EAAA,MAAA;;;;EAAA,GAAA,EAAA,MAAA;;;;EAAA,MAAA,EAAA,MAAA;;AAmCrG,coBlFH,MpBkFG,EoBlFK,MpBkFL;;;;;;;;;;;;;;;AAnIX,iBqBGiB,gBAAA,CrBHQ,KAQtB,EAAA,MAAA,GAAA,SAAA,EAAA,aAA4B,EAAA,MAAA,GAAA,SAAA,EAAA,GAAA,QAAA,EqBFrB,iBrBEqB,CqBFH,UrBEG,CAAA,CAAA,EqBFQ,OrBER,CAAA,IAAA,CAAA;;;;;;;;;;;;;;;AAXL;AAWK;;;;;;;;;;;;;;;;iBsBSpB,aAAA;AtB+EqG,iBsB9ErG,aAAA,CtB8EqG,QAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EAAA,KAAA,CAAA,EAAA;;;EAAA,YAAA,EAAA,MAAA;;;EAAA,UAAA,EAAA,MAAA,GAAA,IAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/resolvers/CommandOptionResolver.ts","../src/resolvers/ModalComponentResolver.ts","../src/interactions/ModalInteraction.ts","../src/interactions/ModalCapableInteraction.ts","../src/interactions/MessageComponentInteraction.ts","../src/interactions/CommandInteraction.ts","../src/interactions/ChatInputInteraction.ts","../src/interactions/UserContextCommandInteraction.ts","../src/interactions/MessageContextCommandInteraction.ts","../src/interactions/ButtonInteraction.ts","../src/interactions/StringSelectInteraction.ts","../src/interactions/UserSelectInteraction.ts","../src/interactions/RoleSelectInteraction.ts","../src/interactions/MentionableSelectInteraction.ts","../src/interactions/ChannelSelectInteraction.ts","../src/interactions/BaseInteraction.ts","../src/interactions/AutocompleteInteraction.ts","../src/types.ts","../src/interactions/handlers.ts","../src/Honocord.ts","../src/utils/Colors.ts","../src/utils/registerCommands.ts","../src/utils/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;KAeK,yBAAA;;;;;;;;QAQG;;;;EARH,KAAA,EAAA,MAAA;EAsBC;;;EAqBE,OAAA,EAAA,OAAA;CAIM;;;;cAzBR,gCAAA,CAoEU;EAAkD;;;EAAmB,QAAA,MAAA;EAAA;;;;EAcgC;;;;;;EAAA,WAAA,CAAA,OAAA,EA7D7G,0CA6D6G,CA5D3G,iBAAA,CAAgB,kBA4D2F,GA5DtE,iBAAA,CAAgB,8BA4DsD,CAAA,EAAA,GAAA,SAAA,EAAA,QAAA,EAzDvG,0BAyDuG,GAAA,SAAA;cA1BpG,2CAAA,iBAAA,CAAA,qBAAA,iBAAA,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,qCAAA,CAAA,EAAA;IA0B0C,IAAA,EA7D2D,CA6D3D;EAAgB,CAAA,CAAA,UAAA,yEAAA,qCAAA,CAAA,EAAA;IACjB,IAAA,EA9D4D,C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BsFqG,QAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EAAA,KAAA,CAAA,EAAA;;;EAAA,YAAA,EAAA,MAAA;;;EAAA,UAAA,EAAA,MAAA,GAAA,IAAA"}
package/dist/index.mjs CHANGED
@@ -29,6 +29,14 @@ var CommandInteractionOptionResolver = class {
29
29
  this._hoistedOptions = options ?? [];
30
30
  this._resolved = Object.keys(resolved ?? {}).reduce((acc, key) => {
31
31
  const resolvedData = resolved?.[key];
32
+ if (key === "members") {
33
+ const users = resolved?.users ? new Collection$1(Object.entries(resolved.users)) : new Collection$1();
34
+ acc[key] = new Collection$1([...(resolvedData ? new Collection$1(Object.entries(resolvedData)) : new Collection$1()).entries()].map(([id, member]) => [id, {
35
+ ...member,
36
+ user: users.get(id)
37
+ }]));
38
+ return acc;
39
+ }
32
40
  acc[key] = new Collection$1(resolvedData ? Object.entries(resolvedData) : []);
33
41
  return acc;
34
42
  }, {});
@@ -638,6 +646,14 @@ var ModalComponentResolver = class {
638
646
  this.components = components;
639
647
  this._resolved = Object.keys(resolved ?? {}).reduce((acc, key) => {
640
648
  const resolvedData = resolved?.[key];
649
+ if (key === "members") {
650
+ const users = resolved?.users ? new Collection$1(Object.entries(resolved.users)) : new Collection$1();
651
+ acc[key] = new Collection$1([...(resolvedData ? new Collection$1(Object.entries(resolvedData)) : new Collection$1()).entries()].map(([id, member]) => [id, {
652
+ ...member,
653
+ user: users.get(id)
654
+ }]));
655
+ return acc;
656
+ }
641
657
  acc[key] = new Collection$1(resolvedData ? Object.entries(resolvedData) : []);
642
658
  return acc;
643
659
  }, {});
@@ -677,7 +693,7 @@ var ModalComponentResolver = class {
677
693
  type: component.type
678
694
  } });
679
695
  const channels = component.values.map((id) => this._resolved.channels?.get(id)).filter(Boolean);
680
- return channels.length > 0 ? channels : required ? [] : null;
696
+ return channels.length > 0 ? new Collection$1(channels.map((channel) => [channel.id, channel])) : required ? new Collection$1() : null;
681
697
  }
682
698
  getSelectedUsers(custom_id, required = false) {
683
699
  const component = this.getComponent(custom_id);
@@ -686,7 +702,7 @@ var ModalComponentResolver = class {
686
702
  type: component.type
687
703
  } });
688
704
  const users = component.values.map((id) => this._resolved.users?.get(id)).filter(Boolean);
689
- return users.length > 0 ? users : required ? [] : null;
705
+ return users.length > 0 ? new Collection$1(users.map((user) => [user.id, user])) : required ? new Collection$1() : null;
690
706
  }
691
707
  getSelectedMembers(custom_id, required = false) {
692
708
  const component = this.getComponent(custom_id);
@@ -695,7 +711,7 @@ var ModalComponentResolver = class {
695
711
  type: component.type
696
712
  } });
697
713
  const members = component.values.map((id) => this._resolved.members?.get(id)).filter(Boolean);
698
- return members.length > 0 ? members : required ? [] : null;
714
+ return members.length > 0 ? new Collection$1(members.map((member) => [member.user.id, member])) : required ? new Collection$1() : null;
699
715
  }
700
716
  getSelectedRoles(custom_id, required = false) {
701
717
  const component = this.getComponent(custom_id);
@@ -1017,10 +1033,22 @@ var StringSelectInteraction = class extends MessageComponentInteraction {
1017
1033
  var UserSelectInteraction = class extends MessageComponentInteraction {
1018
1034
  values;
1019
1035
  users;
1036
+ members = new Collection$1();
1020
1037
  constructor(api, interaction, c) {
1021
1038
  super(api, interaction, c);
1022
1039
  this.values = interaction.data.values;
1023
1040
  this.users = new Collection$1(interaction.data.resolved.users ? Object.entries(interaction.data.resolved.users) : []);
1041
+ if (this.inGuild()) this.members = new Collection$1(this.values.map((id) => {
1042
+ const member = interaction.data.resolved.members?.[id];
1043
+ if (member) {
1044
+ const user = this.users.get(id);
1045
+ if (user) return [id, {
1046
+ ...member,
1047
+ user
1048
+ }];
1049
+ }
1050
+ return null;
1051
+ }).filter((entry) => entry !== null));
1024
1052
  }
1025
1053
  };
1026
1054
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["Collection","InteractionType","ApplicationCommandType","ComponentType","ModalBuilder","Collection","ComponentType","Collection","Collection","Collection","Collection","ApplicationCommandType","ComponentType","InteractionType","ApplicationCommandType"],"sources":["../src/resolvers/CommandOptionResolver.ts","../src/interactions/BaseInteraction.ts","../src/interactions/ModalCapableInteraction.ts","../src/interactions/CommandInteraction.ts","../src/interactions/ChatInputInteraction.ts","../src/utils/discordVerify.ts","../src/utils/Colors.ts","../src/utils/registerCommands.ts","../src/utils/index.ts","../src/interactions/UserContextCommandInteraction.ts","../src/interactions/MessageContextCommandInteraction.ts","../src/resolvers/ModalComponentResolver.ts","../src/interactions/ModalInteraction.ts","../src/interactions/AutocompleteInteraction.ts","../src/interactions/handlers.ts","../src/interactions/MessageComponentInteraction.ts","../src/interactions/ButtonInteraction.ts","../src/interactions/StringSelectInteraction.ts","../src/interactions/UserSelectInteraction.ts","../src/interactions/RoleSelectInteraction.ts","../src/interactions/MentionableSelectInteraction.ts","../src/interactions/ChannelSelectInteraction.ts","../src/Honocord.ts","../src/types.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 Snowflake,\n APIInteractionResponseCallbackData,\n APIPartialInteractionGuild,\n APIUser,\n ApplicationCommandType,\n InteractionType,\n Locale,\n APIApplicationCommandInteraction,\n ComponentType,\n APIMessage,\n} from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { REST } from \"@discordjs/rest\";\nimport { ModalInteraction } from \"./ModalInteraction\";\nimport type {\n BaseInteractionContext,\n InteractionResponseCallbackData,\n JSONEncodable,\n MessageComponentType,\n ValidInteraction,\n} from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport { AutocompleteInteraction } from \"./AutocompleteInteraction\";\nimport { CommandInteraction } from \"./CommandInteraction\";\nimport { ChatInputCommandInteraction } from \"./ChatInputInteraction\";\nimport { UserContextInteraction } from \"./UserContextCommandInteraction\";\nimport { MessageContextInteraction } from \"./MessageContextCommandInteraction\";\nimport { ButtonInteraction } from \"./ButtonInteraction\";\nimport { StringSelectInteraction } from \"./StringSelectInteraction\";\nimport { UserSelectInteraction } from \"./UserSelectInteraction\";\nimport { RoleSelectInteraction } from \"./RoleSelectInteraction\";\nimport { MentionableSelectInteraction } from \"./MentionableSelectInteraction\";\nimport { ChannelSelectInteraction } from \"./ChannelSelectInteraction\";\n\nfunction snakeCase(str: string): string {\n return str\n .replace(/([a-z0-9])([A-Z])/g, \"$1_$2\")\n .replace(/([A-Z])([A-Z][a-z])/g, \"$1_$2\")\n .toLowerCase();\n}\n\n/**\n * Transforms camel-cased keys into snake cased keys\n *\n * @param {*} obj The object to transform\n * @returns {*} The transformed object\n */\nfunction toSnakeCase(obj: any): any {\n if (typeof obj !== \"object\" || !obj) return obj;\n if (obj instanceof Date) return obj;\n if (isJSONEncodable(obj)) return toSnakeCase(obj.toJSON());\n if (Array.isArray(obj)) return obj.map(toSnakeCase);\n return Object.fromEntries(Object.entries(obj).map(([key, value]) => [snakeCase(key), toSnakeCase(value)]));\n}\n\n/**\n * Indicates if an object is encodable or not.\n *\n * @param maybeEncodable - The object to check against\n */\nfunction isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown> {\n return (\n maybeEncodable !== null &&\n typeof maybeEncodable === \"object\" &&\n \"toJSON\" in maybeEncodable &&\n typeof maybeEncodable[\"toJSON\"] === \"function\"\n );\n}\n\nabstract class BaseInteraction<Type extends InteractionType, Context extends BaseInteractionContext = BaseInteractionContext> {\n public readonly type: Type;\n /** The raw interaction data */\n protected readonly raw: Extract<ValidInteraction, { 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: Context;\n\n constructor(\n protected api: API,\n data: Extract<ValidInteraction, { type: Type }>,\n context: Context\n ) {\n this.type = data.type as Type;\n this.raw = { ...data };\n this.rest = api.rest;\n this.context = context;\n }\n\n get applicationId() {\n return this.raw.application_id;\n }\n\n get entitlements() {\n return this.raw.entitlements;\n }\n\n get channelId() {\n return this.raw.channel?.id;\n }\n\n get channel() {\n return this.raw.channel;\n }\n\n get guildId() {\n return this.raw.guild_id;\n }\n\n get guild() {\n return this.raw.guild;\n }\n\n get userId() {\n return this.raw.user?.id;\n }\n\n get user() {\n return (this.raw.member?.user || this.raw.user) as APIUser; // One is always given.\n }\n\n get member() {\n return this.raw.member;\n }\n\n get locale() {\n return this.raw.guild_locale;\n }\n\n get guildLocale() {\n return this.raw.guild_locale;\n }\n\n get token() {\n return this.raw.token;\n }\n\n get id() {\n return this.raw.id;\n }\n\n get appPermissions() {\n return this.raw.app_permissions;\n }\n\n get version() {\n return this.raw.version;\n }\n\n protected isJSONEncodable(obj: unknown): obj is JSONEncodable<unknown> {\n return isJSONEncodable(obj);\n }\n\n protected toSnakeCase(obj: unknown): unknown {\n return toSnakeCase(obj);\n }\n\n inGuild(): this is BaseInteraction<Type> & { guild_id: Snowflake; guild: APIPartialInteractionGuild; guild_locale: Locale } {\n return Boolean(this.raw.guild_id && this.raw.guild && this.raw.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 private prepareResponsePayload(options: InteractionResponseCallbackData): APIInteractionResponseCallbackData {\n return this.toSnakeCase({\n ...options,\n components: options.components?.map((component) => (this.isJSONEncodable(component) ? component.toJSON() : component)),\n embeds: options.embeds?.map((embed) => (this.isJSONEncodable(embed) ? embed.toJSON() : embed)),\n }) as APIInteractionResponseCallbackData;\n }\n\n async reply(options: InteractionResponseCallbackData | 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(\n this.id,\n this.token,\n { ...this.prepareResponsePayload(replyOptions), with_response: true },\n {\n signal: AbortSignal.timeout(5000),\n }\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 with_response: true,\n });\n this.deferred = true;\n return response;\n }\n\n /**\n * Defers the update of a component interaction.\n *\n * @returns A promise that resolves when the update is deferred\n *\n * Responding to a component interaction via the deferUpdate() method acknowledges the interaction and resets the message state.\n * This method can be used to suppress the need for further responses, however it's encouraged to provide meaningful feedback to users via an update() or ephemeral reply() at least.\\\n * Once deferUpdate() has been called, future messages can be sent by calling followUp() or edits can be made by calling editReply() on the component interaction.\n *\n * Example flow:\n * 1. User clicks a button.\n * 2. Bot calls `deferUpdate()` to acknowledge the interaction.\n * 3. Bot performs some processing.\n * 4. Bot calls `editReply()` to update the original message.\n *\n */\n deferUpdate() {\n return this.api.interactions.deferMessageUpdate(this.id, this.token, { with_response: true });\n }\n\n /**\n * Edits the original interaction response.\n *\n * @param options - The options to edit the message with\n * @param messageId - The message id to edit, defaults to `@original`\n * @returns The edited message\n *\n * This is used to edit the original interaction response message.\n *\n * Before using this method, the interaction needs to be replied to first before using this method - with `reply`, `deferReply` or `update`.\n */\n async editReply(options: InteractionResponseCallbackData | string, messageId: Snowflake | \"@original\" = \"@original\") {\n const replyOptions = typeof options === \"string\" ? { content: options } : options;\n const response = await this.api.interactions.editReply(\n this.applicationId,\n this.token,\n this.prepareResponsePayload(replyOptions),\n messageId,\n {\n signal: AbortSignal.timeout(5000),\n }\n );\n this.replied = true;\n return response;\n }\n\n /**\n * Deletes the original interaction response (or a follow-up message).\n *\n * @param messageId - The message id to delete, defaults to `@original`\n * @returns A promise that resolves when the message is deleted\n *\n * This is used to delete the original interaction response message or a follow-up message.\n */\n deleteReply(messageId?: Snowflake | \"@original\") {\n return this.api.interactions.deleteReply(this.applicationId, this.token, messageId);\n }\n\n /**\n * Updates the original interaction response.\n *\n * @param options - The options to update the message with\n * @returns The updated message\n *\n * This is mainly used for component interactions where you want to update the message the component is attached to OR for\n * moodal submit interactions to update the message that opened the modal.\n *\n * After calling this method, the interaction is considered replied and you need to use `editReply` to edit the original response.\n */\n async update(options: InteractionResponseCallbackData | string) {\n const updateOptions = typeof options === \"string\" ? { content: options } : options;\n const response = await this.api.interactions.updateMessage(\n this.id,\n this.token,\n { ...this.prepareResponsePayload(updateOptions), with_response: true },\n {\n signal: AbortSignal.timeout(5000),\n }\n );\n this.replied = true;\n return response;\n }\n\n /**\n * Sends a follow-up message to the interaction.\n *\n * @param options - The options to send the follow-up message with\n * @param forceEphemeral - Whether to force the message to be ephemeral\n * @returns The sent follow-up message\n *\n * This is used to send additional messages after the initial interaction response.\n */\n async followUp(options: InteractionResponseCallbackData | string, forceEphemeral = false) {\n const followUpOptions = typeof options === \"string\" ? { content: options } : options;\n if (forceEphemeral) {\n followUpOptions.flags = (followUpOptions.flags ?? 0) | 64;\n }\n const response = await this.api.interactions.followUp(\n this.applicationId,\n this.token,\n this.prepareResponsePayload(followUpOptions),\n {\n signal: AbortSignal.timeout(5000),\n }\n );\n return response;\n }\n\n // Typeguards\n isCommand(): this is CommandInteraction<ApplicationCommandType, Context> {\n return this.raw.type === InteractionType.ApplicationCommand;\n }\n\n isChatInputCommand(): this is ChatInputCommandInteraction<Context> {\n return (\n this.raw.type === InteractionType.ApplicationCommand &&\n (this.raw as APIApplicationCommandInteraction).data.type === ApplicationCommandType.ChatInput\n );\n }\n\n isUserContextCommand(): this is UserContextInteraction<Context> {\n return (\n this.raw.type === InteractionType.ApplicationCommand &&\n (this.raw as APIApplicationCommandInteraction).data.type === ApplicationCommandType.User\n );\n }\n\n isMessageContextCommand(): this is MessageContextInteraction<Context> {\n return (\n this.raw.type === InteractionType.ApplicationCommand &&\n (this.raw as APIApplicationCommandInteraction).data.type === ApplicationCommandType.Message\n );\n }\n\n isModal(): this is ModalInteraction {\n return this.raw.type === InteractionType.ModalSubmit;\n }\n\n isMessageModal(): this is ModalInteraction<Context & { message: APIMessage }> {\n return this.isModal() && !!this.message;\n }\n\n isMessageComponent(): this is MessageComponentInteraction<Context, MessageComponentType> {\n return this.raw.type === InteractionType.MessageComponent;\n }\n\n isButton(): this is ButtonInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.Button;\n }\n\n isStringSelect(): this is StringSelectInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.StringSelect;\n }\n\n isUserSelect(): this is UserSelectInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.UserSelect;\n }\n\n isRoleSelect(): this is RoleSelectInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.RoleSelect;\n }\n\n isMentionableSelect(): this is MentionableSelectInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.MentionableSelect;\n }\n\n isChannelSelect(): this is ChannelSelectInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.ChannelSelect;\n }\n\n isAutocomplete(): this is AutocompleteInteraction<Context> & { type: InteractionType.ApplicationCommandAutocomplete } {\n return this.raw.type === InteractionType.ApplicationCommandAutocomplete;\n }\n}\n\nexport { BaseInteraction };\n","import { InteractionType } from \"discord-api-types/v10\";\nimport { ModalBuilder } from \"@discordjs/builders\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport type { BaseInteractionContext, ModalInteractionResponseCallbackData } from \"../types\";\n\nclass ModalCapableInteraction<\n Type extends InteractionType,\n Context extends BaseInteractionContext = BaseInteractionContext,\n> extends BaseInteraction<Type, Context> {\n /**\n * Responds to the interaction with a modal.\n *\n * @param data - The modal data to send\n */\n showModal(data: ModalInteractionResponseCallbackData | ModalBuilder) {\n const responseData = {\n ...(data instanceof ModalBuilder ? data.toJSON() : data),\n components:\n data instanceof ModalBuilder\n ? data.components.map((row) => row.toJSON())\n : data.components.map((row) => (this.isJSONEncodable(row) ? row.toJSON() : row)),\n };\n return this.api.interactions.createModal(this.id, this.token, responseData);\n }\n}\n\nexport { ModalCapableInteraction };\n","import { APIApplicationCommandInteraction, ApplicationCommandType, InteractionType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteractionContext } from \"../types\";\nimport { ModalCapableInteraction } from \"./ModalCapableInteraction\";\n\nabstract class CommandInteraction<\n CType extends ApplicationCommandType = ApplicationCommandType,\n Context extends BaseInteractionContext = BaseInteractionContext,\n> extends ModalCapableInteraction<InteractionType.ApplicationCommand, Context> {\n public readonly commandType: CType;\n\n constructor(api: API, interaction: Extract<APIApplicationCommandInteraction, { data: { type: CType } }>, c: Context) {\n super(api, interaction, c);\n this.commandType = interaction.data.type;\n }\n\n get commandName() {\n return this.raw.data.name;\n }\n\n get commandId() {\n return this.raw.data.id;\n }\n\n isOfType<T extends ApplicationCommandType>(type: T): this is CommandInteraction<T, Context> {\n return (this.commandType as ApplicationCommandType) === type;\n }\n}\n\nexport { CommandInteraction };\n","import { ApplicationCommandType, type APIChatInputApplicationCommandInteraction } from \"discord-api-types/v10\";\nimport { CommandInteractionOptionResolver } from \"@resolvers/CommandOptionResolver\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteractionContext } from \"../types\";\nimport { CommandInteraction } from \"./CommandInteraction\";\n\nclass ChatInputCommandInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends CommandInteraction<\n ApplicationCommandType.ChatInput,\n Context\n> {\n public readonly options: CommandInteractionOptionResolver;\n\n constructor(api: API, interaction: APIChatInputApplicationCommandInteraction, c: Context) {\n super(api, interaction, c);\n this.options = new CommandInteractionOptionResolver(interaction.data.options, interaction.data.resolved);\n }\n}\n\nexport { ChatInputCommandInteraction };\n","import type { APIInteraction, APIWebhookEvent } from \"discord-api-types/v10\";\nimport { cloneRawRequest, type HonoRequest } from \"hono/request\";\nimport { BufferSource } from \"../types\";\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 */\nfunction 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 */\nfunction 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\").buffer as BufferSource,\n {\n name: \"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\").buffer as ArrayBuffer,\n message.buffer as ArrayBuffer\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","// From discord.js\ninterface Colors {\n /** 0x1ABC9C | rgb(26,188,156) */\n Aqua: number;\n /** 0x3498DB | rgb(52,152,219) */\n Blue: number;\n /** 0x5865F2 | rgb(88,101,242) */\n Blurple: number;\n /** 0x11806A | rgb(17,128,106) */\n DarkAqua: number;\n /** 0x206694 | rgb(32,102,148) */\n DarkBlue: number;\n /** 0x2C2F33 | rgb(44,47,51) */\n DarkButNotBlack: number;\n /** 0x7F8C8D | rgb(127,140,141) */\n DarkerGrey: number;\n /** 0xC27C0E | rgb(194,124,14) */\n DarkGold: number;\n /** 0x1F8B4C | rgb(31,139,76) */\n DarkGreen: number;\n /** 0x979C9F | rgb(151,156,159) */\n DarkGrey: number;\n /** 0x2C3E50 | rgb(44,62,80) */\n DarkNavy: number;\n /** 0xA84300 | rgb(168,67,0) */\n DarkOrange: number;\n /** 0x71368A | rgb(113,54,138) */\n DarkPurple: number;\n /** 0x992D22 | rgb(153,45,34) */\n DarkRed: number;\n /** 0xAD1457 | rgb(173,20,87) */\n DarkVividPink: number;\n /** 0x000000 | rgb(0,0,0) */\n Default: number;\n /** 0xEB459E | rgb(235,69,158) */\n Fuchsia: number;\n /** 0xF1C40F | rgb(241,196,15) */\n Gold: number;\n /** 0x57F287 | rgb(87,242,135) */\n Green: number;\n /** 0x95A5A6 | rgb(149,165,166) */\n Grey: number;\n /** 0x99AAb5 | rgb(153,170,181) */\n Greyple: number;\n /** 0xBCC0C0 | rgb(188,192,192) */\n LightGrey: number;\n /** 0xE91E63 | rgb(233,30,99) */\n LuminousVividPink: number;\n /** 0x34495E | rgb(52,73,94) */\n Navy: number;\n /** 0x23272A | rgb(35,39,42) */\n NotQuiteBlack: number;\n /** 0xE67E22 | rgb(230,126,34) */\n Orange: number;\n /** 0x9B59B6 | rgb(155,89,182) */\n Purple: number;\n /** 0xED4245 | rgb(237,66,69) */\n Red: number;\n /** 0xFFFFFF | rgb(255,255,255) */\n White: number;\n /** 0xFEE75C | rgb(254,231,92) */\n Yellow: number;\n}\n\nexport const Colors: 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};\n","import { AnyHandler } from \"@ctx/handlers\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { REST } from \"@discordjs/rest\";\nimport { FlatOrNestedArray } from \"../types\";\nimport type { RESTPostAPIApplicationCommandsJSONBody, RESTPostAPIApplicationGuildCommandsJSONBody } from \"discord-api-types/v10\";\n\n/**\n * Registers application commands (Slash and Context Menus) with Discord's API.\n *\n * This function flattens the provided handlers, separates global from guild-specific\n * commands, and performs a bulk overwrite for both.\n *\n * @param token - The Discord Bot token.\n * @param applicationId - The Discord Application ID.\n * @param handlers - A rest parameter of handlers or arrays of handlers to register.\n *\n * @throws {Error} If the API request to Discord fails.\n */\nexport async function registerCommands(\n token: string | undefined,\n applicationId: string | undefined,\n ...handlers: FlatOrNestedArray<AnyHandler>\n) {\n const flatCommands = handlers.flat(Infinity) as AnyHandler[];\n const { globalCommands, guildCommands } = flatCommands\n .map((handler) => {\n if (handler.handlerType === \"slash\" || handler.handlerType === \"context\") {\n return handler;\n }\n return undefined;\n })\n .filter((cmd) => cmd !== undefined)\n .reduce(\n (acc, cmd) => {\n if (cmd.isGuildCommand()) {\n for (const guildId of cmd.guildIds.values()) {\n if (!acc.guildCommands[guildId]) {\n acc.guildCommands[guildId] = [];\n }\n acc.guildCommands[guildId].push(cmd.toJSON());\n }\n } else {\n acc.globalCommands.push(cmd.toJSON());\n }\n return acc;\n },\n {\n globalCommands: [] as RESTPostAPIApplicationCommandsJSONBody[],\n guildCommands: {} as Record<string, RESTPostAPIApplicationGuildCommandsJSONBody[]>,\n }\n );\n\n if (!token || !applicationId) {\n console.warn(\"Token or Application ID not provided, skipping command registration.\");\n return;\n }\n\n const api = new API(new REST({ version: \"10\" }).setToken(token));\n try {\n await api.applicationCommands.bulkOverwriteGlobalCommands(applicationId, globalCommands);\n console.log(`---- ✅ Successfully registered ${globalCommands.length} global commands ----`);\n } catch (error) {\n console.error(\"---- ❌ Error registering global commands ----\");\n throw error;\n }\n\n if (Object.keys(guildCommands).length === 0) {\n return;\n }\n\n const guildCommandsArray = Object.entries(guildCommands).map(([guildId, commands]) => ({ guildId, commands }));\n\n for (const { guildId, commands } of guildCommandsArray) {\n try {\n await api.applicationCommands.bulkOverwriteGuildCommands(applicationId, guildId, commands);\n console.log(`---- ✅ Successfully registered ${commands.length} guild commands for guild ${guildId} ----`);\n } catch (error) {\n console.error(`---- ❌ Error registering guild commands for guild ${guildId} ----`);\n throw error;\n }\n }\n}\n","export * from \"@utils/Colors\";\nexport * from \"@utils/registerCommands\";\n\n/**\n * Parse a custom ID string into its parts.\n *\n * Supports two modes:\n * - onlyPrefix = true: returns the prefix string before the first '/' or '?'.\n * - onlyPrefix = false (default): returns an object with parsed pieces.\n *\n * Expected customId shapes:\n * - \"prefix/component/other/path?param1/param2\"\n * - \"prefix?param1/param2\"\n *\n * @param customId - The custom ID to parse.\n * @param onlyPrefix - If true, only return the prefix string (default: false).\n * @returns If onlyPrefix is true: string (the prefix). Otherwise an object with:\n * - compPath: string[] (full path split by '/'),\n * - prefix: string (first item of compPath),\n * - lastPathItem: string (last item of compPath),\n * - component: string | null (second item of compPath or null),\n * - params: string[] (params split by '/'; empty array when none),\n * - firstParam: string | null,\n * - lastParam: string | null\n *\n * @example\n * parseCustomId(\"modal/user/profile?123/abc\")\n * // => { compPath: [\"modal\",\"user\",\"profile\"], prefix: \"modal\", ... params: [\"123\",\"abc\"], ... }\n *\n * parseCustomId(\"button/click\", true)\n * // => \"button\"\n */\nexport 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};\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 { APIUserApplicationCommandInteraction, APIUser, ApplicationCommandType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteractionContext } from \"../types\";\nimport { CommandInteraction } from \"./CommandInteraction\";\n\nclass UserContextInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends CommandInteraction<\n ApplicationCommandType.User,\n Context\n> {\n public readonly targetUser: APIUser;\n\n constructor(api: API, interaction: APIUserApplicationCommandInteraction, c: Context) {\n super(api, interaction, c);\n this.targetUser = interaction.data.resolved.users[interaction.data.target_id];\n }\n}\n\nexport { UserContextInteraction };\n","import { APIMessage, APIMessageApplicationCommandInteraction, ApplicationCommandType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteractionContext } from \"../types\";\nimport { CommandInteraction } from \"./CommandInteraction\";\n\nclass MessageContextInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends CommandInteraction<\n ApplicationCommandType.Message,\n Context\n> {\n public readonly targetMessage: APIMessage;\n\n constructor(api: API, interaction: APIMessageApplicationCommandInteraction, c: Context) {\n super(api, interaction, c);\n this.targetMessage = interaction.data.resolved.messages[interaction.data.target_id];\n }\n}\n\nexport { MessageContextInteraction };\n","import {\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<Context extends BaseInteractionContext = BaseInteractionContext> extends BaseInteraction<\n InteractionType.ModalSubmit,\n Context\n> {\n public readonly fields: ModalComponentResolver;\n public readonly message?: APIMessage;\n public readonly customId: string;\n\n constructor(api: API, interaction: APIModalSubmitInteraction, c: Context) {\n super(api, interaction, c);\n this.customId = 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<Context extends BaseInteractionContext = BaseInteractionContext> extends BaseInteraction<\n InteractionType.ApplicationCommandAutocomplete,\n Context\n> {\n public readonly options: CommandInteractionOptionResolver;\n public responded = false;\n\n constructor(api: API, interaction: APIApplicationCommandAutocompleteInteraction, c: Context) {\n super(api, interaction, c);\n this.options = new CommandInteractionOptionResolver(interaction.data.options, interaction.data.resolved);\n }\n\n get commandName() {\n return this.raw.data.name;\n }\n\n get commandId() {\n return this.raw.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 { ModalInteraction } from \"./ModalInteraction\";\nimport { ContextMenuCommandBuilder, SlashCommandBuilder } from \"@discordjs/builders\";\nimport { ComponentType } from \"discord-api-types/v10\";\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 ContextMenuCommandType,\n} from \"@discordjs/builders\";\nimport { MessageContextInteraction } from \"./MessageContextCommandInteraction\";\nimport { UserContextInteraction } from \"./UserContextCommandInteraction\";\nimport { parseCustomId } from \"@utils/index\";\nimport { BaseInteractionContext, ContextCommandType, MessageComponentInteractionObj, MessageComponentType } from \"../types\";\n\n/**\n * Handler for chat input commands with optional autocomplete support\n */\nexport class SlashCommandHandler<Context extends BaseInteractionContext = BaseInteractionContext> extends SlashCommandBuilder {\n readonly handlerType = \"slash\";\n private handlerFn?: (interaction: ChatInputCommandInteraction<Context>) => Promise<any> | any;\n private autocompleteFn?: (interaction: AutocompleteInteraction<Context>) => Promise<any> | any;\n /**\n * Set of guild IDs where this command is registered (empty for global commands)\n */\n readonly guildIds = new Set<string>();\n\n isGuildCommand(): boolean {\n return this.guildIds.size > 0;\n }\n\n setGuildIds(guildIds: string[]): this {\n this.guildIds.clear();\n for (const guildId of guildIds) {\n this.guildIds.add(guildId);\n }\n return this;\n }\n\n addGuildIds(...guildIds: string[]): this {\n for (const guildId of guildIds) {\n this.guildIds.add(guildId);\n }\n return this;\n }\n\n removeGuildIds(...guildIds: string[]): this {\n for (const guildId of guildIds) {\n this.guildIds.delete(guildId);\n }\n return this;\n }\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(\n handler: (interaction: ChatInputCommandInteraction<Context>) => Promise<any> | any\n ): SlashCommandHandler<Context> {\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(\n handler: (interaction: AutocompleteInteraction<Context>) => Promise<any> | any\n ): SlashCommandHandler<Context> {\n this.autocompleteFn = handler;\n return this;\n }\n\n /**\n * Executes the command handler\n */\n async execute(interaction: ChatInputCommandInteraction<Context>): 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<Context>): 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 Context extends BaseInteractionContext = BaseInteractionContext,\n T extends ContextCommandType = ContextCommandType,\n InteractionData = T extends ContextCommandType.User ? UserContextInteraction<Context> : MessageContextInteraction<Context>,\n> extends ContextMenuCommandBuilder {\n constructor(public readonly commandType: T) {\n super();\n this.setType(commandType as any); // ContextMenuCommandType is a type, not an enum so the values of the enum ContextCommandType isn't assignable to it directly\n }\n\n readonly handlerType = \"context\";\n private handlerFn?: (interaction: InteractionData) => Promise<any> | any;\n /**\n * Set of guild IDs where this command is registered (empty for global commands)\n */\n readonly guildIds = new Set<string>();\n\n isGuildCommand(): boolean {\n return this.guildIds.size > 0;\n }\n\n setGuildIds(guildIds: string[]): this {\n this.guildIds.clear();\n for (const guildId of guildIds) {\n this.guildIds.add(guildId);\n }\n return this;\n }\n\n addGuildIds(...guildIds: string[]): this {\n for (const guildId of guildIds) {\n this.guildIds.add(guildId);\n }\n return this;\n }\n\n removeGuildIds(...guildIds: string[]): this {\n for (const guildId of guildIds) {\n this.guildIds.delete(guildId);\n }\n return this;\n }\n\n public addHandler(\n handler: (interaction: InteractionData) => Promise<any> | any\n ): ContextCommandHandler<Context, 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 Context extends BaseInteractionContext = BaseInteractionContext,\n CType extends MessageComponentType = MessageComponentType,\n> {\n readonly handlerType = \"component\";\n public readonly prefix: string;\n public readonly componentType: CType;\n private handlerFn?: (interaction: MessageComponentInteractionObj<Context, CType>) => Promise<any> | any;\n\n constructor(\n prefix: string,\n componentType: CType,\n handler?: (interaction: MessageComponentInteractionObj<Context, CType>) => Promise<any> | any\n ) {\n this.componentType = componentType;\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(\n handler: (interaction: MessageComponentInteractionObj<Context, CType>) => Promise<any> | any\n ): ComponentHandler<Context, CType> {\n this.handlerFn = handler;\n return this;\n }\n\n /**\n * Executes the component handler\n */\n async execute(interaction: MessageComponentInteractionObj<Context, CType>): 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<Context extends BaseInteractionContext = BaseInteractionContext> {\n readonly handlerType = \"modal\";\n public readonly prefix: string;\n private handlerFn?: (interaction: ModalInteraction<Context>) => Promise<any> | any;\n\n constructor(prefix: string, handler?: (interaction: ModalInteraction<Context>) => Promise<any> | any) {\n if (!prefix || typeof prefix !== \"string\") {\n throw new TypeError(\"Modal 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: ModalInteraction<Context>) => Promise<any> | any): ModalHandler<Context> {\n this.handlerFn = handler;\n return this;\n }\n\n /**\n * Executes the modal handler\n */\n async execute(interaction: ModalInteraction<Context>): 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<Context extends BaseInteractionContext = BaseInteractionContext> =\n | SlashCommandHandler<Context>\n | ContextCommandHandler<Context, ContextCommandType.User, UserContextInteraction<Context>>\n | ContextCommandHandler<Context, ContextCommandType.Message, MessageContextInteraction<Context>>\n | ComponentHandler<Context, ComponentType.Button>\n | ComponentHandler<Context, ComponentType.StringSelect>\n | ComponentHandler<Context, ComponentType.UserSelect>\n | ComponentHandler<Context, ComponentType.RoleSelect>\n | ComponentHandler<Context, ComponentType.MentionableSelect>\n | ComponentHandler<Context, ComponentType.ChannelSelect>\n | ModalHandler<Context>;\n\nexport type CommandHandler<Context extends BaseInteractionContext = BaseInteractionContext> =\n | SlashCommandHandler<Context>\n | ContextCommandHandler<Context, ContextCommandType.User, UserContextInteraction<Context>>\n | ContextCommandHandler<Context, ContextCommandType.Message, MessageContextInteraction<Context>>;\n\n/**\n * Helper type to allow handlers with any context extending BaseInteractionContext\n */\nexport type AnyHandler = Handler<any>;\n","import { APIMessage, InteractionType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload, MessageComponentType } from \"../types\";\nimport { ModalCapableInteraction } from \"./ModalCapableInteraction\";\n\nabstract class MessageComponentInteraction<\n Context extends BaseInteractionContext = BaseInteractionContext,\n T extends MessageComponentType = MessageComponentType,\n> extends ModalCapableInteraction<InteractionType.MessageComponent, Context> {\n public readonly message: APIMessage;\n public readonly customId: string;\n public readonly componentType: T;\n\n constructor(api: API, interaction: MessageComponentInteractionPayload<T>, c: Context) {\n super(api, interaction, c);\n this.customId = interaction.data.custom_id;\n this.message = interaction.message;\n this.componentType = interaction.data.component_type as T;\n }\n}\n\nexport { MessageComponentInteraction };\n","import { ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\n\nclass ButtonInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends MessageComponentInteraction<\n Context,\n ComponentType.Button\n> {\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.Button>, c: Context) {\n super(api, interaction, c);\n }\n}\n\nexport { ButtonInteraction };\n","import { ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\n\nclass StringSelectInteraction<\n Context extends BaseInteractionContext = BaseInteractionContext,\n> extends MessageComponentInteraction<Context, ComponentType.StringSelect> {\n public readonly values: string[];\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.StringSelect>, c: Context) {\n super(api, interaction, c);\n this.values = interaction.data.values;\n }\n}\n\nexport { StringSelectInteraction };\n","import { APIUser, ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport { Collection } from \"@discordjs/collection\";\n\nclass UserSelectInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends MessageComponentInteraction<\n Context,\n ComponentType.UserSelect\n> {\n public readonly values: string[];\n public readonly users: Collection<string, APIUser>;\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.UserSelect>, c: Context) {\n super(api, interaction, c);\n this.values = interaction.data.values;\n this.users = new Collection(interaction.data.resolved.users ? Object.entries(interaction.data.resolved.users) : []);\n }\n}\n\nexport { UserSelectInteraction };\n","import { APIRole, ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport { Collection } from \"@discordjs/collection\";\n\nclass RoleSelectInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends MessageComponentInteraction<\n Context,\n ComponentType.RoleSelect\n> {\n public readonly values: string[];\n public readonly roles: Collection<string, APIRole>;\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.RoleSelect>, c: Context) {\n super(api, interaction, c);\n this.values = interaction.data.values;\n this.roles = new Collection(interaction.data.resolved.roles ? Object.entries(interaction.data.resolved.roles) : []);\n }\n}\n\nexport { RoleSelectInteraction };\n","import { APIRole, APIUser, ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport { Collection } from \"@discordjs/collection\";\n\nclass MentionableSelectInteraction<\n Context extends BaseInteractionContext = BaseInteractionContext,\n> extends MessageComponentInteraction<Context, ComponentType.MentionableSelect> {\n public readonly values: string[];\n public readonly roles: Collection<string, APIRole>;\n public readonly users: Collection<string, APIUser>;\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.MentionableSelect>, c: Context) {\n super(api, interaction, c);\n this.values = interaction.data.values;\n this.roles = new Collection(interaction.data.resolved.roles ? Object.entries(interaction.data.resolved.roles) : []);\n this.users = new Collection(interaction.data.resolved.users ? Object.entries(interaction.data.resolved.users) : []);\n }\n}\n\nexport { MentionableSelectInteraction };\n","import { APIInteractionDataResolvedChannel, ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport { Collection } from \"@discordjs/collection\";\n\nclass ChannelSelectInteraction<\n Context extends BaseInteractionContext = BaseInteractionContext,\n> extends MessageComponentInteraction<Context, ComponentType.ChannelSelect> {\n public readonly values: string[];\n public readonly channels: Collection<string, APIInteractionDataResolvedChannel>;\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.ChannelSelect>, c: Context) {\n super(api, interaction, c);\n this.values = interaction.data.values;\n this.channels = new Collection(interaction.data.resolved.channels ? Object.entries(interaction.data.resolved.channels) : []);\n }\n}\n\nexport { ChannelSelectInteraction };\n","import {\n APIApplicationCommandAutocompleteInteraction,\n APIApplicationCommandInteraction,\n ApplicationCommandType,\n ComponentType,\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 {\n BaseVariables,\n BaseInteractionContext,\n ValidInteraction,\n MessageComponentInteractionPayload,\n MessageComponentType,\n FlatOrNestedArray,\n MiddlewareFunction,\n} from \"./types\";\nimport { UserContextInteraction } from \"@ctx/UserContextCommandInteraction\";\nimport { MessageContextInteraction } from \"@ctx/MessageContextCommandInteraction\";\nimport { MessageComponentInteraction } from \"@ctx/MessageComponentInteraction\";\nimport { ModalInteraction } from \"@ctx/ModalInteraction\";\nimport { AutocompleteInteraction } from \"@ctx/AutocompleteInteraction\";\nimport {\n SlashCommandHandler,\n ContextCommandHandler,\n ComponentHandler,\n ModalHandler,\n type Handler,\n AnyHandler,\n} from \"@ctx/handlers\";\nimport { ButtonInteraction } from \"@ctx/ButtonInteraction\";\nimport { StringSelectInteraction } from \"@ctx/StringSelectInteraction\";\nimport { UserSelectInteraction } from \"@ctx/UserSelectInteraction\";\nimport { RoleSelectInteraction } from \"@ctx/RoleSelectInteraction\";\nimport { MentionableSelectInteraction } from \"@ctx/MentionableSelectInteraction\";\nimport { ChannelSelectInteraction } from \"@ctx/ChannelSelectInteraction\";\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 c.env.IS_CF_WORKER === \"true\" # later determined from environment variable\n */\n isCFWorker?: boolean;\n /**\n * Whether to turn on debug logging for REST API requests.\n *\n * @default false\n */\n debugRest?: boolean;\n}\n\nexport class Honocord {\n /**\n * Map of commandName to CommandHandler instances for global commands.\n */\n private globalCommandHandlers = new Map<string, SlashCommandHandler | ContextCommandHandler>();\n /**\n * Map of `guildId:commandName` to CommandHandler instances for guild-specific commands.\n */\n private guildCommandHandlers = new Map<string, SlashCommandHandler | ContextCommandHandler>();\n private componentHandlers = new Map<string, ComponentHandler>();\n private modalHandlers = new Map<string, ModalHandler>();\n private middleware = new Array<MiddlewareFunction<any>>();\n private isCFWorker: boolean;\n private debugRest: boolean;\n\n /**\n * Executes all registered middleware in sequence.\n *\n * @param ctx - The interaction context\n * @param finalHandler - The final handler to execute after all middleware\n */\n private async runMiddleware(ctx: BaseInteractionContext, finalHandler: () => Promise<void>): Promise<void> {\n if (this.middleware.length === 0) {\n return await finalHandler();\n }\n\n /**\n * Executes the next middleware in the chain.\n */\n const dispatch = async (i: number = 0): Promise<void> => {\n if (i >= this.middleware.length) {\n return await finalHandler();\n }\n\n await this.middleware[i](ctx, () => dispatch(i + 1));\n };\n\n await dispatch();\n }\n\n constructor({ isCFWorker, debugRest }: HonocordOptions = {}) {\n this.isCFWorker = isCFWorker ?? false;\n this.debugRest = debugRest ?? false;\n }\n\n /**\n * Registers handlers for interactions.\n *\n * @param handlers - Array of CommandHandler, ComponentHandler, or ModalHandler instances\n *\n * For an example of usage, see the [Example Repository](https://github.com/The-LukeZ/honocord-examples).\n */\n loadHandlers(...handlers: FlatOrNestedArray<AnyHandler>): void {\n const flattenedHandlers = handlers.flat(Infinity) as Handler[];\n\n for (const handler of flattenedHandlers) {\n if (handler instanceof SlashCommandHandler || handler instanceof ContextCommandHandler) {\n if (handler.isGuildCommand()) {\n for (const guildId of handler.guildIds.values()) {\n const key = `${guildId}:${handler.name}`;\n if (this.guildCommandHandlers.has(key)) {\n console.warn(`Guild command handler for \"${handler.name}\" in guild \"${guildId}\" already exists. Overwriting.`);\n }\n this.guildCommandHandlers.set(key, handler as SlashCommandHandler | ContextCommandHandler);\n }\n continue;\n }\n\n if (this.globalCommandHandlers.has(handler.name)) {\n console.warn(`Command handler for \"${handler.name}\" already exists. Overwriting.`);\n }\n this.globalCommandHandlers.set(handler.name, handler as SlashCommandHandler | ContextCommandHandler);\n } else if (handler instanceof ComponentHandler) {\n const prefix = handler.prefix;\n if (this.componentHandlers.has(prefix)) {\n console.warn(`Component handler with prefix \"${prefix}\" already exists. Overwriting.`);\n }\n this.componentHandlers.set(prefix, handler as ComponentHandler<any>);\n } else if (handler instanceof ModalHandler) {\n const prefix = handler.prefix;\n if (this.modalHandlers.has(prefix)) {\n console.warn(`Modal handler with prefix \"${prefix}\" already exists. Overwriting.`);\n }\n this.modalHandlers.set(prefix, 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 UserContextInteraction(api, interaction as any, ctx);\n case ApplicationCommandType.Message:\n return new MessageContextInteraction(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 executeCommandHandler(\n handler: SlashCommandHandler | ContextCommandHandler,\n interactionObj: ReturnType<typeof this.createCommandInteraction>,\n commandType: ApplicationCommandType\n ) {\n if (handler instanceof SlashCommandHandler && commandType === ApplicationCommandType.ChatInput) {\n return handler.execute(interactionObj as ChatInputCommandInteraction);\n } else if (handler instanceof ContextCommandHandler) {\n if (commandType === ApplicationCommandType.User) {\n return handler.execute(interactionObj as UserContextInteraction);\n } else if (commandType === ApplicationCommandType.Message) {\n return handler.execute(interactionObj as MessageContextInteraction);\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.globalCommandHandlers.get(commandName);\n\n // Store interaction in context for middleware access\n ctx.set(\"command\", interactionObj as any);\n\n await this.runMiddleware(ctx, async () => {\n if (handler) {\n try {\n await this.executeCommandHandler(handler, interactionObj, interaction.data.type);\n } catch (error) {\n console.error(`Error executing command handler for \"${commandName}\"`, error);\n throw error;\n }\n }\n\n // Could be a guild command\n const guildId = interaction.guild_id;\n if (guildId) {\n const key = `${guildId}:${commandName}`;\n const guildHandler = this.guildCommandHandlers.get(key);\n if (guildHandler) {\n try {\n await this.executeCommandHandler(guildHandler, interactionObj, interaction.data.type);\n } catch (error) {\n console.error(`Error executing guild command handler for \"${commandName}\" in guild \"${guildId}\"`, error);\n throw error;\n }\n }\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.globalCommandHandlers.get(commandName);\n\n // Store interaction in context for middleware access\n ctx.set(\"autocomplete\", interactionObj as any);\n\n await this.runMiddleware(ctx, async () => {\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 // Could be a guild command\n const guildId = interaction.guild_id;\n if (guildId) {\n const key = `${guildId}:${commandName}`;\n const guildHandler = this.guildCommandHandlers.get(key);\n if (guildHandler && guildHandler instanceof SlashCommandHandler) {\n try {\n await guildHandler.executeAutocomplete(interactionObj);\n } catch (error) {\n console.error(`Error executing guild autocomplete handler for \"${commandName}\" in guild \"${guildId}\"`, error);\n throw error;\n }\n }\n }\n });\n }\n\n private createMessageComponentInteraction<T extends MessageComponentType>(\n ctx: BaseInteractionContext,\n interactionObj: MessageComponentInteractionPayload<T>,\n api: API\n ) {\n switch (interactionObj.data.component_type) {\n case ComponentType.Button:\n return new ButtonInteraction(api, interactionObj as any, ctx);\n case ComponentType.StringSelect:\n return new StringSelectInteraction(api, interactionObj as any, ctx);\n case ComponentType.UserSelect:\n return new UserSelectInteraction(api, interactionObj as any, ctx);\n case ComponentType.RoleSelect:\n return new RoleSelectInteraction(api, interactionObj as any, ctx);\n case ComponentType.MentionableSelect:\n return new MentionableSelectInteraction(api, interactionObj as any, ctx);\n case ComponentType.ChannelSelect:\n return new ChannelSelectInteraction(api, interactionObj as any, ctx);\n default:\n throw new Error(`Unsupported message component type: ${(interactionObj.data as any).component_type}`);\n }\n }\n\n private async handleComponentInteraction<T extends MessageComponentType>(\n ctx: BaseInteractionContext,\n interaction: MessageComponentInteractionPayload<T>,\n api: API\n ) {\n const interactionObj = this.createMessageComponentInteraction(ctx, interaction, api);\n const prefix = parseCustomId(interaction.data.custom_id, true);\n\n // Store interaction in context for middleware access\n ctx.set(\"component\", interactionObj as any);\n\n await this.runMiddleware(ctx, async () => {\n // Lookup handler by prefix\n const handler = this.componentHandlers.get(prefix);\n if (handler?.componentType === interaction.data.component_type) {\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 } else {\n throw new Error(\n `No component handler found for prefix \"${prefix}\" and component type \"${interaction.data.component_type}\"`\n );\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 // Store interaction in context for middleware access\n ctx.set(\"modal\", interactionObj);\n\n await this.runMiddleware(ctx, async () => {\n // Lookup handler by prefix\n const handler = this.modalHandlers.get(prefix);\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\n return interactionObj;\n }\n\n private async createInteraction(ctx: BaseInteractionContext, interaction: ValidInteraction) {\n const rest = new REST({ authPrefix: \"Bot\" }).setToken(ctx.env.DISCORD_TOKEN as string);\n if (this.debugRest) {\n rest\n .addListener(\"response\", (request, response) => {\n console.debug(\n `[REST] ${request.method} ${request.path} -> ${response.status} ${response.statusText} (${request.route})`\n );\n })\n .addListener(\"restDebug\", (info) => {\n console.debug(`[REST DEBUG] ${info}`);\n });\n }\n const api = new API(rest);\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 * @example\n * ```typescript\n * import { Hono } from \"hono\";\n * import { Honocord } from \"honocord\";\n *\n * const app = new Hono();\n * const bot = new Honocord();\n *\n * app.get(\"/\", (c) => c.text(\"🔥 Honocord is running!\"));\n * app.post(\"/interactions\", bot.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 console.log(\"Received Discord 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 * @example\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 /**\n * Registers a middleware function to process interaction contexts.\n *\n * Middleware receives the Hono context and a `next` callback:\n * - Access/modify context variables via `c.get()` and `c.set()`\n * - Access the interaction object via `c.var.command`, `c.var.component`, `c.var.modal`, or `c.var.autocomplete`\n * - Access environment bindings via `c.env`\n * - Call `await next()` to continue to the next middleware or handler\n *\n * The context is passed by reference, so all modifications persist through the middleware chain and into handlers.\n *\n * @example\n * ```typescript\n * bot.use(async (c, next) => {\n * // Set custom data in context\n * c.set('startTime', Date.now());\n *\n * // Continue to next middleware/handler\n * // you can also return next() directly if no post-processing is needed\n * await next();\n *\n * // Code here runs after the handler completes\n * console.log('Duration:', Date.now() - c.get('startTime'));\n * });\n * ```\n *\n * @param middleware - The middleware function(s) to register.\n * @returns The Honocord instance for chaining.\n */\n use<Context extends BaseInteractionContext = BaseInteractionContext>(...middleware: MiddlewareFunction<Context>[]): this {\n this.middleware.push(...middleware);\n return this;\n }\n\n /**\n * Clears all registered middleware functions.\n * @returns The Honocord instance for chaining.\n */\n clearMiddleware(): this {\n this.middleware = [];\n return this;\n }\n}\n","import { AutocompleteInteraction } from \"@ctx/AutocompleteInteraction\";\nimport type { ChatInputCommandInteraction } from \"@ctx/ChatInputInteraction\";\nimport type { ModalInteraction } from \"@ctx/ModalInteraction\";\nimport type { UserContextInteraction } from \"@ctx/UserContextCommandInteraction\";\nimport type { MessageContextInteraction } from \"@ctx/MessageContextCommandInteraction\";\nimport type { Collection } from \"@discordjs/collection\";\nimport type { Snowflake } from \"discord-api-types/globals\";\nimport {\n APIAttachment,\n APIEmbed,\n APIInteraction,\n APIInteractionDataResolvedChannel,\n APIInteractionDataResolvedGuildMember,\n APIInteractionResponseCallbackData,\n APILabelComponent,\n APIMessageButtonInteractionData,\n APIMessageChannelSelectInteractionData,\n APIMessageMentionableSelectInteractionData,\n APIMessageRoleSelectInteractionData,\n APIMessageStringSelectInteractionData,\n APIMessageTopLevelComponent,\n APIMessageUserSelectInteractionData,\n APIModalInteractionResponseCallbackData,\n APIPingInteraction,\n APIRole,\n APIUser,\n ApplicationCommandType,\n ComponentType,\n InteractionType,\n} from \"discord-api-types/v10\";\nimport type { Context } from \"hono\";\nimport type { Bindings, BlankInput, Variables } from \"hono/types\";\nimport { ButtonInteraction } from \"@ctx/ButtonInteraction\";\nimport { StringSelectInteraction } from \"@ctx/StringSelectInteraction\";\nimport { UserSelectInteraction } from \"@ctx/UserSelectInteraction\";\nimport { MentionableSelectInteraction } from \"@ctx/MentionableSelectInteraction\";\nimport { RoleSelectInteraction } from \"@ctx/RoleSelectInteraction\";\nimport { ChannelSelectInteraction } from \"@ctx/ChannelSelectInteraction\";\n\n/**\n * Base variables that the library uses\n */\nexport interface BaseVariables {\n autocomplete?: ChatInputCommandInteraction;\n command?: ChatInputCommandInteraction;\n modal?: ModalInteraction;\n component?: TMessageComponentInteraction;\n}\n\nexport type TMessageComponentInteraction<Context extends BaseInteractionContext = BaseInteractionContext> =\n | ButtonInteraction<Context>\n | StringSelectInteraction<Context>\n | UserSelectInteraction<Context>\n | RoleSelectInteraction<Context>\n | MentionableSelectInteraction<Context>\n | ChannelSelectInteraction<Context>;\n\nexport type MessageComponentInteractionObj<\n Context extends BaseInteractionContext = BaseInteractionContext,\n T extends MessageComponentType = MessageComponentType,\n> = Extract<\n TMessageComponentInteraction<Context>,\n {\n componentType: T;\n }\n>;\n\n/**\n * Base context environment\n */\nexport interface BaseHonocordEnv<TBindings extends Bindings = any, TVariables extends Variables = any> {\n /**\n * Bindings available in the environment (from the worker)\n */\n Bindings: TBindings;\n /**\n * Variables available in the context (from Hono + Honocord)\n */\n Variables: BaseVariables & TVariables;\n}\n\n/**\n * Generic context type that users can extend for type-safe access to environment bindings and variables.\n *\n * @template TBindings - Custom environment bindings (e.g., Cloudflare Workers env)\n * @template TVariables - Custom Hono variables\n * @template TPath - The path type for the context\n *\n * @example\n * ```ts\n * // types.ts\n * import type { BaseHonocordEnv, BaseInteractionContext } from \"honocord\";\n *\n * // Define your custom environment\n * import type { BaseHonocordEnv, BaseInteractionContext } from \"honocord\";\n *\n * // Define your custom environment bindings (e.g., Cloudflare Workers env)\n * export interface MyEnv {\n * DISCORD_TOKEN: string;\n * DISCORD_PUBLIC_KEY: string;\n * DATABASE: D1Database; // Example Cloudflare D1\n * }\n *\n * // Define your custom Hono variables (can be populated by middleware)\n * export interface MyVariables {\n * user_id: string;\n * is_admin: boolean;\n * }\n *\n * // Create a reusable context type\n * export type MyContext = BaseInteractionContext<MyEnv, MyVariables>;\n *\n * // index.ts\n * import { Honocord, SlashCommandHandler } from \"honocord\";\n * import type { MyContext } from \"./types\";\n *\n * const bot = new Honocord();\n *\n * const command = new SlashCommandHandler()\n * .setName(\"query\")\n * .setDescription(\"Query the database\");\n *\n * command.addHandler(async (interaction: MyContext) => {\n * // Type-safe access to your environment\n * const db = interaction.env.DATABASE;\n * const result = await db.prepare(\"SELECT * FROM users\").all();\n * await interaction.reply(`Found ${result.results.length} users`);\n * });\n *\n * bot.loadHandlers([command]);\n * ```\n */\nexport type BaseInteractionContext<\n TBindings extends Bindings = any,\n TVariables extends Variables = any,\n TPath extends string = \"/\",\n> = Context<BaseHonocordEnv<TBindings, TVariables>, TPath, BlankInput>;\n\n/**\n * Collections of resolved data from Discord API interactions.\n *\n * When users or roles are mentioned in command options, Discord resolves them and provides\n * the full data in these collections for easy access.\n */\nexport interface APIInteractionDataResolvedCollections {\n /** Map of user IDs to user objects */\n users?: Collection<Snowflake, APIUser>;\n /** Map of role IDs to role objects */\n roles?: Collection<Snowflake, APIRole>;\n /** Map of user IDs to guild member objects */\n members?: Collection<Snowflake, APIInteractionDataResolvedGuildMember>;\n /** Map of channel IDs to channel objects */\n channels?: Collection<Snowflake, APIInteractionDataResolvedChannel>;\n /** Map of attachment IDs to attachment objects */\n attachments?: Collection<Snowflake, APIAttachment>;\n}\n\n/** Represents an interaction which the lib user can handle themselves (ping is handled internally) */\nexport type ValidInteraction = Exclude<APIInteraction, APIPingInteraction>;\n\nexport type MessageComponentType =\n | ComponentType.Button\n | ComponentType.StringSelect\n | ComponentType.UserSelect\n | ComponentType.RoleSelect\n | ComponentType.MentionableSelect\n | ComponentType.ChannelSelect;\n\nexport type MessageComponentDataTypes = {\n [ComponentType.Button]: APIMessageButtonInteractionData;\n [ComponentType.StringSelect]: APIMessageStringSelectInteractionData;\n [ComponentType.UserSelect]: APIMessageUserSelectInteractionData;\n [ComponentType.RoleSelect]: APIMessageRoleSelectInteractionData;\n [ComponentType.MentionableSelect]: APIMessageMentionableSelectInteractionData;\n [ComponentType.ChannelSelect]: APIMessageChannelSelectInteractionData;\n};\n\nexport type MessageComponentInteractionPayload<T extends MessageComponentType = MessageComponentType> = Extract<\n ValidInteraction,\n {\n type: InteractionType.MessageComponent;\n }\n> & {\n data: MessageComponentDataTypes[T];\n};\n\nexport enum ContextCommandType {\n User = ApplicationCommandType.User,\n Message = ApplicationCommandType.Message,\n}\n\nexport type BufferSource = ArrayBufferView | ArrayBuffer;\n\nexport type FlatOrNestedArray<T> = T[] | T[][];\n\n/**\n * Represents an object capable of representing itself as a JSON object\n *\n * @typeParam Value - The JSON type corresponding to {@link JSONEncodable.toJSON} outputs.\n */\nexport interface JSONEncodable<Value> {\n /**\n * Transforms this object to its JSON format\n */\n toJSON(): Value;\n}\n\nexport type AnyInteraction<Context extends BaseInteractionContext = BaseInteractionContext> =\n | ChatInputCommandInteraction<Context>\n | UserContextInteraction<Context>\n | MessageContextInteraction<Context>\n | TMessageComponentInteraction<Context>\n | ModalInteraction<Context>\n | AutocompleteInteraction<Context>;\n\nexport type HandlerFunction<\n Context extends BaseInteractionContext = BaseInteractionContext,\n InteractionArg extends AnyInteraction<Context> = AnyInteraction<Context>,\n> = (interaction: InteractionArg) => Promise<any> | any;\n\n/**\n * Middleware function type for processing interaction contexts.\n *\n * Helpful for implementing cross-cutting concerns such as logging, authentication, setting of the DB, etc.\n */\nexport type MiddlewareFunction<Context extends BaseInteractionContext = BaseInteractionContext> = (\n context: Context,\n next: () => Promise<void>\n) => Promise<Response | void> | Response | void;\n\n// ---------------------------------------------------------------------------------------------\n// The following types are typings which are derived from discord-api-types but we are using Builders so be have to redefine them\n// ---------------------------------------------------------------------------------------------\n\nexport interface InteractionResponseCallbackData extends Omit<APIInteractionResponseCallbackData, \"components\" | \"embeds\"> {\n /**\n * The components to include with the message\n *\n * Application-owned webhooks can always send components. Non-application-owned webhooks cannot send interactive components, and the `components` field will be ignored unless they set the `with_components` query param.\n *\n * Can be `ActionRowBuilder` or raw APIMessageActionRowComponent\n *\n * If using Components V2, ensure that `flags` includes `MessageFlags.IsComponentsV2` is set.\n *\n * @see {@link https://discord.com/developers/docs/components/reference}\n */\n components?: (JSONEncodable<APIMessageTopLevelComponent> | APIMessageTopLevelComponent)[];\n /**\n * Embedded `rich` content\n *\n * Can be `EmbedBuilder` or raw APIEmbed\n *\n * @see {@link https://discord.com/developers/docs/resources/channel#embed-object}\n */\n embeds?: (JSONEncodable<APIEmbed> | APIEmbed)[];\n}\n\nexport interface ModalInteractionResponseCallbackData extends Omit<APIModalInteractionResponseCallbackData, \"components\"> {\n /**\n * The components to include with the modal\n *\n * Can be `LabelBuilder` or raw APILabelComponent.\n *\n * @see {@link https://discord.com/developers/docs/interactions/message-components#action-rows}\n */\n components: (JSONEncodable<APILabelComponent> | APILabelComponent)[];\n}\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,IAAIA,aAAW,eAAe,OAAO,QAAQ,aAAa,GAAG,EAAE,CAAC;AAEnF,UAAO;KACN,EAAE,CAAmD;AAGxD,MAAI,KAAK,gBAAgB,IAAI,SAAS,6BAA6B,iBAAiB;AAClF,QAAK,SAAS,KAAK,gBAAgB,GAAG;AACtC,QAAK,kBAAkB,KAAK,gBAAgB,GAAG,WAAW,EAAE;;AAI9D,MAAI,KAAK,gBAAgB,IAAI,SAAS,6BAA6B,YAAY;AAC7E,QAAK,cAAc,KAAK,gBAAgB,GAAG;AAC3C,QAAK,kBAAkB,KAAK,gBAAgB,GAAG,WAAW,EAAE;;;CAIhE,IAAW,OAAO;AAChB,SAAO,KAAK;;;;;;;;;;CAWd,IAA4C,MAAc,MAAS,WAAW,OAAO;EACnF,MAAM,SAAS,KAAK,gBAAgB,MAAM,QAAQ,IAAI,SAAS,KAAK;AACpE,MAAI,CAAC,QAAQ;AACX,OAAI,SACF,OAAM,IAAI,UAAU,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAG9D,UAAO;;AAGT,MAAI,OAAO,SAAS,KAClB,OAAM,IAAI,UAAU,wBAAwB,EAAE,OAAO;GAAE;GAAM,M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SAASA,kBAAgB,MAAM;AAC7C,WAAQ,IAAI,wBAAwB;AACpC,UAAO,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCT,IAAqE,GAAG,YAAiD;AACvH,OAAK,WAAW,KAAK,GAAG,WAAW;AACnC,SAAO;;;;;;CAOT,kBAAwB;AACtB,OAAK,aAAa,EAAE;AACpB,SAAO;;;;;;AC5SX,IAAY,oEAAL;AACL,qDAAOC,yBAAuB;AAC9B,wDAAUA,yBAAuB"}
1
+ {"version":3,"file":"index.mjs","names":["Collection","InteractionType","ApplicationCommandType","ComponentType","ModalBuilder","Collection","ComponentType","Collection","Collection","Collection","Collection","ApplicationCommandType","ComponentType","InteractionType","ApplicationCommandType"],"sources":["../src/resolvers/CommandOptionResolver.ts","../src/interactions/BaseInteraction.ts","../src/interactions/ModalCapableInteraction.ts","../src/interactions/CommandInteraction.ts","../src/interactions/ChatInputInteraction.ts","../src/utils/discordVerify.ts","../src/utils/Colors.ts","../src/utils/registerCommands.ts","../src/utils/index.ts","../src/interactions/UserContextCommandInteraction.ts","../src/interactions/MessageContextCommandInteraction.ts","../src/resolvers/ModalComponentResolver.ts","../src/interactions/ModalInteraction.ts","../src/interactions/AutocompleteInteraction.ts","../src/interactions/handlers.ts","../src/interactions/MessageComponentInteraction.ts","../src/interactions/ButtonInteraction.ts","../src/interactions/StringSelectInteraction.ts","../src/interactions/UserSelectInteraction.ts","../src/interactions/RoleSelectInteraction.ts","../src/interactions/MentionableSelectInteraction.ts","../src/interactions/ChannelSelectInteraction.ts","../src/Honocord.ts","../src/types.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, ResolvedSelectedGuildMember } 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 if (key === \"members\") {\n // get users and combine them with members for easy access; a user is expected to ALWAYS be present if a member is\n const users = resolved?.users ? new Collection(Object.entries(resolved.users)) : new Collection();\n const members = resolvedData ? new Collection(Object.entries(resolvedData)) : new Collection();\n const combined = new Collection([...members.entries()].map(([id, member]) => [id, { ...member, user: users.get(id)! }]));\n acc[key] = combined;\n return acc;\n }\n const collection = new Collection(resolvedData ? Object.entries(resolvedData) : []);\n acc[key as keyof APIInteractionDataResolvedCollections] = collection;\n return acc;\n }, {} as any);\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): ResolvedSelectedGuildMember | null;\n getMember(name: string, required: true): ResolvedSelectedGuildMember;\n getMember(name: string, required: boolean = false): ResolvedSelectedGuildMember | 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): ResolvedSelectedGuildMember | APIUser | APIRole | null;\n getMentionable(name: string, required: true): ResolvedSelectedGuildMember | APIUser | APIRole;\n getMentionable(name: string, required: boolean = false): (ResolvedSelectedGuildMember | 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 Snowflake,\n APIInteractionResponseCallbackData,\n APIPartialInteractionGuild,\n APIUser,\n ApplicationCommandType,\n InteractionType,\n Locale,\n APIApplicationCommandInteraction,\n ComponentType,\n APIMessage,\n} from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { REST } from \"@discordjs/rest\";\nimport { ModalInteraction } from \"./ModalInteraction\";\nimport type {\n BaseInteractionContext,\n InteractionResponseCallbackData,\n JSONEncodable,\n MessageComponentType,\n ValidInteraction,\n} from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport { AutocompleteInteraction } from \"./AutocompleteInteraction\";\nimport { CommandInteraction } from \"./CommandInteraction\";\nimport { ChatInputCommandInteraction } from \"./ChatInputInteraction\";\nimport { UserContextInteraction } from \"./UserContextCommandInteraction\";\nimport { MessageContextInteraction } from \"./MessageContextCommandInteraction\";\nimport { ButtonInteraction } from \"./ButtonInteraction\";\nimport { StringSelectInteraction } from \"./StringSelectInteraction\";\nimport { UserSelectInteraction } from \"./UserSelectInteraction\";\nimport { RoleSelectInteraction } from \"./RoleSelectInteraction\";\nimport { MentionableSelectInteraction } from \"./MentionableSelectInteraction\";\nimport { ChannelSelectInteraction } from \"./ChannelSelectInteraction\";\n\nfunction snakeCase(str: string): string {\n return str\n .replace(/([a-z0-9])([A-Z])/g, \"$1_$2\")\n .replace(/([A-Z])([A-Z][a-z])/g, \"$1_$2\")\n .toLowerCase();\n}\n\n/**\n * Transforms camel-cased keys into snake cased keys\n *\n * @param {*} obj The object to transform\n * @returns {*} The transformed object\n */\nfunction toSnakeCase(obj: any): any {\n if (typeof obj !== \"object\" || !obj) return obj;\n if (obj instanceof Date) return obj;\n if (isJSONEncodable(obj)) return toSnakeCase(obj.toJSON());\n if (Array.isArray(obj)) return obj.map(toSnakeCase);\n return Object.fromEntries(Object.entries(obj).map(([key, value]) => [snakeCase(key), toSnakeCase(value)]));\n}\n\n/**\n * Indicates if an object is encodable or not.\n *\n * @param maybeEncodable - The object to check against\n */\nfunction isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown> {\n return (\n maybeEncodable !== null &&\n typeof maybeEncodable === \"object\" &&\n \"toJSON\" in maybeEncodable &&\n typeof maybeEncodable[\"toJSON\"] === \"function\"\n );\n}\n\nabstract class BaseInteraction<Type extends InteractionType, Context extends BaseInteractionContext = BaseInteractionContext> {\n public readonly type: Type;\n /** The raw interaction data */\n protected readonly raw: Extract<ValidInteraction, { 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: Context;\n\n constructor(\n protected api: API,\n data: Extract<ValidInteraction, { type: Type }>,\n context: Context\n ) {\n this.type = data.type as Type;\n this.raw = { ...data };\n this.rest = api.rest;\n this.context = context;\n }\n\n get applicationId() {\n return this.raw.application_id;\n }\n\n get entitlements() {\n return this.raw.entitlements;\n }\n\n get channelId() {\n return this.raw.channel?.id;\n }\n\n get channel() {\n return this.raw.channel;\n }\n\n get guildId() {\n return this.raw.guild_id;\n }\n\n get guild() {\n return this.raw.guild;\n }\n\n get userId() {\n return this.raw.user?.id;\n }\n\n get user() {\n return (this.raw.member?.user || this.raw.user) as APIUser; // One is always given.\n }\n\n get member() {\n return this.raw.member;\n }\n\n get locale() {\n return this.raw.guild_locale;\n }\n\n get guildLocale() {\n return this.raw.guild_locale;\n }\n\n get token() {\n return this.raw.token;\n }\n\n get id() {\n return this.raw.id;\n }\n\n get appPermissions() {\n return this.raw.app_permissions;\n }\n\n get version() {\n return this.raw.version;\n }\n\n protected isJSONEncodable(obj: unknown): obj is JSONEncodable<unknown> {\n return isJSONEncodable(obj);\n }\n\n protected toSnakeCase(obj: unknown): unknown {\n return toSnakeCase(obj);\n }\n\n inGuild(): this is BaseInteraction<Type> & { guild_id: Snowflake; guild: APIPartialInteractionGuild; guild_locale: Locale } {\n return Boolean(this.raw.guild_id && this.raw.guild && this.raw.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 private prepareResponsePayload(options: InteractionResponseCallbackData): APIInteractionResponseCallbackData {\n return this.toSnakeCase({\n ...options,\n components: options.components?.map((component) => (this.isJSONEncodable(component) ? component.toJSON() : component)),\n embeds: options.embeds?.map((embed) => (this.isJSONEncodable(embed) ? embed.toJSON() : embed)),\n }) as APIInteractionResponseCallbackData;\n }\n\n async reply(options: InteractionResponseCallbackData | 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(\n this.id,\n this.token,\n { ...this.prepareResponsePayload(replyOptions), with_response: true },\n {\n signal: AbortSignal.timeout(5000),\n }\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 with_response: true,\n });\n this.deferred = true;\n return response;\n }\n\n /**\n * Defers the update of a component interaction.\n *\n * @returns A promise that resolves when the update is deferred\n *\n * Responding to a component interaction via the deferUpdate() method acknowledges the interaction and resets the message state.\n * This method can be used to suppress the need for further responses, however it's encouraged to provide meaningful feedback to users via an update() or ephemeral reply() at least.\\\n * Once deferUpdate() has been called, future messages can be sent by calling followUp() or edits can be made by calling editReply() on the component interaction.\n *\n * Example flow:\n * 1. User clicks a button.\n * 2. Bot calls `deferUpdate()` to acknowledge the interaction.\n * 3. Bot performs some processing.\n * 4. Bot calls `editReply()` to update the original message.\n *\n */\n deferUpdate() {\n return this.api.interactions.deferMessageUpdate(this.id, this.token, { with_response: true });\n }\n\n /**\n * Edits the original interaction response.\n *\n * @param options - The options to edit the message with\n * @param messageId - The message id to edit, defaults to `@original`\n * @returns The edited message\n *\n * This is used to edit the original interaction response message.\n *\n * Before using this method, the interaction needs to be replied to first before using this method - with `reply`, `deferReply` or `update`.\n */\n async editReply(options: InteractionResponseCallbackData | string, messageId: Snowflake | \"@original\" = \"@original\") {\n const replyOptions = typeof options === \"string\" ? { content: options } : options;\n const response = await this.api.interactions.editReply(\n this.applicationId,\n this.token,\n this.prepareResponsePayload(replyOptions),\n messageId,\n {\n signal: AbortSignal.timeout(5000),\n }\n );\n this.replied = true;\n return response;\n }\n\n /**\n * Deletes the original interaction response (or a follow-up message).\n *\n * @param messageId - The message id to delete, defaults to `@original`\n * @returns A promise that resolves when the message is deleted\n *\n * This is used to delete the original interaction response message or a follow-up message.\n */\n deleteReply(messageId?: Snowflake | \"@original\") {\n return this.api.interactions.deleteReply(this.applicationId, this.token, messageId);\n }\n\n /**\n * Updates the original interaction response.\n *\n * @param options - The options to update the message with\n * @returns The updated message\n *\n * This is mainly used for component interactions where you want to update the message the component is attached to OR for\n * moodal submit interactions to update the message that opened the modal.\n *\n * After calling this method, the interaction is considered replied and you need to use `editReply` to edit the original response.\n */\n async update(options: InteractionResponseCallbackData | string) {\n const updateOptions = typeof options === \"string\" ? { content: options } : options;\n const response = await this.api.interactions.updateMessage(\n this.id,\n this.token,\n { ...this.prepareResponsePayload(updateOptions), with_response: true },\n {\n signal: AbortSignal.timeout(5000),\n }\n );\n this.replied = true;\n return response;\n }\n\n /**\n * Sends a follow-up message to the interaction.\n *\n * @param options - The options to send the follow-up message with\n * @param forceEphemeral - Whether to force the message to be ephemeral\n * @returns The sent follow-up message\n *\n * This is used to send additional messages after the initial interaction response.\n */\n async followUp(options: InteractionResponseCallbackData | string, forceEphemeral = false) {\n const followUpOptions = typeof options === \"string\" ? { content: options } : options;\n if (forceEphemeral) {\n followUpOptions.flags = (followUpOptions.flags ?? 0) | 64;\n }\n const response = await this.api.interactions.followUp(\n this.applicationId,\n this.token,\n this.prepareResponsePayload(followUpOptions),\n {\n signal: AbortSignal.timeout(5000),\n }\n );\n return response;\n }\n\n // Typeguards\n isCommand(): this is CommandInteraction<ApplicationCommandType, Context> {\n return this.raw.type === InteractionType.ApplicationCommand;\n }\n\n isChatInputCommand(): this is ChatInputCommandInteraction<Context> {\n return (\n this.raw.type === InteractionType.ApplicationCommand &&\n (this.raw as APIApplicationCommandInteraction).data.type === ApplicationCommandType.ChatInput\n );\n }\n\n isUserContextCommand(): this is UserContextInteraction<Context> {\n return (\n this.raw.type === InteractionType.ApplicationCommand &&\n (this.raw as APIApplicationCommandInteraction).data.type === ApplicationCommandType.User\n );\n }\n\n isMessageContextCommand(): this is MessageContextInteraction<Context> {\n return (\n this.raw.type === InteractionType.ApplicationCommand &&\n (this.raw as APIApplicationCommandInteraction).data.type === ApplicationCommandType.Message\n );\n }\n\n isModal(): this is ModalInteraction {\n return this.raw.type === InteractionType.ModalSubmit;\n }\n\n isMessageModal(): this is ModalInteraction<Context & { message: APIMessage }> {\n return this.isModal() && !!this.message;\n }\n\n isMessageComponent(): this is MessageComponentInteraction<Context, MessageComponentType> {\n return this.raw.type === InteractionType.MessageComponent;\n }\n\n isButton(): this is ButtonInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.Button;\n }\n\n isStringSelect(): this is StringSelectInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.StringSelect;\n }\n\n isUserSelect(): this is UserSelectInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.UserSelect;\n }\n\n isRoleSelect(): this is RoleSelectInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.RoleSelect;\n }\n\n isMentionableSelect(): this is MentionableSelectInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.MentionableSelect;\n }\n\n isChannelSelect(): this is ChannelSelectInteraction<Context> {\n return this.isMessageComponent() && this.raw.data.component_type === ComponentType.ChannelSelect;\n }\n\n isAutocomplete(): this is AutocompleteInteraction<Context> & { type: InteractionType.ApplicationCommandAutocomplete } {\n return this.raw.type === InteractionType.ApplicationCommandAutocomplete;\n }\n}\n\nexport { BaseInteraction };\n","import { InteractionType } from \"discord-api-types/v10\";\nimport { ModalBuilder } from \"@discordjs/builders\";\nimport { BaseInteraction } from \"./BaseInteraction\";\nimport type { BaseInteractionContext, ModalInteractionResponseCallbackData } from \"../types\";\n\nclass ModalCapableInteraction<\n Type extends InteractionType,\n Context extends BaseInteractionContext = BaseInteractionContext,\n> extends BaseInteraction<Type, Context> {\n /**\n * Responds to the interaction with a modal.\n *\n * @param data - The modal data to send\n */\n showModal(data: ModalInteractionResponseCallbackData | ModalBuilder) {\n const responseData = {\n ...(data instanceof ModalBuilder ? data.toJSON() : data),\n components:\n data instanceof ModalBuilder\n ? data.components.map((row) => row.toJSON())\n : data.components.map((row) => (this.isJSONEncodable(row) ? row.toJSON() : row)),\n };\n return this.api.interactions.createModal(this.id, this.token, responseData);\n }\n}\n\nexport { ModalCapableInteraction };\n","import { APIApplicationCommandInteraction, ApplicationCommandType, InteractionType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteractionContext } from \"../types\";\nimport { ModalCapableInteraction } from \"./ModalCapableInteraction\";\n\nabstract class CommandInteraction<\n CType extends ApplicationCommandType = ApplicationCommandType,\n Context extends BaseInteractionContext = BaseInteractionContext,\n> extends ModalCapableInteraction<InteractionType.ApplicationCommand, Context> {\n public readonly commandType: CType;\n\n constructor(api: API, interaction: Extract<APIApplicationCommandInteraction, { data: { type: CType } }>, c: Context) {\n super(api, interaction, c);\n this.commandType = interaction.data.type;\n }\n\n get commandName() {\n return this.raw.data.name;\n }\n\n get commandId() {\n return this.raw.data.id;\n }\n\n isOfType<T extends ApplicationCommandType>(type: T): this is CommandInteraction<T, Context> {\n return (this.commandType as ApplicationCommandType) === type;\n }\n}\n\nexport { CommandInteraction };\n","import { ApplicationCommandType, type APIChatInputApplicationCommandInteraction } from \"discord-api-types/v10\";\nimport { CommandInteractionOptionResolver } from \"@resolvers/CommandOptionResolver\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteractionContext } from \"../types\";\nimport { CommandInteraction } from \"./CommandInteraction\";\n\nclass ChatInputCommandInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends CommandInteraction<\n ApplicationCommandType.ChatInput,\n Context\n> {\n public readonly options: CommandInteractionOptionResolver;\n constructor(api: API, interaction: APIChatInputApplicationCommandInteraction, c: Context) {\n super(api, interaction, c);\n this.options = new CommandInteractionOptionResolver(interaction.data.options, interaction.data.resolved);\n }\n}\n\nexport { ChatInputCommandInteraction };\n","import type { APIInteraction, APIWebhookEvent } from \"discord-api-types/v10\";\nimport { cloneRawRequest, type HonoRequest } from \"hono/request\";\nimport { BufferSource } from \"../types\";\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 */\nfunction 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 */\nfunction 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\").buffer as BufferSource,\n {\n name: \"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\").buffer as ArrayBuffer,\n message.buffer as ArrayBuffer\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","// From discord.js\ninterface Colors {\n /** 0x1ABC9C | rgb(26,188,156) */\n Aqua: number;\n /** 0x3498DB | rgb(52,152,219) */\n Blue: number;\n /** 0x5865F2 | rgb(88,101,242) */\n Blurple: number;\n /** 0x11806A | rgb(17,128,106) */\n DarkAqua: number;\n /** 0x206694 | rgb(32,102,148) */\n DarkBlue: number;\n /** 0x2C2F33 | rgb(44,47,51) */\n DarkButNotBlack: number;\n /** 0x7F8C8D | rgb(127,140,141) */\n DarkerGrey: number;\n /** 0xC27C0E | rgb(194,124,14) */\n DarkGold: number;\n /** 0x1F8B4C | rgb(31,139,76) */\n DarkGreen: number;\n /** 0x979C9F | rgb(151,156,159) */\n DarkGrey: number;\n /** 0x2C3E50 | rgb(44,62,80) */\n DarkNavy: number;\n /** 0xA84300 | rgb(168,67,0) */\n DarkOrange: number;\n /** 0x71368A | rgb(113,54,138) */\n DarkPurple: number;\n /** 0x992D22 | rgb(153,45,34) */\n DarkRed: number;\n /** 0xAD1457 | rgb(173,20,87) */\n DarkVividPink: number;\n /** 0x000000 | rgb(0,0,0) */\n Default: number;\n /** 0xEB459E | rgb(235,69,158) */\n Fuchsia: number;\n /** 0xF1C40F | rgb(241,196,15) */\n Gold: number;\n /** 0x57F287 | rgb(87,242,135) */\n Green: number;\n /** 0x95A5A6 | rgb(149,165,166) */\n Grey: number;\n /** 0x99AAb5 | rgb(153,170,181) */\n Greyple: number;\n /** 0xBCC0C0 | rgb(188,192,192) */\n LightGrey: number;\n /** 0xE91E63 | rgb(233,30,99) */\n LuminousVividPink: number;\n /** 0x34495E | rgb(52,73,94) */\n Navy: number;\n /** 0x23272A | rgb(35,39,42) */\n NotQuiteBlack: number;\n /** 0xE67E22 | rgb(230,126,34) */\n Orange: number;\n /** 0x9B59B6 | rgb(155,89,182) */\n Purple: number;\n /** 0xED4245 | rgb(237,66,69) */\n Red: number;\n /** 0xFFFFFF | rgb(255,255,255) */\n White: number;\n /** 0xFEE75C | rgb(254,231,92) */\n Yellow: number;\n}\n\nexport const Colors: 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};\n","import { AnyHandler } from \"@ctx/handlers\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { REST } from \"@discordjs/rest\";\nimport { FlatOrNestedArray } from \"../types\";\nimport type { RESTPostAPIApplicationCommandsJSONBody, RESTPostAPIApplicationGuildCommandsJSONBody } from \"discord-api-types/v10\";\n\n/**\n * Registers application commands (Slash and Context Menus) with Discord's API.\n *\n * This function flattens the provided handlers, separates global from guild-specific\n * commands, and performs a bulk overwrite for both.\n *\n * @param token - The Discord Bot token.\n * @param applicationId - The Discord Application ID.\n * @param handlers - A rest parameter of handlers or arrays of handlers to register.\n *\n * @throws {Error} If the API request to Discord fails.\n */\nexport async function registerCommands(\n token: string | undefined,\n applicationId: string | undefined,\n ...handlers: FlatOrNestedArray<AnyHandler>\n) {\n const flatCommands = handlers.flat(Infinity) as AnyHandler[];\n const { globalCommands, guildCommands } = flatCommands\n .map((handler) => {\n if (handler.handlerType === \"slash\" || handler.handlerType === \"context\") {\n return handler;\n }\n return undefined;\n })\n .filter((cmd) => cmd !== undefined)\n .reduce(\n (acc, cmd) => {\n if (cmd.isGuildCommand()) {\n for (const guildId of cmd.guildIds.values()) {\n if (!acc.guildCommands[guildId]) {\n acc.guildCommands[guildId] = [];\n }\n acc.guildCommands[guildId].push(cmd.toJSON());\n }\n } else {\n acc.globalCommands.push(cmd.toJSON());\n }\n return acc;\n },\n {\n globalCommands: [] as RESTPostAPIApplicationCommandsJSONBody[],\n guildCommands: {} as Record<string, RESTPostAPIApplicationGuildCommandsJSONBody[]>,\n }\n );\n\n if (!token || !applicationId) {\n console.warn(\"Token or Application ID not provided, skipping command registration.\");\n return;\n }\n\n const api = new API(new REST({ version: \"10\" }).setToken(token));\n try {\n await api.applicationCommands.bulkOverwriteGlobalCommands(applicationId, globalCommands);\n console.log(`---- ✅ Successfully registered ${globalCommands.length} global commands ----`);\n } catch (error) {\n console.error(\"---- ❌ Error registering global commands ----\");\n throw error;\n }\n\n if (Object.keys(guildCommands).length === 0) {\n return;\n }\n\n const guildCommandsArray = Object.entries(guildCommands).map(([guildId, commands]) => ({ guildId, commands }));\n\n for (const { guildId, commands } of guildCommandsArray) {\n try {\n await api.applicationCommands.bulkOverwriteGuildCommands(applicationId, guildId, commands);\n console.log(`---- ✅ Successfully registered ${commands.length} guild commands for guild ${guildId} ----`);\n } catch (error) {\n console.error(`---- ❌ Error registering guild commands for guild ${guildId} ----`);\n throw error;\n }\n }\n}\n","export * from \"@utils/Colors\";\nexport * from \"@utils/registerCommands\";\n\n/**\n * Parse a custom ID string into its parts.\n *\n * Supports two modes:\n * - onlyPrefix = true: returns the prefix string before the first '/' or '?'.\n * - onlyPrefix = false (default): returns an object with parsed pieces.\n *\n * Expected customId shapes:\n * - \"prefix/component/other/path?param1/param2\"\n * - \"prefix?param1/param2\"\n *\n * @param customId - The custom ID to parse.\n * @param onlyPrefix - If true, only return the prefix string (default: false).\n * @returns If onlyPrefix is true: string (the prefix). Otherwise an object with:\n * - compPath: string[] (full path split by '/'),\n * - prefix: string (first item of compPath),\n * - lastPathItem: string (last item of compPath),\n * - component: string | null (second item of compPath or null),\n * - params: string[] (params split by '/'; empty array when none),\n * - firstParam: string | null,\n * - lastParam: string | null\n *\n * @example\n * parseCustomId(\"modal/user/profile?123/abc\")\n * // => { compPath: [\"modal\",\"user\",\"profile\"], prefix: \"modal\", ... params: [\"123\",\"abc\"], ... }\n *\n * parseCustomId(\"button/click\", true)\n * // => \"button\"\n */\nexport 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};\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 { APIUserApplicationCommandInteraction, APIUser, ApplicationCommandType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteractionContext } from \"../types\";\nimport { CommandInteraction } from \"./CommandInteraction\";\n\nclass UserContextInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends CommandInteraction<\n ApplicationCommandType.User,\n Context\n> {\n public readonly targetUser: APIUser;\n\n constructor(api: API, interaction: APIUserApplicationCommandInteraction, c: Context) {\n super(api, interaction, c);\n this.targetUser = interaction.data.resolved.users[interaction.data.target_id];\n }\n}\n\nexport { UserContextInteraction };\n","import { APIMessage, APIMessageApplicationCommandInteraction, ApplicationCommandType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport { BaseInteractionContext } from \"../types\";\nimport { CommandInteraction } from \"./CommandInteraction\";\n\nclass MessageContextInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends CommandInteraction<\n ApplicationCommandType.Message,\n Context\n> {\n public readonly targetMessage: APIMessage;\n\n constructor(api: API, interaction: APIMessageApplicationCommandInteraction, c: Context) {\n super(api, interaction, c);\n this.targetMessage = interaction.data.resolved.messages[interaction.data.target_id];\n }\n}\n\nexport { MessageContextInteraction };\n","import {\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, ResolvedSelectedGuildMember } 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 if (key === \"members\") {\n // get users and combine them with members for easy access; a user is expected to ALWAYS be present if a member is\n const users = resolved?.users ? new Collection(Object.entries(resolved.users)) : new Collection();\n const members = resolvedData ? new Collection(Object.entries(resolvedData)) : new Collection();\n const combined = new Collection([...members.entries()].map(([id, member]) => [id, { ...member, user: users.get(id)! }]));\n acc[key] = combined;\n return acc;\n }\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): Collection<string, APIInteractionDataResolvedChannel> | null;\n getSelectedChannels(custom_id: string, required: true): Collection<string, APIInteractionDataResolvedChannel>;\n getSelectedChannels(\n custom_id: string,\n required: boolean = false\n ): Collection<string, 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\n ? new Collection(channels.map((channel) => [channel.id, channel]))\n : required\n ? new Collection()\n : 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): Collection<string, APIUser> | null;\n getSelectedUsers(custom_id: string, required: true): Collection<string, APIUser>;\n getSelectedUsers(custom_id: string, required: boolean = false): Collection<string, 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 ? new Collection(users.map((user) => [user.id, user])) : required ? new Collection() : 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): Collection<string, ResolvedSelectedGuildMember> | null;\n getSelectedMembers(custom_id: string, required: true): Collection<string, ResolvedSelectedGuildMember>;\n getSelectedMembers(custom_id: string, required: boolean = false): Collection<string, ResolvedSelectedGuildMember> | 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.map((id) => this._resolved.members?.get(id)).filter(Boolean) as ResolvedSelectedGuildMember[];\n return members.length > 0\n ? new Collection(members.map((member) => [member.user.id, member]))\n : required\n ? new Collection()\n : 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(custom_id: string, required?: boolean): (ResolvedSelectedGuildMember | APIUser | APIRole)[] | null;\n getSelectedMentionables(custom_id: string, required: true): (ResolvedSelectedGuildMember | APIUser | APIRole)[];\n getSelectedMentionables(\n custom_id: string,\n required: boolean = false\n ): (ResolvedSelectedGuildMember | 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: (ResolvedSelectedGuildMember | 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<Context extends BaseInteractionContext = BaseInteractionContext> extends BaseInteraction<\n InteractionType.ModalSubmit,\n Context\n> {\n public readonly fields: ModalComponentResolver;\n public readonly message?: APIMessage;\n public readonly customId: string;\n\n constructor(api: API, interaction: APIModalSubmitInteraction, c: Context) {\n super(api, interaction, c);\n this.customId = 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<Context extends BaseInteractionContext = BaseInteractionContext> extends BaseInteraction<\n InteractionType.ApplicationCommandAutocomplete,\n Context\n> {\n public readonly options: CommandInteractionOptionResolver;\n public responded = false;\n\n constructor(api: API, interaction: APIApplicationCommandAutocompleteInteraction, c: Context) {\n super(api, interaction, c);\n this.options = new CommandInteractionOptionResolver(interaction.data.options, interaction.data.resolved);\n }\n\n get commandName() {\n return this.raw.data.name;\n }\n\n get commandId() {\n return this.raw.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 { ModalInteraction } from \"./ModalInteraction\";\nimport { ContextMenuCommandBuilder, SlashCommandBuilder } from \"@discordjs/builders\";\nimport { ComponentType } from \"discord-api-types/v10\";\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 { MessageContextInteraction } from \"./MessageContextCommandInteraction\";\nimport { UserContextInteraction } from \"./UserContextCommandInteraction\";\nimport { parseCustomId } from \"@utils/index\";\nimport { BaseInteractionContext, ContextCommandType, MessageComponentInteractionObj, MessageComponentType } from \"../types\";\n\n/**\n * Handler for chat input commands with optional autocomplete support\n */\nexport class SlashCommandHandler<Context extends BaseInteractionContext = BaseInteractionContext> extends SlashCommandBuilder {\n readonly handlerType = \"slash\";\n private handlerFn?: (interaction: ChatInputCommandInteraction<Context>) => Promise<any> | any;\n private autocompleteFn?: (interaction: AutocompleteInteraction<Context>) => Promise<any> | any;\n /**\n * Set of guild IDs where this command is registered (empty for global commands)\n */\n readonly guildIds = new Set<string>();\n\n isGuildCommand(): boolean {\n return this.guildIds.size > 0;\n }\n\n setGuildIds(guildIds: string[]): this {\n this.guildIds.clear();\n for (const guildId of guildIds) {\n this.guildIds.add(guildId);\n }\n return this;\n }\n\n addGuildIds(...guildIds: string[]): this {\n for (const guildId of guildIds) {\n this.guildIds.add(guildId);\n }\n return this;\n }\n\n removeGuildIds(...guildIds: string[]): this {\n for (const guildId of guildIds) {\n this.guildIds.delete(guildId);\n }\n return this;\n }\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(\n handler: (interaction: ChatInputCommandInteraction<Context>) => Promise<any> | any\n ): SlashCommandHandler<Context> {\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(\n handler: (interaction: AutocompleteInteraction<Context>) => Promise<any> | any\n ): SlashCommandHandler<Context> {\n this.autocompleteFn = handler;\n return this;\n }\n\n /**\n * Executes the command handler\n */\n async execute(interaction: ChatInputCommandInteraction<Context>): 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<Context>): 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 Context extends BaseInteractionContext = BaseInteractionContext,\n T extends ContextCommandType = ContextCommandType,\n InteractionData = T extends ContextCommandType.User ? UserContextInteraction<Context> : MessageContextInteraction<Context>,\n> extends ContextMenuCommandBuilder {\n constructor(public readonly commandType: T) {\n super();\n this.setType(commandType as any); // ContextMenuCommandType is a type, not an enum so the values of the enum ContextCommandType isn't assignable to it directly\n }\n\n readonly handlerType = \"context\";\n private handlerFn?: (interaction: InteractionData) => Promise<any> | any;\n /**\n * Set of guild IDs where this command is registered (empty for global commands)\n */\n readonly guildIds = new Set<string>();\n\n isGuildCommand(): boolean {\n return this.guildIds.size > 0;\n }\n\n setGuildIds(guildIds: string[]): this {\n this.guildIds.clear();\n for (const guildId of guildIds) {\n this.guildIds.add(guildId);\n }\n return this;\n }\n\n addGuildIds(...guildIds: string[]): this {\n for (const guildId of guildIds) {\n this.guildIds.add(guildId);\n }\n return this;\n }\n\n removeGuildIds(...guildIds: string[]): this {\n for (const guildId of guildIds) {\n this.guildIds.delete(guildId);\n }\n return this;\n }\n\n public addHandler(\n handler: (interaction: InteractionData) => Promise<any> | any\n ): ContextCommandHandler<Context, 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 Context extends BaseInteractionContext = BaseInteractionContext,\n CType extends MessageComponentType = MessageComponentType,\n> {\n readonly handlerType = \"component\";\n public readonly prefix: string;\n public readonly componentType: CType;\n private handlerFn?: (interaction: MessageComponentInteractionObj<Context, CType>) => Promise<any> | any;\n\n constructor(\n prefix: string,\n componentType: CType,\n handler?: (interaction: MessageComponentInteractionObj<Context, CType>) => Promise<any> | any\n ) {\n this.componentType = componentType;\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(\n handler: (interaction: MessageComponentInteractionObj<Context, CType>) => Promise<any> | any\n ): ComponentHandler<Context, CType> {\n this.handlerFn = handler;\n return this;\n }\n\n /**\n * Executes the component handler\n */\n async execute(interaction: MessageComponentInteractionObj<Context, CType>): 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<Context extends BaseInteractionContext = BaseInteractionContext> {\n readonly handlerType = \"modal\";\n public readonly prefix: string;\n private handlerFn?: (interaction: ModalInteraction<Context>) => Promise<any> | any;\n\n constructor(prefix: string, handler?: (interaction: ModalInteraction<Context>) => Promise<any> | any) {\n if (!prefix || typeof prefix !== \"string\") {\n throw new TypeError(\"Modal 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: ModalInteraction<Context>) => Promise<any> | any): ModalHandler<Context> {\n this.handlerFn = handler;\n return this;\n }\n\n /**\n * Executes the modal handler\n */\n async execute(interaction: ModalInteraction<Context>): 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<Context extends BaseInteractionContext = BaseInteractionContext> =\n | SlashCommandHandler<Context>\n | ContextCommandHandler<Context, ContextCommandType.User, UserContextInteraction<Context>>\n | ContextCommandHandler<Context, ContextCommandType.Message, MessageContextInteraction<Context>>\n | ComponentHandler<Context, ComponentType.Button>\n | ComponentHandler<Context, ComponentType.StringSelect>\n | ComponentHandler<Context, ComponentType.UserSelect>\n | ComponentHandler<Context, ComponentType.RoleSelect>\n | ComponentHandler<Context, ComponentType.MentionableSelect>\n | ComponentHandler<Context, ComponentType.ChannelSelect>\n | ModalHandler<Context>;\n\nexport type CommandHandler<Context extends BaseInteractionContext = BaseInteractionContext> =\n | SlashCommandHandler<Context>\n | ContextCommandHandler<Context, ContextCommandType.User, UserContextInteraction<Context>>\n | ContextCommandHandler<Context, ContextCommandType.Message, MessageContextInteraction<Context>>;\n\n/**\n * Helper type to allow handlers with any context extending BaseInteractionContext\n */\nexport type AnyHandler = Handler<any>;\n","import { APIMessage, InteractionType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload, MessageComponentType } from \"../types\";\nimport { ModalCapableInteraction } from \"./ModalCapableInteraction\";\n\nabstract class MessageComponentInteraction<\n Context extends BaseInteractionContext = BaseInteractionContext,\n T extends MessageComponentType = MessageComponentType,\n> extends ModalCapableInteraction<InteractionType.MessageComponent, Context> {\n public readonly message: APIMessage;\n public readonly customId: string;\n public readonly componentType: T;\n\n constructor(api: API, interaction: MessageComponentInteractionPayload<T>, c: Context) {\n super(api, interaction, c);\n this.customId = interaction.data.custom_id;\n this.message = interaction.message;\n this.componentType = interaction.data.component_type as T;\n }\n}\n\nexport { MessageComponentInteraction };\n","import { ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\n\nclass ButtonInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends MessageComponentInteraction<\n Context,\n ComponentType.Button\n> {\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.Button>, c: Context) {\n super(api, interaction, c);\n }\n}\n\nexport { ButtonInteraction };\n","import { ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\n\nclass StringSelectInteraction<\n Context extends BaseInteractionContext = BaseInteractionContext,\n> extends MessageComponentInteraction<Context, ComponentType.StringSelect> {\n public readonly values: string[];\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.StringSelect>, c: Context) {\n super(api, interaction, c);\n this.values = interaction.data.values;\n }\n}\n\nexport { StringSelectInteraction };\n","import { APIUser, ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload, ResolvedSelectedGuildMember } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport { Collection } from \"@discordjs/collection\";\n\nclass UserSelectInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends MessageComponentInteraction<\n Context,\n ComponentType.UserSelect\n> {\n public readonly values: string[];\n public readonly users: Collection<string, APIUser>;\n public readonly members: Collection<string, ResolvedSelectedGuildMember> = new Collection();\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.UserSelect>, c: Context) {\n super(api, interaction, c);\n this.values = interaction.data.values;\n this.users = new Collection(interaction.data.resolved.users ? Object.entries(interaction.data.resolved.users) : []);\n if (this.inGuild()) {\n this.members = new Collection(\n this.values\n .map((id) => {\n // We can technically assume that the member and user will always be present if the ID is in the values array, but we should still check just in case\n const member = interaction.data.resolved.members?.[id];\n if (member) {\n const user = this.users.get(id);\n if (user) {\n return [id, { ...member, user } as ResolvedSelectedGuildMember] as const;\n }\n }\n return null;\n })\n .filter((entry) => entry !== null)\n );\n }\n }\n}\n\nexport { UserSelectInteraction };\n","import { APIRole, ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport { Collection } from \"@discordjs/collection\";\n\nclass RoleSelectInteraction<Context extends BaseInteractionContext = BaseInteractionContext> extends MessageComponentInteraction<\n Context,\n ComponentType.RoleSelect\n> {\n public readonly values: string[];\n public readonly roles: Collection<string, APIRole>;\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.RoleSelect>, c: Context) {\n super(api, interaction, c);\n this.values = interaction.data.values;\n this.roles = new Collection(interaction.data.resolved.roles ? Object.entries(interaction.data.resolved.roles) : []);\n }\n}\n\nexport { RoleSelectInteraction };\n","import { APIRole, APIUser, ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport { Collection } from \"@discordjs/collection\";\n\nclass MentionableSelectInteraction<\n Context extends BaseInteractionContext = BaseInteractionContext,\n> extends MessageComponentInteraction<Context, ComponentType.MentionableSelect> {\n public readonly values: string[];\n public readonly roles: Collection<string, APIRole>;\n public readonly users: Collection<string, APIUser>;\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.MentionableSelect>, c: Context) {\n super(api, interaction, c);\n this.values = interaction.data.values;\n this.roles = new Collection(interaction.data.resolved.roles ? Object.entries(interaction.data.resolved.roles) : []);\n this.users = new Collection(interaction.data.resolved.users ? Object.entries(interaction.data.resolved.users) : []);\n }\n}\n\nexport { MentionableSelectInteraction };\n","import { APIInteractionDataResolvedChannel, ComponentType } from \"discord-api-types/v10\";\nimport { API } from \"@discordjs/core/http-only\";\nimport type { BaseInteractionContext, MessageComponentInteractionPayload } from \"../types\";\nimport { MessageComponentInteraction } from \"./MessageComponentInteraction\";\nimport { Collection } from \"@discordjs/collection\";\n\nclass ChannelSelectInteraction<\n Context extends BaseInteractionContext = BaseInteractionContext,\n> extends MessageComponentInteraction<Context, ComponentType.ChannelSelect> {\n public readonly values: string[];\n public readonly channels: Collection<string, APIInteractionDataResolvedChannel>;\n constructor(api: API, interaction: MessageComponentInteractionPayload<ComponentType.ChannelSelect>, c: Context) {\n super(api, interaction, c);\n this.values = interaction.data.values;\n this.channels = new Collection(interaction.data.resolved.channels ? Object.entries(interaction.data.resolved.channels) : []);\n }\n}\n\nexport { ChannelSelectInteraction };\n","import {\n APIApplicationCommandAutocompleteInteraction,\n APIApplicationCommandInteraction,\n ApplicationCommandType,\n ComponentType,\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 {\n BaseVariables,\n BaseInteractionContext,\n ValidInteraction,\n MessageComponentInteractionPayload,\n MessageComponentType,\n FlatOrNestedArray,\n MiddlewareFunction,\n} from \"./types\";\nimport { UserContextInteraction } from \"@ctx/UserContextCommandInteraction\";\nimport { MessageContextInteraction } from \"@ctx/MessageContextCommandInteraction\";\nimport { MessageComponentInteraction } from \"@ctx/MessageComponentInteraction\";\nimport { ModalInteraction } from \"@ctx/ModalInteraction\";\nimport { AutocompleteInteraction } from \"@ctx/AutocompleteInteraction\";\nimport {\n SlashCommandHandler,\n ContextCommandHandler,\n ComponentHandler,\n ModalHandler,\n type Handler,\n AnyHandler,\n} from \"@ctx/handlers\";\nimport { ButtonInteraction } from \"@ctx/ButtonInteraction\";\nimport { StringSelectInteraction } from \"@ctx/StringSelectInteraction\";\nimport { UserSelectInteraction } from \"@ctx/UserSelectInteraction\";\nimport { RoleSelectInteraction } from \"@ctx/RoleSelectInteraction\";\nimport { MentionableSelectInteraction } from \"@ctx/MentionableSelectInteraction\";\nimport { ChannelSelectInteraction } from \"@ctx/ChannelSelectInteraction\";\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 c.env.IS_CF_WORKER === \"true\" # later determined from environment variable\n */\n isCFWorker?: boolean;\n /**\n * Whether to turn on debug logging for REST API requests.\n *\n * @default false\n */\n debugRest?: boolean;\n}\n\nexport class Honocord {\n /**\n * Map of commandName to CommandHandler instances for global commands.\n */\n private globalCommandHandlers = new Map<string, SlashCommandHandler | ContextCommandHandler>();\n /**\n * Map of `guildId:commandName` to CommandHandler instances for guild-specific commands.\n */\n private guildCommandHandlers = new Map<string, SlashCommandHandler | ContextCommandHandler>();\n private componentHandlers = new Map<string, ComponentHandler>();\n private modalHandlers = new Map<string, ModalHandler>();\n private middleware = new Array<MiddlewareFunction<any>>();\n private isCFWorker: boolean;\n private debugRest: boolean;\n\n /**\n * Executes all registered middleware in sequence.\n *\n * @param ctx - The interaction context\n * @param finalHandler - The final handler to execute after all middleware\n */\n private async runMiddleware(ctx: BaseInteractionContext, finalHandler: () => Promise<void>): Promise<void> {\n if (this.middleware.length === 0) {\n return await finalHandler();\n }\n\n /**\n * Executes the next middleware in the chain.\n */\n const dispatch = async (i: number = 0): Promise<void> => {\n if (i >= this.middleware.length) {\n return await finalHandler();\n }\n\n await this.middleware[i](ctx, () => dispatch(i + 1));\n };\n\n await dispatch();\n }\n\n constructor({ isCFWorker, debugRest }: HonocordOptions = {}) {\n this.isCFWorker = isCFWorker ?? false;\n this.debugRest = debugRest ?? false;\n }\n\n /**\n * Registers handlers for interactions.\n *\n * @param handlers - Array of CommandHandler, ComponentHandler, or ModalHandler instances\n *\n * For an example of usage, see the [Example Repository](https://github.com/The-LukeZ/honocord-examples).\n */\n loadHandlers(...handlers: FlatOrNestedArray<AnyHandler>): void {\n const flattenedHandlers = handlers.flat(Infinity) as Handler[];\n\n for (const handler of flattenedHandlers) {\n if (handler instanceof SlashCommandHandler || handler instanceof ContextCommandHandler) {\n if (handler.isGuildCommand()) {\n for (const guildId of handler.guildIds.values()) {\n const key = `${guildId}:${handler.name}`;\n if (this.guildCommandHandlers.has(key)) {\n console.warn(`Guild command handler for \"${handler.name}\" in guild \"${guildId}\" already exists. Overwriting.`);\n }\n this.guildCommandHandlers.set(key, handler as SlashCommandHandler | ContextCommandHandler);\n }\n continue;\n }\n\n if (this.globalCommandHandlers.has(handler.name)) {\n console.warn(`Command handler for \"${handler.name}\" already exists. Overwriting.`);\n }\n this.globalCommandHandlers.set(handler.name, handler as SlashCommandHandler | ContextCommandHandler);\n } else if (handler instanceof ComponentHandler) {\n const prefix = handler.prefix;\n if (this.componentHandlers.has(prefix)) {\n console.warn(`Component handler with prefix \"${prefix}\" already exists. Overwriting.`);\n }\n this.componentHandlers.set(prefix, handler as ComponentHandler<any>);\n } else if (handler instanceof ModalHandler) {\n const prefix = handler.prefix;\n if (this.modalHandlers.has(prefix)) {\n console.warn(`Modal handler with prefix \"${prefix}\" already exists. Overwriting.`);\n }\n this.modalHandlers.set(prefix, 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 UserContextInteraction(api, interaction as any, ctx);\n case ApplicationCommandType.Message:\n return new MessageContextInteraction(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 executeCommandHandler(\n handler: SlashCommandHandler | ContextCommandHandler,\n interactionObj: ReturnType<typeof this.createCommandInteraction>,\n commandType: ApplicationCommandType\n ) {\n if (handler instanceof SlashCommandHandler && commandType === ApplicationCommandType.ChatInput) {\n return handler.execute(interactionObj as ChatInputCommandInteraction);\n } else if (handler instanceof ContextCommandHandler) {\n if (commandType === ApplicationCommandType.User) {\n return handler.execute(interactionObj as UserContextInteraction);\n } else if (commandType === ApplicationCommandType.Message) {\n return handler.execute(interactionObj as MessageContextInteraction);\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.globalCommandHandlers.get(commandName);\n\n // Store interaction in context for middleware access\n ctx.set(\"command\", interactionObj as any);\n\n await this.runMiddleware(ctx, async () => {\n if (handler) {\n try {\n await this.executeCommandHandler(handler, interactionObj, interaction.data.type);\n } catch (error) {\n console.error(`Error executing command handler for \"${commandName}\"`, error);\n throw error;\n }\n }\n\n // Could be a guild command\n const guildId = interaction.guild_id;\n if (guildId) {\n const key = `${guildId}:${commandName}`;\n const guildHandler = this.guildCommandHandlers.get(key);\n if (guildHandler) {\n try {\n await this.executeCommandHandler(guildHandler, interactionObj, interaction.data.type);\n } catch (error) {\n console.error(`Error executing guild command handler for \"${commandName}\" in guild \"${guildId}\"`, error);\n throw error;\n }\n }\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.globalCommandHandlers.get(commandName);\n\n // Store interaction in context for middleware access\n ctx.set(\"autocomplete\", interactionObj as any);\n\n await this.runMiddleware(ctx, async () => {\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 // Could be a guild command\n const guildId = interaction.guild_id;\n if (guildId) {\n const key = `${guildId}:${commandName}`;\n const guildHandler = this.guildCommandHandlers.get(key);\n if (guildHandler && guildHandler instanceof SlashCommandHandler) {\n try {\n await guildHandler.executeAutocomplete(interactionObj);\n } catch (error) {\n console.error(`Error executing guild autocomplete handler for \"${commandName}\" in guild \"${guildId}\"`, error);\n throw error;\n }\n }\n }\n });\n }\n\n private createMessageComponentInteraction<T extends MessageComponentType>(\n ctx: BaseInteractionContext,\n interactionObj: MessageComponentInteractionPayload<T>,\n api: API\n ) {\n switch (interactionObj.data.component_type) {\n case ComponentType.Button:\n return new ButtonInteraction(api, interactionObj as any, ctx);\n case ComponentType.StringSelect:\n return new StringSelectInteraction(api, interactionObj as any, ctx);\n case ComponentType.UserSelect:\n return new UserSelectInteraction(api, interactionObj as any, ctx);\n case ComponentType.RoleSelect:\n return new RoleSelectInteraction(api, interactionObj as any, ctx);\n case ComponentType.MentionableSelect:\n return new MentionableSelectInteraction(api, interactionObj as any, ctx);\n case ComponentType.ChannelSelect:\n return new ChannelSelectInteraction(api, interactionObj as any, ctx);\n default:\n throw new Error(`Unsupported message component type: ${(interactionObj.data as any).component_type}`);\n }\n }\n\n private async handleComponentInteraction<T extends MessageComponentType>(\n ctx: BaseInteractionContext,\n interaction: MessageComponentInteractionPayload<T>,\n api: API\n ) {\n const interactionObj = this.createMessageComponentInteraction(ctx, interaction, api);\n const prefix = parseCustomId(interaction.data.custom_id, true);\n\n // Store interaction in context for middleware access\n ctx.set(\"component\", interactionObj as any);\n\n await this.runMiddleware(ctx, async () => {\n // Lookup handler by prefix\n const handler = this.componentHandlers.get(prefix);\n if (handler?.componentType === interaction.data.component_type) {\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 } else {\n throw new Error(\n `No component handler found for prefix \"${prefix}\" and component type \"${interaction.data.component_type}\"`\n );\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 // Store interaction in context for middleware access\n ctx.set(\"modal\", interactionObj);\n\n await this.runMiddleware(ctx, async () => {\n // Lookup handler by prefix\n const handler = this.modalHandlers.get(prefix);\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\n return interactionObj;\n }\n\n private async createInteraction(ctx: BaseInteractionContext, interaction: ValidInteraction) {\n const rest = new REST({ authPrefix: \"Bot\" }).setToken(ctx.env.DISCORD_TOKEN as string);\n if (this.debugRest) {\n rest\n .addListener(\"response\", (request, response) => {\n console.debug(\n `[REST] ${request.method} ${request.path} -> ${response.status} ${response.statusText} (${request.route})`\n );\n })\n .addListener(\"restDebug\", (info) => {\n console.debug(`[REST DEBUG] ${info}`);\n });\n }\n const api = new API(rest);\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 * @example\n * ```typescript\n * import { Hono } from \"hono\";\n * import { Honocord } from \"honocord\";\n *\n * const app = new Hono();\n * const bot = new Honocord();\n *\n * app.get(\"/\", (c) => c.text(\"🔥 Honocord is running!\"));\n * app.post(\"/interactions\", bot.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 console.log(\"Received Discord 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 * @example\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 /**\n * Registers a middleware function to process interaction contexts.\n *\n * Middleware receives the Hono context and a `next` callback:\n * - Access/modify context variables via `c.get()` and `c.set()`\n * - Access the interaction object via `c.var.command`, `c.var.component`, `c.var.modal`, or `c.var.autocomplete`\n * - Access environment bindings via `c.env`\n * - Call `await next()` to continue to the next middleware or handler\n *\n * The context is passed by reference, so all modifications persist through the middleware chain and into handlers.\n *\n * @example\n * ```typescript\n * bot.use(async (c, next) => {\n * // Set custom data in context\n * c.set('startTime', Date.now());\n *\n * // Continue to next middleware/handler\n * // you can also return next() directly if no post-processing is needed\n * await next();\n *\n * // Code here runs after the handler completes\n * console.log('Duration:', Date.now() - c.get('startTime'));\n * });\n * ```\n *\n * @param middleware - The middleware function(s) to register.\n * @returns The Honocord instance for chaining.\n */\n use<Context extends BaseInteractionContext = BaseInteractionContext>(...middleware: MiddlewareFunction<Context>[]): this {\n this.middleware.push(...middleware);\n return this;\n }\n\n /**\n * Clears all registered middleware functions.\n * @returns The Honocord instance for chaining.\n */\n clearMiddleware(): this {\n this.middleware = [];\n return this;\n }\n}\n","import { AutocompleteInteraction } from \"@ctx/AutocompleteInteraction\";\nimport type { ChatInputCommandInteraction } from \"@ctx/ChatInputInteraction\";\nimport type { ModalInteraction } from \"@ctx/ModalInteraction\";\nimport type { UserContextInteraction } from \"@ctx/UserContextCommandInteraction\";\nimport type { MessageContextInteraction } from \"@ctx/MessageContextCommandInteraction\";\nimport type { Collection } from \"@discordjs/collection\";\nimport type { Snowflake } from \"discord-api-types/globals\";\nimport {\n APIAttachment,\n APIEmbed,\n APIInteraction,\n APIInteractionDataResolvedChannel,\n APIInteractionDataResolvedGuildMember,\n APIInteractionResponseCallbackData,\n APILabelComponent,\n APIMessageButtonInteractionData,\n APIMessageChannelSelectInteractionData,\n APIMessageMentionableSelectInteractionData,\n APIMessageRoleSelectInteractionData,\n APIMessageStringSelectInteractionData,\n APIMessageTopLevelComponent,\n APIMessageUserSelectInteractionData,\n APIModalInteractionResponseCallbackData,\n APIPingInteraction,\n APIRole,\n APIUser,\n ApplicationCommandType,\n ComponentType,\n InteractionType,\n} from \"discord-api-types/v10\";\nimport type { Context } from \"hono\";\nimport type { Bindings, BlankInput, Variables } from \"hono/types\";\nimport { ButtonInteraction } from \"@ctx/ButtonInteraction\";\nimport { StringSelectInteraction } from \"@ctx/StringSelectInteraction\";\nimport { UserSelectInteraction } from \"@ctx/UserSelectInteraction\";\nimport { MentionableSelectInteraction } from \"@ctx/MentionableSelectInteraction\";\nimport { RoleSelectInteraction } from \"@ctx/RoleSelectInteraction\";\nimport { ChannelSelectInteraction } from \"@ctx/ChannelSelectInteraction\";\n\n/**\n * Base variables that the library uses\n */\nexport interface BaseVariables {\n autocomplete?: ChatInputCommandInteraction;\n command?: ChatInputCommandInteraction;\n modal?: ModalInteraction;\n component?: TMessageComponentInteraction;\n}\n\nexport type TMessageComponentInteraction<Context extends BaseInteractionContext = BaseInteractionContext> =\n | ButtonInteraction<Context>\n | StringSelectInteraction<Context>\n | UserSelectInteraction<Context>\n | RoleSelectInteraction<Context>\n | MentionableSelectInteraction<Context>\n | ChannelSelectInteraction<Context>;\n\nexport type MessageComponentInteractionObj<\n Context extends BaseInteractionContext = BaseInteractionContext,\n T extends MessageComponentType = MessageComponentType,\n> = Extract<\n TMessageComponentInteraction<Context>,\n {\n componentType: T;\n }\n>;\n\n/**\n * Base context environment\n */\nexport interface BaseHonocordEnv<TBindings extends Bindings = any, TVariables extends Variables = any> {\n /**\n * Bindings available in the environment (from the worker)\n */\n Bindings: TBindings;\n /**\n * Variables available in the context (from Hono + Honocord)\n */\n Variables: BaseVariables & TVariables;\n}\n\n/**\n * Generic context type that users can extend for type-safe access to environment bindings and variables.\n *\n * @template TBindings - Custom environment bindings (e.g., Cloudflare Workers env)\n * @template TVariables - Custom Hono variables\n * @template TPath - The path type for the context\n *\n * @example\n * ```ts\n * // types.ts\n * import type { BaseHonocordEnv, BaseInteractionContext } from \"honocord\";\n *\n * // Define your custom environment\n * import type { BaseHonocordEnv, BaseInteractionContext } from \"honocord\";\n *\n * // Define your custom environment bindings (e.g., Cloudflare Workers env)\n * export interface MyEnv {\n * DISCORD_TOKEN: string;\n * DISCORD_PUBLIC_KEY: string;\n * DATABASE: D1Database; // Example Cloudflare D1\n * }\n *\n * // Define your custom Hono variables (can be populated by middleware)\n * export interface MyVariables {\n * user_id: string;\n * is_admin: boolean;\n * }\n *\n * // Create a reusable context type\n * export type MyContext = BaseInteractionContext<MyEnv, MyVariables>;\n *\n * // index.ts\n * import { Honocord, SlashCommandHandler } from \"honocord\";\n * import type { MyContext } from \"./types\";\n *\n * const bot = new Honocord();\n *\n * const command = new SlashCommandHandler()\n * .setName(\"query\")\n * .setDescription(\"Query the database\");\n *\n * command.addHandler(async (interaction: MyContext) => {\n * // Type-safe access to your environment\n * const db = interaction.env.DATABASE;\n * const result = await db.prepare(\"SELECT * FROM users\").all();\n * await interaction.reply(`Found ${result.results.length} users`);\n * });\n *\n * bot.loadHandlers([command]);\n * ```\n */\nexport type BaseInteractionContext<\n TBindings extends Bindings = any,\n TVariables extends Variables = any,\n TPath extends string = \"/\",\n> = Context<BaseHonocordEnv<TBindings, TVariables>, TPath, BlankInput>;\n\n/**\n * Represents a guild member resolved from an interaction, including the associated user data.\n *\n * To be used by user selects.\n */\nexport type ResolvedSelectedGuildMember = APIInteractionDataResolvedGuildMember & { user: APIUser };\n\n/**\n * Collections of resolved data from Discord API interactions.\n *\n * When users or roles are mentioned in command options, Discord resolves them and provides\n * the full data in these collections for easy access.\n */\nexport interface APIInteractionDataResolvedCollections {\n /** Map of user IDs to user objects */\n users?: Collection<Snowflake, APIUser>;\n /** Map of role IDs to role objects */\n roles?: Collection<Snowflake, APIRole>;\n /** Map of user IDs to guild member objects */\n members?: Collection<Snowflake, ResolvedSelectedGuildMember>;\n /** Map of channel IDs to channel objects */\n channels?: Collection<Snowflake, APIInteractionDataResolvedChannel>;\n /** Map of attachment IDs to attachment objects */\n attachments?: Collection<Snowflake, APIAttachment>;\n}\n\n/** Represents an interaction which the lib user can handle themselves (ping is handled internally) */\nexport type ValidInteraction = Exclude<APIInteraction, APIPingInteraction>;\n\nexport type MessageComponentType =\n | ComponentType.Button\n | ComponentType.StringSelect\n | ComponentType.UserSelect\n | ComponentType.RoleSelect\n | ComponentType.MentionableSelect\n | ComponentType.ChannelSelect;\n\nexport type MessageComponentDataTypes = {\n [ComponentType.Button]: APIMessageButtonInteractionData;\n [ComponentType.StringSelect]: APIMessageStringSelectInteractionData;\n [ComponentType.UserSelect]: APIMessageUserSelectInteractionData;\n [ComponentType.RoleSelect]: APIMessageRoleSelectInteractionData;\n [ComponentType.MentionableSelect]: APIMessageMentionableSelectInteractionData;\n [ComponentType.ChannelSelect]: APIMessageChannelSelectInteractionData;\n};\n\nexport type MessageComponentInteractionPayload<T extends MessageComponentType = MessageComponentType> = Extract<\n ValidInteraction,\n {\n type: InteractionType.MessageComponent;\n }\n> & {\n data: MessageComponentDataTypes[T];\n};\n\nexport enum ContextCommandType {\n User = ApplicationCommandType.User,\n Message = ApplicationCommandType.Message,\n}\n\nexport type BufferSource = ArrayBufferView | ArrayBuffer;\n\nexport type FlatOrNestedArray<T> = T[] | T[][];\n\n/**\n * Represents an object capable of representing itself as a JSON object\n *\n * @typeParam Value - The JSON type corresponding to {@link JSONEncodable.toJSON} outputs.\n */\nexport interface JSONEncodable<Value> {\n /**\n * Transforms this object to its JSON format\n */\n toJSON(): Value;\n}\n\nexport type AnyInteraction<Context extends BaseInteractionContext = BaseInteractionContext> =\n | ChatInputCommandInteraction<Context>\n | UserContextInteraction<Context>\n | MessageContextInteraction<Context>\n | TMessageComponentInteraction<Context>\n | ModalInteraction<Context>\n | AutocompleteInteraction<Context>;\n\nexport type HandlerFunction<\n Context extends BaseInteractionContext = BaseInteractionContext,\n InteractionArg extends AnyInteraction<Context> = AnyInteraction<Context>,\n> = (interaction: InteractionArg) => Promise<any> | any;\n\n/**\n * Middleware function type for processing interaction contexts.\n *\n * Helpful for implementing cross-cutting concerns such as logging, authentication, setting of the DB, etc.\n */\nexport type MiddlewareFunction<Context extends BaseInteractionContext = BaseInteractionContext> = (\n context: Context,\n next: () => Promise<void>\n) => Promise<Response | void> | Response | void;\n\n// ---------------------------------------------------------------------------------------------\n// The following types are typings which are derived from discord-api-types but we are using Builders so be have to redefine them\n// ---------------------------------------------------------------------------------------------\n\nexport interface InteractionResponseCallbackData extends Omit<APIInteractionResponseCallbackData, \"components\" | \"embeds\"> {\n /**\n * The components to include with the message\n *\n * Application-owned webhooks can always send components. Non-application-owned webhooks cannot send interactive components, and the `components` field will be ignored unless they set the `with_components` query param.\n *\n * Can be `ActionRowBuilder` or raw APIMessageActionRowComponent\n *\n * If using Components V2, ensure that `flags` includes `MessageFlags.IsComponentsV2` is set.\n *\n * @see {@link https://discord.com/developers/docs/components/reference}\n */\n components?: (JSONEncodable<APIMessageTopLevelComponent> | APIMessageTopLevelComponent)[];\n /**\n * Embedded `rich` content\n *\n * Can be `EmbedBuilder` or raw APIEmbed\n *\n * @see {@link https://discord.com/developers/docs/resources/channel#embed-object}\n */\n embeds?: (JSONEncodable<APIEmbed> | APIEmbed)[];\n}\n\nexport interface ModalInteractionResponseCallbackData extends Omit<APIModalInteractionResponseCallbackData, \"components\"> {\n /**\n * The components to include with the modal\n *\n * Can be `LabelBuilder` or raw APILabelComponent.\n *\n * @see {@link https://discord.com/developers/docs/interactions/message-components#action-rows}\n */\n components: (JSONEncodable<APILabelComponent> | APILabelComponent)[];\n}\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,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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCT,IAAqE,GAAG,YAAiD;AACvH,OAAK,WAAW,KAAK,GAAG,WAAW;AACnC,SAAO;;;;;;CAOT,kBAAwB;AACtB,OAAK,aAAa,EAAE;AACpB,SAAO;;;;;;ACrSX,IAAY,oEAAL;AACL,qDAAOC,yBAAuB;AAC9B,wDAAUA,yBAAuB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "honocord",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -46,6 +46,7 @@
46
46
  "repository": {
47
47
  "url": "git+https://github.com/The-LukeZ/honocord.git"
48
48
  },
49
+ "homepage": "https://honocord.thelukez.com",
49
50
  "engines": {
50
51
  "node": ">=22.9.0"
51
52
  },