@seedcord/http 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RouteManifest-DTxI4fS0.d.mts → RouteManifest-D7qXj8Ts.d.mts} +3 -3
- package/dist/{edge.index-tJFQMQ2q.d.mts → edge.index-BW-YQh7m.d.mts} +153 -53
- package/dist/{edge.index-DwRPmkh2.mjs → edge.index-CZHoclPi.mjs} +167 -79
- package/dist/edge.index-CZHoclPi.mjs.map +1 -0
- package/dist/edge.index.d.mts +3 -3
- package/dist/edge.index.mjs +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +27 -78
- package/dist/index.mjs.map +1 -1
- package/dist/manifest.index.d.mts +1 -1
- package/package.json +13 -11
- package/dist/edge.index-DwRPmkh2.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InteractionKind, SubscriptionKey } from "@seedcord/core";
|
|
2
2
|
import { ApplicationCommandType } from "discord-api-types/v10";
|
|
3
3
|
import { EventFrequency } from "@seedcord/types";
|
|
4
4
|
//#region src/manifest/RouteManifest.d.ts
|
|
@@ -27,7 +27,7 @@ interface CommandRoute extends RouteModule {
|
|
|
27
27
|
* the receiver routes by (the routeKey minus its layout hash).
|
|
28
28
|
*/
|
|
29
29
|
interface ComponentRoute extends RouteModule {
|
|
30
|
-
readonly kind:
|
|
30
|
+
readonly kind: InteractionKind.Button | InteractionKind.Modal | InteractionKind.StringMenu | InteractionKind.UserMenu | InteractionKind.RoleMenu | InteractionKind.ChannelMenu | InteractionKind.MentionableMenu;
|
|
31
31
|
readonly prefix: string;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -61,4 +61,4 @@ interface RouteManifest {
|
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
63
63
|
export { RouteManifest as t };
|
|
64
|
-
//# sourceMappingURL=RouteManifest-
|
|
64
|
+
//# sourceMappingURL=RouteManifest-D7qXj8Ts.d.mts.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { t as RouteManifest } from "./RouteManifest-
|
|
1
|
+
import { t as RouteManifest } from "./RouteManifest-D7qXj8Ts.mjs";
|
|
2
2
|
import "reflect-metadata";
|
|
3
|
-
import {
|
|
3
|
+
import { AutocompletableNames, AutocompleteRouteBrand, ChoiceValueOf, ComponentDefsBrand, ComponentKindBrand, ContextMenuKindBrand, ContextMenuNamesBrand, EntryFor, FocusedField, GateFitsWith, HasComponentDefs, MatchArms, NamesFor, PageCursor, SingleParams, SlashOptions, SlashRouteBrand } from "@seedcord/core/internal";
|
|
4
4
|
import { REST } from "@discordjs/rest";
|
|
5
|
-
import { ArraySourceBase, AutocompleteOptions, BaseHandler, BaseReplySender, Bus, CoreBase, CursorSourceBase, DispatchContext, Gate, GateContextBase, GuildPermissionsContext, ModalLike, PageSourceBase, PaginatorBase, PaginatorConfig, RepliableHandler, RequiredOf, ResolvedEmoji,
|
|
5
|
+
import { ArraySourceBase, AutocompleteOptions, BaseHandler, BaseReplySender, Bus, CoreBase, CursorSourceBase, DispatchContext, Gate, GateContextBase, GuildPermissionsContext, InteractionKind, ModalLike, PageSourceBase, PaginatorBase, PaginatorConfig, RepliableHandler, RequiredOf, ResolvedEmoji, SlashRegistry, Subscriber, SubscriptionKey, WebhookLog } from "@seedcord/core";
|
|
6
6
|
import { APIApplicationCommandAutocompleteInteraction, APIApplicationCommandOptionChoice, APIAttachment, APIChatInputApplicationCommandInteraction, APIContextMenuInteraction, APIInteraction, APIInteractionDataResolvedChannel, APIInteractionDataResolvedChannelBase, APIInteractionDataResolvedGuildMember, APIInteractionGuildMember, APIMessage, APIMessageApplicationCommandInteraction, APIMessageChannelSelectInteractionData, APIMessageComponentButtonInteraction, APIMessageComponentInteraction, APIMessageComponentSelectMenuInteraction, APIMessageMentionableSelectInteractionData, APIMessageRoleSelectInteractionData, APIMessageStringSelectInteractionData, APIMessageUserSelectInteractionData, APIModalInteractionResponseCallbackData, APIModalSubmission, APIModalSubmitInteraction, APIRole, APIThreadChannel, APIUser, APIUserApplicationCommandInteraction, ApplicationCommandType, ChannelType, ModalSubmitComponent, ThreadChannelType } from "discord-api-types/v10";
|
|
7
7
|
import { API } from "@discordjs/core/http-only";
|
|
8
|
+
import { AnyCustomId } from "@seedcord/custom-id";
|
|
9
|
+
import { Collection } from "@discordjs/collection";
|
|
8
10
|
import { CoordinatedShutdown, CoordinatedStartup } from "@seedcord/core/node";
|
|
9
11
|
import { Config, DeferOpts, EmojiMap, ReplyResponse, SendOpts } from "@seedcord/types";
|
|
10
12
|
import { NonEmptyTuple, Promisable } from "type-fest";
|
|
@@ -119,9 +121,9 @@ type SlashOptions$1<Route extends keyof SlashRegistry> = SlashOptions<Route, Htt
|
|
|
119
121
|
type FieldKind = ModalSubmitComponent['type'];
|
|
120
122
|
/** The users, members, and roles a mentionable select picked. */
|
|
121
123
|
interface SelectedMentionables {
|
|
122
|
-
users:
|
|
123
|
-
members:
|
|
124
|
-
roles:
|
|
124
|
+
users: Collection<string, APIUser>;
|
|
125
|
+
members: Collection<string, APIInteractionDataResolvedGuildMember>;
|
|
126
|
+
roles: Collection<string, APIRole>;
|
|
125
127
|
}
|
|
126
128
|
/**
|
|
127
129
|
* The fields a modal carries, read by custom id.
|
|
@@ -130,7 +132,7 @@ interface SelectedMentionables {
|
|
|
130
132
|
* kind that getter does not read. The message names the getter that does.
|
|
131
133
|
*
|
|
132
134
|
* A select getter resolves the ids its field picked against the interaction's `resolved` data and returns a
|
|
133
|
-
* `
|
|
135
|
+
* `Collection` keyed by id. A field that picked nothing returns null. Pass `required` to throw there instead.
|
|
134
136
|
*/
|
|
135
137
|
declare class ModalFields {
|
|
136
138
|
private readonly entries;
|
|
@@ -151,19 +153,19 @@ declare class ModalFields {
|
|
|
151
153
|
getField(customId: string): ModalSubmitComponent;
|
|
152
154
|
getTextInputValue(customId: string): string;
|
|
153
155
|
getStringSelectValues(customId: string): string[];
|
|
154
|
-
getSelectedUsers(customId: string, required: true):
|
|
155
|
-
getSelectedUsers(customId: string, required?: boolean):
|
|
156
|
+
getSelectedUsers(customId: string, required: true): Collection<string, APIUser>;
|
|
157
|
+
getSelectedUsers(customId: string, required?: boolean): Collection<string, APIUser> | null;
|
|
156
158
|
/** The guild members behind the picked users. Discord resolves these only inside a guild. */
|
|
157
|
-
getSelectedMembers(customId: string):
|
|
158
|
-
getSelectedRoles(customId: string, required: true):
|
|
159
|
-
getSelectedRoles(customId: string, required?: boolean):
|
|
159
|
+
getSelectedMembers(customId: string): Collection<string, APIInteractionDataResolvedGuildMember> | null;
|
|
160
|
+
getSelectedRoles(customId: string, required: true): Collection<string, APIRole>;
|
|
161
|
+
getSelectedRoles(customId: string, required?: boolean): Collection<string, APIRole> | null;
|
|
160
162
|
/** Pass `channelTypes` to throw when a pick falls outside those types. */
|
|
161
|
-
getSelectedChannels(customId: string, required: true, channelTypes?: readonly ChannelType[]):
|
|
162
|
-
getSelectedChannels(customId: string, required?: boolean, channelTypes?: readonly ChannelType[]):
|
|
163
|
+
getSelectedChannels(customId: string, required: true, channelTypes?: readonly ChannelType[]): Collection<string, APIInteractionDataResolvedChannel>;
|
|
164
|
+
getSelectedChannels(customId: string, required?: boolean, channelTypes?: readonly ChannelType[]): Collection<string, APIInteractionDataResolvedChannel> | null;
|
|
163
165
|
getSelectedMentionables(customId: string, required: true): SelectedMentionables;
|
|
164
166
|
getSelectedMentionables(customId: string, required?: boolean): SelectedMentionables | null;
|
|
165
|
-
getUploadedFiles(customId: string, required: true):
|
|
166
|
-
getUploadedFiles(customId: string, required?: boolean):
|
|
167
|
+
getUploadedFiles(customId: string, required: true): Collection<string, APIAttachment>;
|
|
168
|
+
getUploadedFiles(customId: string, required?: boolean): Collection<string, APIAttachment> | null;
|
|
167
169
|
getRadioGroup(customId: string, required: true): string;
|
|
168
170
|
getRadioGroup(customId: string, required?: boolean): string | null;
|
|
169
171
|
getCheckboxGroup(customId: string): string[];
|
|
@@ -221,8 +223,8 @@ type Repliables = Exclude<ValidInteractionTypes, APIApplicationCommandAutocomple
|
|
|
221
223
|
* Shared base the repliable HTTP interaction handlers extend.
|
|
222
224
|
*
|
|
223
225
|
* Not a public entry point. Extend {@link SlashHandler}, {@link ButtonHandler}, {@link ModalHandler},
|
|
224
|
-
* {@link
|
|
225
|
-
* to the http sender.
|
|
226
|
+
* {@link ContextMenuHandler}, or one of the select menu bases instead. This class binds the core
|
|
227
|
+
* reply base to the http sender.
|
|
226
228
|
*
|
|
227
229
|
* @typeParam Event - The repliable interaction type this handler processes
|
|
228
230
|
*/
|
|
@@ -243,8 +245,8 @@ declare abstract class RepliableHandler$1<Event extends Repliables> extends Repl
|
|
|
243
245
|
* Shared base the repliable interaction handlers extend.
|
|
244
246
|
*
|
|
245
247
|
* Not a public entry point. Extend {@link SlashHandler}, {@link ContextMenuHandler}, {@link ButtonHandler},
|
|
246
|
-
* {@link
|
|
247
|
-
* reply members.
|
|
248
|
+
* {@link ModalHandler}, or one of the select menu bases instead. This class adds `showModal` on top
|
|
249
|
+
* of the reply members.
|
|
248
250
|
*
|
|
249
251
|
* @typeParam Event - The repliable interaction type this handler processes
|
|
250
252
|
*/
|
|
@@ -442,9 +444,9 @@ declare abstract class AutocompleteHandler<Route extends keyof SlashRegistry> ex
|
|
|
442
444
|
/**
|
|
443
445
|
* Shared base the customId-routed component handlers extend on the HTTP transport.
|
|
444
446
|
*
|
|
445
|
-
* Not a public entry point. Extend {@link ButtonHandler}, {@link
|
|
446
|
-
* instead. This class defines the customId decode, the route matching, and the source-message
|
|
447
|
-
* `update` and `deferUpdate`.
|
|
447
|
+
* Not a public entry point. Extend {@link ButtonHandler}, {@link ModalHandler}, or one of the select menu
|
|
448
|
+
* bases instead. This class defines the customId decode, the route matching, and the source-message
|
|
449
|
+
* verbs `update` and `deferUpdate`.
|
|
448
450
|
*
|
|
449
451
|
* @typeParam Event - The component or modal interaction type this handler processes
|
|
450
452
|
* @typeParam Defs - The customId route definitions registered on the concrete handler
|
|
@@ -509,7 +511,7 @@ declare abstract class ComponentHandler<Event extends APIMessageComponentInterac
|
|
|
509
511
|
*/
|
|
510
512
|
declare abstract class ButtonHandler<Defs extends readonly AnyCustomId[]> extends ComponentHandler<APIMessageComponentButtonInteraction, Defs> {
|
|
511
513
|
/** @internal */
|
|
512
|
-
readonly [ComponentKindBrand]?:
|
|
514
|
+
readonly [ComponentKindBrand]?: InteractionKind.Button;
|
|
513
515
|
}
|
|
514
516
|
//#endregion
|
|
515
517
|
//#region src/handlers/interaction/components/ModalHandler.d.ts
|
|
@@ -536,7 +538,7 @@ declare abstract class ButtonHandler<Defs extends readonly AnyCustomId[]> extend
|
|
|
536
538
|
*/
|
|
537
539
|
declare abstract class ModalHandler<Defs extends readonly AnyCustomId[]> extends ComponentHandler<APIModalSubmitInteraction, Defs> {
|
|
538
540
|
/** @internal */
|
|
539
|
-
readonly [ComponentKindBrand]?:
|
|
541
|
+
readonly [ComponentKindBrand]?: InteractionKind.Modal;
|
|
540
542
|
private reader?;
|
|
541
543
|
/** The fields this modal submitted, read by custom id. */
|
|
542
544
|
protected get fields(): ModalFields;
|
|
@@ -548,29 +550,59 @@ declare abstract class ModalHandler<Defs extends readonly AnyCustomId[]> extends
|
|
|
548
550
|
}
|
|
549
551
|
//#endregion
|
|
550
552
|
//#region src/handlers/interaction/components/SelectMenuHandler.d.ts
|
|
551
|
-
type
|
|
552
|
-
|
|
553
|
-
type ResolvedFor<Kind extends SelectMenuKind, Allowed extends SelectMenuKind, Value> = [Kind] extends [Allowed] ? Map<string, Value> : never;
|
|
554
|
-
type SelectMenuInteractionFor<Kind extends SelectMenuKind> = APIMessageComponentSelectMenuInteraction & {
|
|
555
|
-
data: Kind extends SelectMenuKind.String ? APIMessageStringSelectInteractionData : Kind extends SelectMenuKind.User ? APIMessageUserSelectInteractionData : Kind extends SelectMenuKind.Role ? APIMessageRoleSelectInteractionData : Kind extends SelectMenuKind.Channel ? APIMessageChannelSelectInteractionData : Kind extends SelectMenuKind.Mentionable ? APIMessageMentionableSelectInteractionData : never;
|
|
553
|
+
type SelectInteraction<Data> = APIMessageComponentSelectMenuInteraction & {
|
|
554
|
+
data: Data;
|
|
556
555
|
};
|
|
557
556
|
/**
|
|
558
|
-
*
|
|
557
|
+
* Shared base the select menu handlers extend on the HTTP transport.
|
|
559
558
|
*
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
559
|
+
* Not a public entry point. Extend {@link StringMenuHandler}, {@link UserMenuHandler},
|
|
560
|
+
* {@link RoleMenuHandler}, {@link ChannelMenuHandler}, or {@link MentionableMenuHandler} instead. This
|
|
561
|
+
* class defines the `values` getter those bases share.
|
|
563
562
|
*
|
|
564
|
-
*
|
|
565
|
-
*
|
|
563
|
+
* @typeParam Event - The select menu interaction type this handler processes
|
|
564
|
+
* @typeParam Defs - The customId route definitions registered on the concrete handler
|
|
565
|
+
*/
|
|
566
|
+
declare abstract class SelectMenuHandler<Event extends APIMessageComponentSelectMenuInteraction, Defs extends readonly AnyCustomId[]> extends ComponentHandler<Event, Defs> {
|
|
567
|
+
/** The values this select picked. On every kind but the string menu they are snowflake ids. */
|
|
568
|
+
protected get values(): string[];
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Base class for a string select menu handler on the HTTP transport.
|
|
572
|
+
*
|
|
573
|
+
* Register the customId definitions with `@StringMenuRoute`, list the same ones in the generic, then read
|
|
574
|
+
* the chosen option values from `this.values`. Read `this.params` for a single route or `this.match` for
|
|
575
|
+
* several. Reply through the handler members, or rewrite the source message with `this.update`.
|
|
576
|
+
*
|
|
577
|
+
* @typeParam Defs - The customId definitions this handler decodes, e.g. `[typeof TopicsId]`.
|
|
578
|
+
*
|
|
579
|
+
* @example
|
|
580
|
+
* ```ts
|
|
581
|
+
* \@StringMenuRoute(TopicsId)
|
|
582
|
+
* class Topics extends StringMenuHandler<[typeof TopicsId]> {
|
|
583
|
+
* async execute() {
|
|
584
|
+
* const { userId } = this.params;
|
|
585
|
+
* await this.update(`<@${userId}> now follows ${this.values.join(', ')}`);
|
|
586
|
+
* }
|
|
587
|
+
* }
|
|
588
|
+
* ```
|
|
589
|
+
*/
|
|
590
|
+
declare abstract class StringMenuHandler<Defs extends readonly AnyCustomId[]> extends SelectMenuHandler<SelectInteraction<APIMessageStringSelectInteractionData>, Defs> {
|
|
591
|
+
/** @internal */
|
|
592
|
+
readonly [ComponentKindBrand]?: InteractionKind.StringMenu;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Base class for a user select menu handler on the HTTP transport.
|
|
596
|
+
*
|
|
597
|
+
* Beside `this.values` this handler declares `this.users` and `this.members`. Register the customId
|
|
598
|
+
* definitions with `@UserMenuRoute` and list the same ones in the generic.
|
|
566
599
|
*
|
|
567
|
-
* @typeParam Kind - The select kind from {@link SelectMenuKind}, e.g. `SelectMenuKind.User`.
|
|
568
600
|
* @typeParam Defs - The customId definitions this handler decodes, e.g. `[typeof AssignId]`.
|
|
569
601
|
*
|
|
570
602
|
* @example
|
|
571
603
|
* ```ts
|
|
572
|
-
* \@
|
|
573
|
-
* class
|
|
604
|
+
* \@UserMenuRoute(AssignId)
|
|
605
|
+
* class Assign extends UserMenuHandler<[typeof AssignId]> {
|
|
574
606
|
* async execute() {
|
|
575
607
|
* const { roleId } = this.params;
|
|
576
608
|
* await this.reply(`assigning ${this.users.size} member(s) to <@&${roleId}>`);
|
|
@@ -578,21 +610,89 @@ type SelectMenuInteractionFor<Kind extends SelectMenuKind> = APIMessageComponent
|
|
|
578
610
|
* }
|
|
579
611
|
* ```
|
|
580
612
|
*/
|
|
581
|
-
declare abstract class
|
|
613
|
+
declare abstract class UserMenuHandler<Defs extends readonly AnyCustomId[]> extends SelectMenuHandler<SelectInteraction<APIMessageUserSelectInteractionData>, Defs> {
|
|
582
614
|
/** @internal */
|
|
583
|
-
readonly [ComponentKindBrand]?:
|
|
584
|
-
private get selection();
|
|
585
|
-
private resolvedMap;
|
|
586
|
-
/** The ids this select picked. */
|
|
587
|
-
protected get values(): string[];
|
|
615
|
+
readonly [ComponentKindBrand]?: InteractionKind.UserMenu;
|
|
588
616
|
/** The users this select picked. */
|
|
589
|
-
protected get users():
|
|
617
|
+
protected get users(): Collection<string, APIUser>;
|
|
590
618
|
/** The guild members behind the picked users. Discord resolves these only inside a guild. */
|
|
591
|
-
protected get members():
|
|
619
|
+
protected get members(): Collection<string, APIInteractionDataResolvedGuildMember>;
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Base class for a role select menu handler on the HTTP transport.
|
|
623
|
+
*
|
|
624
|
+
* Beside `this.values` this handler declares `this.roles`. Register the customId definitions with
|
|
625
|
+
* `@RoleMenuRoute` and list the same ones in the generic.
|
|
626
|
+
*
|
|
627
|
+
* @typeParam Defs - The customId definitions this handler decodes, e.g. `[typeof GrantId]`.
|
|
628
|
+
*
|
|
629
|
+
* @example
|
|
630
|
+
* ```ts
|
|
631
|
+
* \@RoleMenuRoute(GrantId)
|
|
632
|
+
* class Grant extends RoleMenuHandler<[typeof GrantId]> {
|
|
633
|
+
* async execute() {
|
|
634
|
+
* await this.update(`granting ${this.roles.size} role(s)`);
|
|
635
|
+
* }
|
|
636
|
+
* }
|
|
637
|
+
* ```
|
|
638
|
+
*/
|
|
639
|
+
declare abstract class RoleMenuHandler<Defs extends readonly AnyCustomId[]> extends SelectMenuHandler<SelectInteraction<APIMessageRoleSelectInteractionData>, Defs> {
|
|
640
|
+
/** @internal */
|
|
641
|
+
readonly [ComponentKindBrand]?: InteractionKind.RoleMenu;
|
|
592
642
|
/** The roles this select picked. */
|
|
593
|
-
protected get roles():
|
|
643
|
+
protected get roles(): Collection<string, APIRole>;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Base class for a channel select menu handler on the HTTP transport.
|
|
647
|
+
*
|
|
648
|
+
* Beside `this.values` this handler declares `this.channels`. Register the customId definitions with
|
|
649
|
+
* `@ChannelMenuRoute` and list the same ones in the generic.
|
|
650
|
+
*
|
|
651
|
+
* @typeParam Defs - The customId definitions this handler decodes, e.g. `[typeof LogTargetId]`.
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
* ```ts
|
|
655
|
+
* \@ChannelMenuRoute(LogTargetId)
|
|
656
|
+
* class LogTarget extends ChannelMenuHandler<[typeof LogTargetId]> {
|
|
657
|
+
* async execute() {
|
|
658
|
+
* await this.update(`logging to ${this.channels.size} channel(s)`);
|
|
659
|
+
* }
|
|
660
|
+
* }
|
|
661
|
+
* ```
|
|
662
|
+
*/
|
|
663
|
+
declare abstract class ChannelMenuHandler<Defs extends readonly AnyCustomId[]> extends SelectMenuHandler<SelectInteraction<APIMessageChannelSelectInteractionData>, Defs> {
|
|
664
|
+
/** @internal */
|
|
665
|
+
readonly [ComponentKindBrand]?: InteractionKind.ChannelMenu;
|
|
594
666
|
/** The channels this select picked. */
|
|
595
|
-
protected get channels():
|
|
667
|
+
protected get channels(): Collection<string, APIInteractionDataResolvedChannel>;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Base class for a mentionable select menu handler on the HTTP transport.
|
|
671
|
+
*
|
|
672
|
+
* A mentionable menu accepts users and roles together. `this.users`, `this.members`, and `this.roles`
|
|
673
|
+
* can each come back empty.
|
|
674
|
+
*
|
|
675
|
+
* @typeParam Defs - The customId definitions this handler decodes, e.g. `[typeof InviteId]`.
|
|
676
|
+
*
|
|
677
|
+
* @example
|
|
678
|
+
* ```ts
|
|
679
|
+
* \@MentionableMenuRoute(InviteId)
|
|
680
|
+
* class Invite extends MentionableMenuHandler<[typeof InviteId]> {
|
|
681
|
+
* async execute() {
|
|
682
|
+
* await this.update(`inviting ${this.users.size} user(s) and ${this.roles.size} role(s)`);
|
|
683
|
+
* }
|
|
684
|
+
* }
|
|
685
|
+
* ```
|
|
686
|
+
*/
|
|
687
|
+
declare abstract class MentionableMenuHandler<Defs extends readonly AnyCustomId[]> extends SelectMenuHandler<SelectInteraction<APIMessageMentionableSelectInteractionData>, Defs> {
|
|
688
|
+
/** @internal */
|
|
689
|
+
readonly [ComponentKindBrand]?: InteractionKind.MentionableMenu;
|
|
690
|
+
/** The users this select picked. */
|
|
691
|
+
protected get users(): Collection<string, APIUser>;
|
|
692
|
+
/** The guild members behind the picked users. Discord resolves these only inside a guild. */
|
|
693
|
+
protected get members(): Collection<string, APIInteractionDataResolvedGuildMember>;
|
|
694
|
+
/** The roles this select picked. */
|
|
695
|
+
protected get roles(): Collection<string, APIRole>;
|
|
596
696
|
}
|
|
597
697
|
//#endregion
|
|
598
698
|
//#region src/subscribers/index.d.ts
|
|
@@ -738,8 +838,8 @@ interface Ungateable {
|
|
|
738
838
|
}
|
|
739
839
|
type ProvidedContext<TCtor extends AnyHandlerCtor> = InstanceType<TCtor> extends RepliableHandler$1<infer Event> ? InteractionGateContext<Event> : Ungateable;
|
|
740
840
|
type SelectData<Repliable> = Repliable extends APIMessageComponentSelectMenuInteraction ? Repliable['data'] : never;
|
|
741
|
-
type SelectKindName<Data> = Data extends APIMessageStringSelectInteractionData ? '
|
|
742
|
-
type KindName<Ctx> = Ctx extends Ungateable ? 'autocomplete' : Ctx extends GuildPermissionsContext ? 'gateway (guild permissions)' : Ctx extends InteractionGateContext<infer Repliable> ? Repliable extends APIChatInputApplicationCommandInteraction ? 'Slash' : Repliable extends APIMessageApplicationCommandInteraction ? '
|
|
841
|
+
type SelectKindName<Data> = Data extends APIMessageStringSelectInteractionData ? 'StringMenu' : Data extends APIMessageUserSelectInteractionData ? 'UserMenu' : Data extends APIMessageRoleSelectInteractionData ? 'RoleMenu' : Data extends APIMessageChannelSelectInteractionData ? 'ChannelMenu' : Data extends APIMessageMentionableSelectInteractionData ? 'MentionableMenu' : 'an interaction';
|
|
842
|
+
type KindName<Ctx> = Ctx extends Ungateable ? 'autocomplete' : Ctx extends GuildPermissionsContext ? 'gateway (guild permissions)' : Ctx extends InteractionGateContext<infer Repliable> ? Repliable extends APIChatInputApplicationCommandInteraction ? 'Slash' : Repliable extends APIMessageApplicationCommandInteraction ? 'MessageContextMenu' : Repliable extends APIUserApplicationCommandInteraction ? 'UserContextMenu' : Repliable extends APIMessageComponentSelectMenuInteraction ? SelectKindName<SelectData<Repliable>> : Repliable extends APIMessageComponentButtonInteraction ? 'Button' : Repliable extends APIModalSubmitInteraction ? 'Modal' : 'an interaction' : 'an agnostic';
|
|
743
843
|
type FitAll<TCtor extends AnyHandlerCtor, Gates extends readonly Gate<GateContextBase>[]> = { [Index in keyof Gates]: GateFitsWith<ProvidedContext<TCtor>, KindName<ProvidedContext<TCtor>>, Gates[Index], KindName<RequiredOf<Gates[Index]>>>; };
|
|
744
844
|
//#endregion
|
|
745
845
|
//#region src/gates/Gated.d.ts
|
|
@@ -780,5 +880,5 @@ declare function Gated<const Gates extends NonEmptyTuple<Gate<GateContextBase>>>
|
|
|
780
880
|
//#region src/version.d.ts
|
|
781
881
|
declare const version: string;
|
|
782
882
|
//#endregion
|
|
783
|
-
export {
|
|
784
|
-
//# sourceMappingURL=edge.index-
|
|
883
|
+
export { InjectedEmojiMap as A, SlashHandler as C, ReplySender as D, InteractionRef as E, EngineContext as F, Core as I, HttpConfig as L, SelectedMentionables as M, SlashOptions$1 as N, SentMessage as O, createSeedcord as P, HttpEdgeConfig as R, UserContextMenuHandler as S, RepliableHandler$1 as T, ModalHandler as _, CursorSource as a, AutocompleteHandler as b, PageContext as c, ChannelMenuHandler as d, MentionableMenuHandler as f, UserMenuHandler as g, StringMenuHandler as h, ArraySource as i, ModalFields as j, Emojis as k, Subscriber$1 as l, SelectMenuHandler as m, Gated as n, PageSource as o, RoleMenuHandler as p, InteractionGateContext as r, Paginator as s, version as t, WebhookLog$1 as u, ButtonHandler as v, InteractionHandler as w, MessageContextMenuHandler as x, ComponentHandler as y, HttpServerConfig as z };
|
|
884
|
+
//# sourceMappingURL=edge.index-BW-YQh7m.d.mts.map
|