oceanic.js 1.7.1-dev.e8621ff → 1.7.2-dev.02fa4da
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/lib/Client.d.ts +9 -8
- package/dist/lib/Client.js +18 -10
- package/dist/lib/Constants.d.ts +27 -17
- package/dist/lib/Constants.js +25 -16
- package/dist/lib/gateway/Shard.d.ts +1 -1
- package/dist/lib/gateway/Shard.js +35 -37
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.js +9 -3
- package/dist/lib/rest/RESTManager.d.ts +2 -2
- package/dist/lib/rest/RESTManager.js +3 -3
- package/dist/lib/rest/RequestHandler.js +8 -3
- package/dist/lib/routes/ApplicationCommands.d.ts +16 -1
- package/dist/lib/routes/ApplicationCommands.js +18 -3
- package/dist/lib/routes/Channels.d.ts +77 -7
- package/dist/lib/routes/Channels.js +81 -14
- package/dist/lib/routes/Guilds.d.ts +115 -10
- package/dist/lib/routes/Guilds.js +146 -44
- package/dist/lib/routes/Interactions.d.ts +10 -2
- package/dist/lib/routes/Interactions.js +10 -2
- package/dist/lib/routes/Miscellaneous.d.ts +8 -2
- package/dist/lib/routes/Miscellaneous.js +11 -5
- package/dist/lib/routes/OAuth.d.ts +17 -4
- package/dist/lib/routes/OAuth.js +17 -4
- package/dist/lib/routes/Users.d.ts +7 -5
- package/dist/lib/routes/Users.js +7 -5
- package/dist/lib/routes/Webhooks.d.ts +16 -2
- package/dist/lib/routes/Webhooks.js +16 -17
- package/dist/lib/structures/AnnouncementChannel.d.ts +5 -2
- package/dist/lib/structures/AnnouncementChannel.js +6 -6
- package/dist/lib/structures/Application.d.ts +1 -1
- package/dist/lib/structures/Application.js +2 -2
- package/dist/lib/structures/AutocompleteInteraction.d.ts +3 -1
- package/dist/lib/structures/AutocompleteInteraction.js +4 -1
- package/dist/lib/structures/CategoryChannel.d.ts +5 -4
- package/dist/lib/structures/CategoryChannel.js +6 -4
- package/dist/lib/structures/Channel.js +5 -1
- package/dist/lib/structures/CommandInteraction.d.ts +5 -3
- package/dist/lib/structures/CommandInteraction.js +6 -3
- package/dist/lib/structures/ComponentInteraction.d.ts +5 -3
- package/dist/lib/structures/ComponentInteraction.js +6 -3
- package/dist/lib/structures/ForumChannel.d.ts +5 -94
- package/dist/lib/structures/ForumChannel.js +5 -223
- package/dist/lib/structures/GroupChannel.d.ts +1 -1
- package/dist/lib/structures/GroupChannel.js +7 -11
- package/dist/lib/structures/Guild.d.ts +17 -17
- package/dist/lib/structures/Guild.js +36 -32
- package/dist/lib/structures/Invite.d.ts +2 -0
- package/dist/lib/structures/Invite.js +7 -1
- package/dist/lib/structures/MediaChannel.d.ts +11 -0
- package/dist/lib/structures/MediaChannel.js +19 -0
- package/dist/lib/structures/Member.d.ts +1 -1
- package/dist/lib/structures/Member.js +1 -1
- package/dist/lib/structures/Message.d.ts +4 -2
- package/dist/lib/structures/Message.js +20 -12
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +5 -3
- package/dist/lib/structures/ModalSubmitInteraction.js +6 -3
- package/dist/lib/structures/PrivateChannel.d.ts +1 -1
- package/dist/lib/structures/PrivateChannel.js +1 -1
- package/dist/lib/structures/TextChannel.js +2 -3
- package/dist/lib/structures/TextableChannel.d.ts +3 -3
- package/dist/lib/structures/TextableChannel.js +2 -2
- package/dist/lib/structures/TextableVoiceChannel.d.ts +2 -2
- package/dist/lib/structures/TextableVoiceChannel.js +2 -2
- package/dist/lib/structures/ThreadChannel.d.ts +1 -1
- package/dist/lib/structures/ThreadChannel.js +1 -1
- package/dist/lib/structures/ThreadOnlyChannel.d.ts +99 -0
- package/dist/lib/structures/ThreadOnlyChannel.js +233 -0
- package/dist/lib/structures/ThreadableChannel.d.ts +5 -7
- package/dist/lib/structures/ThreadableChannel.js +7 -6
- package/dist/lib/structures/User.d.ts +9 -2
- package/dist/lib/structures/User.js +15 -6
- package/dist/lib/types/channels.d.ts +58 -32
- package/dist/lib/types/client.d.ts +20 -6
- package/dist/lib/types/events.d.ts +2 -2
- package/dist/lib/types/gateway.d.ts +1 -1
- package/dist/lib/types/guilds.d.ts +3 -1
- package/dist/lib/types/interactions.d.ts +54 -22
- package/dist/lib/types/json.d.ts +23 -16
- package/dist/lib/types/misc.d.ts +3 -0
- package/dist/lib/types/request-handler.d.ts +2 -0
- package/dist/lib/util/Errors.d.ts +1 -1
- package/dist/lib/util/Errors.js +2 -2
- package/dist/lib/util/InteractionOptionsWrapper.d.ts +3 -3
- package/dist/lib/util/InteractionOptionsWrapper.js +3 -4
- package/dist/lib/util/SelectMenuValuesWrapper.d.ts +3 -3
- package/dist/lib/util/SelectMenuValuesWrapper.js +5 -6
- package/dist/lib/util/SimpleCollection.d.ts +12 -0
- package/dist/lib/util/SimpleCollection.js +81 -0
- package/dist/lib/util/TypedCollection.d.ts +13 -5
- package/dist/lib/util/TypedCollection.js +19 -6
- package/dist/lib/util/Util.d.ts +4 -2
- package/dist/lib/util/Util.js +37 -18
- package/dist/package.json +22 -19
- package/esm.mjs +6 -0
- package/package.json +22 -19
- package/patches/typedoc-plugin-merge-modules@5.0.1.patch +26 -0
|
@@ -26,16 +26,17 @@ import type {
|
|
|
26
26
|
NotImplementedChannelTypes,
|
|
27
27
|
GuildChannelTypes,
|
|
28
28
|
ThreadChannelTypes,
|
|
29
|
-
|
|
29
|
+
GuildChannelsWithoutThreadsTypes,
|
|
30
30
|
EditableChannelTypes,
|
|
31
31
|
TextableChannelTypes,
|
|
32
32
|
TextableGuildChannelTypes,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
TextableChannelsWithoutThreadsTypes,
|
|
34
|
+
TextableGuildChannelsWithoutThreadsTypes,
|
|
35
35
|
VoiceChannelTypes,
|
|
36
36
|
InteractionChannelTypes,
|
|
37
37
|
InviteChannelTypes,
|
|
38
|
-
ImplementedChannelTypes
|
|
38
|
+
ImplementedChannelTypes,
|
|
39
|
+
ThreadOnlyChannelTypes
|
|
39
40
|
} from "../Constants";
|
|
40
41
|
import type Member from "../structures/Member";
|
|
41
42
|
import type AnnouncementChannel from "../structures/AnnouncementChannel";
|
|
@@ -83,7 +84,6 @@ export interface RawChannel {
|
|
|
83
84
|
rate_limit_per_user?: number;
|
|
84
85
|
recipients?: Array<RawUser>;
|
|
85
86
|
rtc_region?: string | null;
|
|
86
|
-
template?: string;
|
|
87
87
|
thread_metadata?: RawThreadMetadata;
|
|
88
88
|
topic?: string | null;
|
|
89
89
|
total_message_sent?: number;
|
|
@@ -104,7 +104,9 @@ export type RawThreadChannel = RawAnnouncementThreadChannel | RawPublicThreadCha
|
|
|
104
104
|
export interface RawAnnouncementThreadChannel extends Required<Pick<RawChannel, "id" | "guild_id" | "parent_id" | "owner_id" | "last_message_id" | "thread_metadata" | "message_count" | "member_count" | "rate_limit_per_user" | "flags" | "total_message_sent" | "newly_created" | "member">> { name: string; type: ChannelTypes.ANNOUNCEMENT_THREAD; }
|
|
105
105
|
export interface RawPublicThreadChannel extends Omit<RawAnnouncementThreadChannel, "type">, Required<Pick<RawChannel, "applied_tags">> { type: ChannelTypes.PUBLIC_THREAD; }
|
|
106
106
|
export interface RawPrivateThreadChannel extends Omit<RawAnnouncementThreadChannel, "type" | "member"> { member: RawChannel["member"]; type: ChannelTypes.PRIVATE_THREAD; }
|
|
107
|
-
export interface
|
|
107
|
+
export interface RawThreadOnlyChannel extends Omit<RawGuildChannel, "type">, Required<Pick<RawChannel, "position" | "topic" | "flags" | "permission_overwrites" | "rate_limit_per_user" | "nsfw" | "available_tags" | "default_reaction_emoji" | "last_message_id" | "default_sort_order" | "default_thread_rate_limit_per_user" | "default_auto_archive_duration" | "default_forum_layout">> { type: ThreadOnlyChannels; }
|
|
108
|
+
export interface RawForumChannel extends Omit<RawThreadOnlyChannel, "type"> { type: ChannelTypes.GUILD_FORUM; }
|
|
109
|
+
export interface RawMediaChannel extends Omit<RawThreadOnlyChannel, "type"> { type: ChannelTypes.GUILD_MEDIA; }
|
|
108
110
|
|
|
109
111
|
export interface PartialChannel extends Pick<RawChannel, "id" | "name" | "type"> {}
|
|
110
112
|
export interface RawInteractionResolvedChannel extends Omit<Required<Pick<RawChannel, "id" | "type" | "permissions">>, "name">, Pick<RawChannel, "thread_metadata" | "parent_id"> { name: string | null; }
|
|
@@ -125,9 +127,9 @@ export interface Overwrite {
|
|
|
125
127
|
|
|
126
128
|
export interface OverwriteOptions {
|
|
127
129
|
/** The permissions to allow. */
|
|
128
|
-
allow?: string | bigint;
|
|
130
|
+
allow?: string | bigint | null;
|
|
129
131
|
/** The permissions to deny. */
|
|
130
|
-
deny?: string | bigint;
|
|
132
|
+
deny?: string | bigint | null;
|
|
131
133
|
/** The ID of the user or role to apply the permissions to. */
|
|
132
134
|
id: string;
|
|
133
135
|
/** `0` for role, `1` for user. */
|
|
@@ -225,7 +227,7 @@ export interface EditGuildChannelOptions {
|
|
|
225
227
|
/** [Announcement, Forum, Text, Voice] The id of the parent category channel. */
|
|
226
228
|
parentID?: string | null;
|
|
227
229
|
/** Channel or category specific permissions. */
|
|
228
|
-
permissionOverwrites?: Array<
|
|
230
|
+
permissionOverwrites?: Array<OverwriteOptions> | null;
|
|
229
231
|
/** The position of the channel in the channel list. */
|
|
230
232
|
position?: number | null;
|
|
231
233
|
/** [Forum, Text, Thread] The seconds between sending messages for users. Between 0 and 21600. */
|
|
@@ -253,23 +255,26 @@ export interface EditStageChannelOptions extends EditAnyGuildChannelOptions, Pic
|
|
|
253
255
|
export interface EditThreadChannelOptions extends EditPublicThreadChannelOptions, EditPrivateThreadChannelOptions {}
|
|
254
256
|
export interface EditPublicThreadChannelOptions extends Pick<EditGuildChannelOptions, "name" | "archived" | "autoArchiveDuration" | "locked" | "rateLimitPerUser" | "flags" | "appliedTags"> {}
|
|
255
257
|
export interface EditPrivateThreadChannelOptions extends EditPublicThreadChannelOptions, Pick<EditGuildChannelOptions, "invitable"> {}
|
|
256
|
-
export interface EditForumChannelOptions extends EditAnyGuildChannelOptions, Pick<EditGuildChannelOptions, "availableTags" | "defaultReactionEmoji" | "defaultSortOrder" |"defaultThreadRateLimitPerUser" | "flags" | "nsfw" | "rateLimitPerUser" | "topic"> {}
|
|
258
|
+
export interface EditForumChannelOptions extends EditAnyGuildChannelOptions, Pick<EditGuildChannelOptions, "availableTags" | "defaultReactionEmoji" | "defaultSortOrder" |"defaultThreadRateLimitPerUser" | "flags" | "nsfw" | "rateLimitPerUser" | "topic" | "defaultForumLayout"> {}
|
|
259
|
+
export interface EditMediaChannelOptions extends EditAnyGuildChannelOptions, Pick<EditGuildChannelOptions, "availableTags" | "defaultReactionEmoji" | "defaultSortOrder" |"defaultThreadRateLimitPerUser" | "flags" | "nsfw" | "rateLimitPerUser" | "topic"> {}
|
|
257
260
|
|
|
261
|
+
/* eslint-disable @typescript-eslint/member-ordering */
|
|
258
262
|
export interface EditChannelOptionsMap {
|
|
259
|
-
[ChannelTypes.
|
|
263
|
+
[ChannelTypes.GUILD_TEXT]: EditTextChannelOptions;
|
|
260
264
|
[ChannelTypes.DM]: never;
|
|
265
|
+
[ChannelTypes.GUILD_VOICE]: EditVoiceChannelOptions;
|
|
261
266
|
[ChannelTypes.GROUP_DM]: EditGroupDMOptions;
|
|
262
|
-
[ChannelTypes.GUILD_ANNOUNCEMENT]: EditAnnouncementChannelOptions;
|
|
263
267
|
[ChannelTypes.GUILD_CATEGORY]: EditAnyGuildChannelOptions;
|
|
268
|
+
[ChannelTypes.GUILD_ANNOUNCEMENT]: EditAnnouncementChannelOptions;
|
|
269
|
+
[ChannelTypes.ANNOUNCEMENT_THREAD]: EditPublicThreadChannelOptions;
|
|
270
|
+
[ChannelTypes.PUBLIC_THREAD]: EditPublicThreadChannelOptions;
|
|
271
|
+
[ChannelTypes.PRIVATE_THREAD]: EditPrivateThreadChannelOptions;
|
|
272
|
+
[ChannelTypes.GUILD_STAGE_VOICE]: EditStageChannelOptions;
|
|
264
273
|
[ChannelTypes.GUILD_DIRECTORY]: never;
|
|
265
274
|
[ChannelTypes.GUILD_FORUM]: EditForumChannelOptions;
|
|
266
|
-
[ChannelTypes.
|
|
267
|
-
[ChannelTypes.GUILD_TEXT]: EditTextChannelOptions;
|
|
268
|
-
[ChannelTypes.GUILD_VOICE]: EditVoiceChannelOptions;
|
|
269
|
-
[ChannelTypes.PRIVATE_THREAD]: EditPrivateThreadChannelOptions;
|
|
270
|
-
[ChannelTypes.PUBLIC_THREAD]: EditPublicThreadChannelOptions;
|
|
275
|
+
[ChannelTypes.GUILD_MEDIA]: EditMediaChannelOptions;
|
|
271
276
|
}
|
|
272
|
-
|
|
277
|
+
/* eslint-enable @typescript-eslint/member-ordering */
|
|
273
278
|
|
|
274
279
|
export interface AddGroupRecipientOptions {
|
|
275
280
|
/** The access token of the user to add. */
|
|
@@ -285,11 +290,11 @@ export interface CreateMessageOptions {
|
|
|
285
290
|
allowedMentions?: AllowedMentions;
|
|
286
291
|
/** An array of [partial attachments](https://discord.com/developers/docs/resources/channel#attachment-object) related to the sent files. */
|
|
287
292
|
attachments?: Array<MessageAttachment>;
|
|
288
|
-
/** An array of [components](https://discord.com/developers/docs/interactions/message-components) to send. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util
|
|
293
|
+
/** An array of [components](https://discord.com/developers/docs/interactions/message-components) to send. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util.rawMessageComponents | Util#rawMessageComponents}. */
|
|
289
294
|
components?: Array<MessageActionRow>;
|
|
290
295
|
/** The content of the message. */
|
|
291
296
|
content?: string;
|
|
292
|
-
/** An array of [embeds](https://discord.com/developers/docs/resources/channel#embed-object) to send. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util
|
|
297
|
+
/** An array of [embeds](https://discord.com/developers/docs/resources/channel#embed-object) to send. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util.rawEmbeds | Util#rawEmbeds}. */
|
|
293
298
|
embeds?: Array<EmbedOptions>;
|
|
294
299
|
/** The files to send. */
|
|
295
300
|
files?: Array<File>;
|
|
@@ -628,7 +633,10 @@ export interface RawAttachment {
|
|
|
628
633
|
width?: number;
|
|
629
634
|
}
|
|
630
635
|
// @TODO verify what can be sent with `attachments` in message creation/deletion, this is an assumption
|
|
631
|
-
export interface MessageAttachment extends
|
|
636
|
+
export interface MessageAttachment extends Partial<Pick<RawAttachment, "description" | "filename">> {
|
|
637
|
+
/** The id of the attachment to edit, or the index of `files` to reference. */
|
|
638
|
+
id?: string | number;
|
|
639
|
+
}
|
|
632
640
|
|
|
633
641
|
export interface RawAllowedMentions {
|
|
634
642
|
parse: Array<"everyone" | "roles" | "users">;
|
|
@@ -663,6 +671,7 @@ export interface RawMessage {
|
|
|
663
671
|
position?: number;
|
|
664
672
|
reactions?: Array<RawMessageReaction>;
|
|
665
673
|
referenced_message?: RawMessage | null;
|
|
674
|
+
role_subscription_data?: RawRoleSubscriptionData;
|
|
666
675
|
// stickers exists, but is deprecated
|
|
667
676
|
sticker_items?: Array<StickerItem>;
|
|
668
677
|
thread?: RawAnnouncementThreadChannel | RawPublicThreadChannel | RawPrivateThreadChannel;
|
|
@@ -730,16 +739,17 @@ export type NotImplementedChannels = typeof NotImplementedChannelTypes[number];
|
|
|
730
739
|
export type ImplementedChannels = typeof ImplementedChannelTypes[number];
|
|
731
740
|
export type GuildChannels = typeof GuildChannelTypes[number];
|
|
732
741
|
export type ThreadChannels = typeof ThreadChannelTypes[number];
|
|
733
|
-
export type GuildChannelsWithoutThreads = typeof
|
|
742
|
+
export type GuildChannelsWithoutThreads = typeof GuildChannelsWithoutThreadsTypes[number];
|
|
734
743
|
export type PrivateChannels = typeof PrivateChannelTypes[number];
|
|
735
744
|
export type EditableChannels = typeof EditableChannelTypes[number];
|
|
736
745
|
export type TextableChannels = typeof TextableChannelTypes[number];
|
|
737
746
|
export type TextableGuildChannels = typeof TextableGuildChannelTypes[number];
|
|
738
|
-
export type TextableChannelsWithoutThreads = typeof
|
|
739
|
-
export type TextableGuildChannelsWithoutThreads = typeof
|
|
747
|
+
export type TextableChannelsWithoutThreads = typeof TextableChannelsWithoutThreadsTypes[number];
|
|
748
|
+
export type TextableGuildChannelsWithoutThreads = typeof TextableGuildChannelsWithoutThreadsTypes[number];
|
|
740
749
|
export type VoiceChannels = typeof VoiceChannelTypes[number];
|
|
741
750
|
export type InviteChannels = typeof InviteChannelTypes[number];
|
|
742
751
|
export type InteractionChannels = typeof InteractionChannelTypes[number];
|
|
752
|
+
export type ThreadOnlyChannels = typeof ThreadOnlyChannelTypes[number];
|
|
743
753
|
|
|
744
754
|
|
|
745
755
|
export type AnyChannel = ChannelTypeMap[ChannelTypes];
|
|
@@ -757,6 +767,7 @@ export type AnyTextableGuildChannelWithoutThreads = ChannelTypeMap[TextableGuild
|
|
|
757
767
|
export type AnyVoiceChannel = ChannelTypeMap[VoiceChannels];
|
|
758
768
|
export type AnyInviteChannel = ChannelTypeMap[InviteChannels];
|
|
759
769
|
export type AnyInteractionChannel = ChannelTypeMap[InteractionChannels];
|
|
770
|
+
export type AnyThreadOnlyChannel = ChannelTypeMap[ThreadOnlyChannels];
|
|
760
771
|
|
|
761
772
|
export interface PartialInviteChannel {
|
|
762
773
|
icon?: string | null;
|
|
@@ -773,11 +784,11 @@ export interface UncachedInvite {
|
|
|
773
784
|
}
|
|
774
785
|
|
|
775
786
|
export interface GetChannelMessagesOptions<T extends AnyTextableChannel | Uncached = AnyTextableChannel | Uncached> {
|
|
776
|
-
/** Get messages after this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base
|
|
787
|
+
/** Get messages after this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base.generateID | Base#generateID}. */
|
|
777
788
|
after?: string;
|
|
778
|
-
/** Get messages around this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base
|
|
789
|
+
/** Get messages around this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base.generateID | Base#generateID}. */
|
|
779
790
|
around?: string;
|
|
780
|
-
/** Get messages before this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base
|
|
791
|
+
/** Get messages before this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base.generateID | Base#generateID}. */
|
|
781
792
|
before?: string;
|
|
782
793
|
/** The maximum amount of messages to get. Defaults to 100. Use Infinity if you wish to get as many messages as possible. */
|
|
783
794
|
limit?: number;
|
|
@@ -789,9 +800,9 @@ export interface GetChannelMessagesOptions<T extends AnyTextableChannel | Uncach
|
|
|
789
800
|
}
|
|
790
801
|
|
|
791
802
|
export interface GetChannelMessagesIteratorOptions<T extends AnyTextableChannel | Uncached = AnyTextableChannel | Uncached> {
|
|
792
|
-
/** Get messages after this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base
|
|
803
|
+
/** Get messages after this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base.generateID | Base#generateID}. */
|
|
793
804
|
after?: string;
|
|
794
|
-
/** Get messages before this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base
|
|
805
|
+
/** Get messages before this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base.generateID | Base#generateID}. */
|
|
795
806
|
before?: string;
|
|
796
807
|
/** The maximum amount of messages to get. Defaults to 100. Use Infinity if you wish to get as many messages as possible. */
|
|
797
808
|
limit?: number;
|
|
@@ -838,6 +849,7 @@ export interface RawInvite {
|
|
|
838
849
|
channel_id?: string;
|
|
839
850
|
code: string;
|
|
840
851
|
expires_at?: string;
|
|
852
|
+
flags?: number;
|
|
841
853
|
guild?: RawInviteGuild;
|
|
842
854
|
guild_scheduled_event?: RawScheduledEvent;
|
|
843
855
|
inviter?: RawUser;
|
|
@@ -919,12 +931,12 @@ export interface StartThreadWithoutMessageOptions extends StartThreadFromMessage
|
|
|
919
931
|
type: ThreadChannels;
|
|
920
932
|
}
|
|
921
933
|
|
|
922
|
-
export interface
|
|
934
|
+
export interface StartThreadInThreadOnlyChannelOptions extends StartThreadFromMessageOptions {
|
|
923
935
|
/** The message to start the thread with. */
|
|
924
|
-
message:
|
|
936
|
+
message: ThreadOnlyChannelThreadStarterMessageOptions;
|
|
925
937
|
}
|
|
926
938
|
|
|
927
|
-
export type
|
|
939
|
+
export type ThreadOnlyChannelThreadStarterMessageOptions = Pick<CreateMessageOptions, "content" | "embeds" | "allowedMentions" | "components" | "stickerIDs" | "attachments" | "flags" | "files">;
|
|
928
940
|
|
|
929
941
|
export interface GetArchivedThreadsOptions {
|
|
930
942
|
/** A **timestamp** to get threads before. */
|
|
@@ -1045,3 +1057,17 @@ export interface PurgeOptions<T extends AnyTextableGuildChannel | Uncached> {
|
|
|
1045
1057
|
}
|
|
1046
1058
|
|
|
1047
1059
|
export type ThreadParentChannel = TextChannel | AnnouncementChannel | ForumChannel;
|
|
1060
|
+
|
|
1061
|
+
export interface RawRoleSubscriptionData {
|
|
1062
|
+
is_renewal: boolean;
|
|
1063
|
+
role_subscription_listing_id: string;
|
|
1064
|
+
tier_name: string;
|
|
1065
|
+
total_months_subscribed: number;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
export interface RoleSubscriptionData {
|
|
1069
|
+
isRenewal: boolean;
|
|
1070
|
+
roleSubscriptionListingID: string;
|
|
1071
|
+
tierName: string;
|
|
1072
|
+
totalMonthsSubscribed: number;
|
|
1073
|
+
}
|
|
@@ -119,23 +119,24 @@ export interface CollectionLimitsOptions {
|
|
|
119
119
|
*/
|
|
120
120
|
autoModerationRules?: number | Record<string, number>;
|
|
121
121
|
/**
|
|
122
|
-
* The maximum number of
|
|
123
|
-
* @dictionaryKey
|
|
122
|
+
* The maximum number of guild channels to cache.
|
|
123
|
+
* @dictionaryKey guild id
|
|
124
124
|
* @defaultValue Infinity
|
|
125
125
|
*/
|
|
126
|
-
|
|
126
|
+
channels?: number | Record<string, number>;
|
|
127
127
|
/**
|
|
128
|
-
* The maximum number of guild
|
|
128
|
+
* The maximum number of guild emojis to cache.
|
|
129
|
+
* @dictionaryKey guild id
|
|
129
130
|
* @defaultValue Infinity
|
|
130
131
|
*/
|
|
131
|
-
|
|
132
|
+
emojis?: number | Record<string, number>;
|
|
132
133
|
/**
|
|
133
134
|
* The maximum number of group channels to cache.
|
|
134
135
|
* @defaultValue 10
|
|
135
136
|
*/
|
|
136
137
|
groupChannels?: number;
|
|
137
138
|
/**
|
|
138
|
-
* The maximum number of threads to cache per guild.
|
|
139
|
+
* The maximum number of threads to cache per guild. Setting this too low might cause channels to have missing threads, as they all pull from the guild.
|
|
139
140
|
* @dictionaryKey guild id
|
|
140
141
|
* @defaultValue Infinity
|
|
141
142
|
*/
|
|
@@ -152,10 +153,17 @@ export interface CollectionLimitsOptions {
|
|
|
152
153
|
* @defaultValue Infinity
|
|
153
154
|
*/
|
|
154
155
|
integrations?: number | Record<string, number>;
|
|
156
|
+
/**
|
|
157
|
+
* The maximum number of guild invites to cache.
|
|
158
|
+
* @dictionaryKey guild id
|
|
159
|
+
* @defaultValue Infinity
|
|
160
|
+
*/
|
|
161
|
+
invites?: number | Record<string, number>;
|
|
155
162
|
/**
|
|
156
163
|
* The maximum number of members to cache.
|
|
157
164
|
*
|
|
158
165
|
* Note: If you request members from the gateway, this will be increased (on the specific guild) as needed to accommodate those members.
|
|
166
|
+
* @dictionaryKey guild id
|
|
159
167
|
* @defaultValue Infinity
|
|
160
168
|
*/
|
|
161
169
|
members?: number | Record<string, number>;
|
|
@@ -188,6 +196,12 @@ export interface CollectionLimitsOptions {
|
|
|
188
196
|
* @defaultValue Infinity
|
|
189
197
|
*/
|
|
190
198
|
stageInstances?: number | Record<string, number>;
|
|
199
|
+
/**
|
|
200
|
+
* The maximum number of guild stickers to cache.
|
|
201
|
+
* @dictionaryKey guild id
|
|
202
|
+
* @defaultValue Infinity
|
|
203
|
+
*/
|
|
204
|
+
stickers?: number | Record<string, number>;
|
|
191
205
|
/**
|
|
192
206
|
* The maximum number of unavailable guilds to cache.
|
|
193
207
|
* @defaultValue Infinity
|
|
@@ -21,7 +21,7 @@ import type {
|
|
|
21
21
|
JSONAnnouncementThreadChannel,
|
|
22
22
|
JSONAutoModerationRule,
|
|
23
23
|
JSONCategoryChannel,
|
|
24
|
-
|
|
24
|
+
JSONThreadOnlyChannel,
|
|
25
25
|
JSONGuild,
|
|
26
26
|
JSONIntegration,
|
|
27
27
|
JSONMember,
|
|
@@ -89,7 +89,7 @@ export interface ClientEvents {
|
|
|
89
89
|
/** @event Emitted when a channel's pins are updated (message pinned, message unpinned). Requires the `GUILDS` intent for guild channels, and `DIRECT_MESSAGES` for direct messages. */
|
|
90
90
|
channelPinsUpdate: [channel: AnyTextableChannel | Uncached, timestamp: Date | null];
|
|
91
91
|
/** @event Emitted when a channel is updated. Requires the `GUILDS` intent. */
|
|
92
|
-
channelUpdate: [channel: TextChannel, oldChannel: JSONTextChannel | null] | [channel: VoiceChannel, oldChannel: JSONVoiceChannel | null] | [channel: CategoryChannel, oldChannel: JSONCategoryChannel | null] | [channel: AnnouncementChannel, oldChannel: JSONAnnouncementChannel | null] | [channel: StageChannel, oldChannel: JSONStageChannel | null] | [channel: ForumChannel, oldChannel:
|
|
92
|
+
channelUpdate: [channel: TextChannel, oldChannel: JSONTextChannel | null] | [channel: VoiceChannel, oldChannel: JSONVoiceChannel | null] | [channel: CategoryChannel, oldChannel: JSONCategoryChannel | null] | [channel: AnnouncementChannel, oldChannel: JSONAnnouncementChannel | null] | [channel: StageChannel, oldChannel: JSONStageChannel | null] | [channel: ForumChannel, oldChannel: JSONThreadOnlyChannel | null];
|
|
93
93
|
/** @event Emitted when a shard connects. */
|
|
94
94
|
connect: [id: number];
|
|
95
95
|
/** @event Emitted with various information for debugging. */
|
|
@@ -107,7 +107,7 @@ interface GatewayOptions {
|
|
|
107
107
|
*/
|
|
108
108
|
reconnectDelay?: ReconnectDelayFunction;
|
|
109
109
|
/**
|
|
110
|
-
* If a check should be made before connecting, which will remove any disallowed intents. This requires making a request to {@link Miscellaneous
|
|
110
|
+
* If a check should be made before connecting, which will remove any disallowed intents. This requires making a request to {@link REST/Miscellaneous.getApplication | `/applications/@me`}. Any removed intents will be emitted via the `warn` event.
|
|
111
111
|
* @defaultValue false
|
|
112
112
|
*/
|
|
113
113
|
removeDisallowedIntents?: boolean;
|
|
@@ -58,7 +58,7 @@ export interface RawGuild {
|
|
|
58
58
|
icon: string | null;
|
|
59
59
|
icon_hash?: string | null;
|
|
60
60
|
id: string;
|
|
61
|
-
joined_at: string;
|
|
61
|
+
joined_at: string | null;
|
|
62
62
|
large: boolean;
|
|
63
63
|
latest_onboarding_question_id?: string | null;
|
|
64
64
|
max_members?: number;
|
|
@@ -610,9 +610,11 @@ export interface WidgetUser {
|
|
|
610
610
|
};
|
|
611
611
|
avatar: null;
|
|
612
612
|
avatarURL: string;
|
|
613
|
+
/** Always "0000" */
|
|
613
614
|
discriminator: string;
|
|
614
615
|
id: string;
|
|
615
616
|
status: "online" | "idle" | "dnd";
|
|
617
|
+
/** @deprecated Use `username` */
|
|
616
618
|
tag: string;
|
|
617
619
|
username: string;
|
|
618
620
|
}
|
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
ApplicationCommandOptionTypes,
|
|
18
18
|
ApplicationCommandTypes,
|
|
19
19
|
ComponentTypes,
|
|
20
|
+
GuildFeature,
|
|
20
21
|
InteractionResponseTypes,
|
|
21
22
|
InteractionTypes,
|
|
22
23
|
MessageComponentTypes,
|
|
@@ -36,6 +37,9 @@ import type InteractionOptionsWrapper from "../util/InteractionOptionsWrapper";
|
|
|
36
37
|
import type TypedCollection from "../util/TypedCollection";
|
|
37
38
|
import type InteractionResolvedChannel from "../structures/InteractionResolvedChannel";
|
|
38
39
|
import type SelectMenuValuesWrapper from "../util/SelectMenuValuesWrapper";
|
|
40
|
+
import type Interaction from "../structures/Interaction";
|
|
41
|
+
import type Guild from "../structures/Guild";
|
|
42
|
+
import type Permission from "../structures/Permission";
|
|
39
43
|
|
|
40
44
|
export interface InteractionContent extends Pick<ExecuteWebhookOptions, "tts" | "content" | "embeds" | "allowedMentions" | "flags" | "components" | "attachments" | "files"> {}
|
|
41
45
|
export interface InitialInteractionContent extends Omit<InteractionContent, "attachments" | "files"> {}
|
|
@@ -71,7 +75,7 @@ export interface ModalInteractionResponse {
|
|
|
71
75
|
|
|
72
76
|
|
|
73
77
|
export interface ModalData {
|
|
74
|
-
/** The components of the modal. Each component needs its own row. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util
|
|
78
|
+
/** The components of the modal. Each component needs its own row. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util.rawModalComponents | Util#rawModalComponents}. */
|
|
75
79
|
components: Array<ModalActionRow>;
|
|
76
80
|
/** The custom ID of the modal. */
|
|
77
81
|
customID: string;
|
|
@@ -84,6 +88,7 @@ export interface RawInteraction {
|
|
|
84
88
|
application_id: string;
|
|
85
89
|
channel_id?: string;
|
|
86
90
|
data?: RawInteractionData;
|
|
91
|
+
guild?: InteractionGuild;
|
|
87
92
|
guild_id?: string;
|
|
88
93
|
guild_locale?: string;
|
|
89
94
|
id: string;
|
|
@@ -136,10 +141,10 @@ export interface RawMessageComponentInteractionResolvedData {
|
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
export interface MessageComponentInteractionResolvedData {
|
|
139
|
-
channels: TypedCollection<
|
|
140
|
-
members: TypedCollection<
|
|
141
|
-
roles: TypedCollection<
|
|
142
|
-
users: TypedCollection<
|
|
144
|
+
channels: TypedCollection<RawInteractionResolvedChannel, InteractionResolvedChannel>;
|
|
145
|
+
members: TypedCollection<RawMember, Member, [guildID: string]>;
|
|
146
|
+
roles: TypedCollection<RawRole, Role, [guildID: string]>;
|
|
147
|
+
users: TypedCollection<RawUser, User>;
|
|
143
148
|
}
|
|
144
149
|
|
|
145
150
|
export interface RawMessageComponentInteractionData {
|
|
@@ -182,12 +187,12 @@ export interface RawApplicationCommandInteractionResolvedData {
|
|
|
182
187
|
}
|
|
183
188
|
|
|
184
189
|
export interface ApplicationCommandInteractionResolvedData {
|
|
185
|
-
attachments: TypedCollection<
|
|
186
|
-
channels: TypedCollection<
|
|
187
|
-
members: TypedCollection<
|
|
188
|
-
messages: TypedCollection<
|
|
189
|
-
roles: TypedCollection<
|
|
190
|
-
users: TypedCollection<
|
|
190
|
+
attachments: TypedCollection<RawAttachment, Attachment>;
|
|
191
|
+
channels: TypedCollection<RawInteractionResolvedChannel, InteractionResolvedChannel>;
|
|
192
|
+
members: TypedCollection<RawMember, Member, [guildID: string]>;
|
|
193
|
+
messages: TypedCollection<RawMessage, Message>;
|
|
194
|
+
roles: TypedCollection<RawRole, Role, [guildID: string]>;
|
|
195
|
+
users: TypedCollection<RawUser, User>;
|
|
191
196
|
}
|
|
192
197
|
|
|
193
198
|
export type InteractionOptions = InteractionOptionsWithOptions | InteractionOptionsWithValue;
|
|
@@ -251,29 +256,56 @@ export interface AutocompleteChoice {
|
|
|
251
256
|
value: string;
|
|
252
257
|
}
|
|
253
258
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
type Guildify<T extends Interaction> = Omit<T, "appPermissions" | "guild" | "guildID" | "guildLocale" | "guildPartial" | "member" | "memberPermissions"> & {
|
|
260
|
+
appPermissions: Permission;
|
|
261
|
+
guild: Guild;
|
|
262
|
+
guildID: string;
|
|
263
|
+
guildLocale: string;
|
|
264
|
+
guildPartial: InteractionGuild;
|
|
265
|
+
member: Member;
|
|
266
|
+
memberPermissions: Permission;
|
|
267
|
+
};
|
|
268
|
+
type Privatify<T extends Interaction> = Omit<T, "appPermissions" | "guild" | "guildID" | "guildLocale" | "guildPartial" | "member" | "memberPermissions"> & {
|
|
269
|
+
appPermissions: undefined;
|
|
270
|
+
guild: undefined;
|
|
271
|
+
guildID: undefined;
|
|
272
|
+
guildLocale: undefined;
|
|
273
|
+
guildPartial: undefined;
|
|
274
|
+
member: undefined;
|
|
275
|
+
memberPermissions: undefined;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export interface GuildAutocompleteInteraction extends Guildify<AutocompleteInteraction<AnyTextableGuildChannel>> {}
|
|
279
|
+
export interface PrivateAutocompleteInteraction extends Privatify<AutocompleteInteraction<AnyPrivateChannel | Uncached>> {}
|
|
257
280
|
export type AnyAutocompleteInteraction = GuildAutocompleteInteraction | PrivateAutocompleteInteraction;
|
|
258
281
|
|
|
259
|
-
export
|
|
260
|
-
export interface PrivateCommandInteraction extends CommandInteraction<AnyPrivateChannel | Uncached
|
|
282
|
+
export interface GuildCommandInteraction extends Guildify<CommandInteraction<AnyTextableGuildChannel>> {}
|
|
283
|
+
export interface PrivateCommandInteraction extends Privatify<CommandInteraction<AnyPrivateChannel | Uncached>> {}
|
|
261
284
|
export type AnyCommandInteraction = GuildCommandInteraction | PrivateCommandInteraction;
|
|
262
285
|
|
|
263
|
-
export interface GuildComponentButtonInteraction extends ComponentInteraction<ComponentTypes.BUTTON, AnyTextableGuildChannel
|
|
264
|
-
export interface GuildComponentSelectMenuInteraction extends ComponentInteraction<SelectMenuTypes, AnyTextableGuildChannel
|
|
286
|
+
export interface GuildComponentButtonInteraction extends Guildify<ComponentInteraction<ComponentTypes.BUTTON, AnyTextableGuildChannel>> {}
|
|
287
|
+
export interface GuildComponentSelectMenuInteraction extends Guildify<ComponentInteraction<SelectMenuTypes, AnyTextableGuildChannel>> {}
|
|
265
288
|
export type GuildComponentInteraction = GuildComponentButtonInteraction | GuildComponentSelectMenuInteraction;
|
|
266
289
|
|
|
267
|
-
export interface PrivateComponentButtonInteraction extends ComponentInteraction<ComponentTypes.BUTTON, AnyPrivateChannel | Uncached
|
|
268
|
-
export interface PrivateComponentSelectMenuInteraction extends ComponentInteraction<SelectMenuTypes, AnyPrivateChannel | Uncached
|
|
290
|
+
export interface PrivateComponentButtonInteraction extends Privatify<ComponentInteraction<ComponentTypes.BUTTON, AnyPrivateChannel | Uncached>> {}
|
|
291
|
+
export interface PrivateComponentSelectMenuInteraction extends Privatify<ComponentInteraction<SelectMenuTypes, AnyPrivateChannel | Uncached>> {}
|
|
269
292
|
export type PrivateComponentInteraction = PrivateComponentButtonInteraction | PrivateComponentSelectMenuInteraction;
|
|
270
293
|
export type AnyComponentButtonInteraction = GuildComponentButtonInteraction | PrivateComponentButtonInteraction;
|
|
271
294
|
export type AnyComponentSelectMenuInteraction = GuildComponentSelectMenuInteraction | PrivateComponentSelectMenuInteraction;
|
|
272
295
|
export type AnyComponentInteraction = AnyComponentButtonInteraction | AnyComponentSelectMenuInteraction;
|
|
273
296
|
|
|
274
|
-
export
|
|
275
|
-
export interface PrivateModalSubmitInteraction extends ModalSubmitInteraction<AnyPrivateChannel | Uncached
|
|
297
|
+
export interface GuildModalSubmitInteraction extends Guildify<ModalSubmitInteraction<AnyTextableGuildChannel>> {}
|
|
298
|
+
export interface PrivateModalSubmitInteraction extends Privatify<ModalSubmitInteraction<AnyPrivateChannel | Uncached>> {}
|
|
276
299
|
export type AnyModalSubmitInteraction = GuildModalSubmitInteraction | PrivateModalSubmitInteraction;
|
|
277
300
|
|
|
278
301
|
export type SubCommandArray = [subcommand: string] | [subcommandGroup: string, subcommand: string];
|
|
279
302
|
export type AutoCompleteFocusedOption = InteractionOptionsString | InteractionOptionsNumber | InteractionOptionsInteger;
|
|
303
|
+
|
|
304
|
+
export interface InteractionGuild {
|
|
305
|
+
features: Array<GuildFeature>;
|
|
306
|
+
id: string;
|
|
307
|
+
locale: string;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export type AnyGuildInteraction = GuildAutocompleteInteraction | GuildCommandInteraction | GuildComponentInteraction | GuildModalSubmitInteraction;
|
|
311
|
+
export type AnyPrivateInteraction = PrivateAutocompleteInteraction | PrivateCommandInteraction | PrivateComponentInteraction | PrivateModalSubmitInteraction;
|
package/dist/lib/types/json.d.ts
CHANGED
|
@@ -36,7 +36,8 @@ import type {
|
|
|
36
36
|
GuildChannels,
|
|
37
37
|
TextableGuildChannels,
|
|
38
38
|
ThreadChannels,
|
|
39
|
-
VoiceChannels
|
|
39
|
+
VoiceChannels,
|
|
40
|
+
ThreadOnlyChannels
|
|
40
41
|
} from "./channels";
|
|
41
42
|
import type { ScheduledEventEntityMetadata } from "./scheduled-events";
|
|
42
43
|
import type {
|
|
@@ -212,21 +213,8 @@ export interface JSONExtendedUser extends JSONUser {
|
|
|
212
213
|
mfaEnabled: boolean;
|
|
213
214
|
verified: boolean;
|
|
214
215
|
}
|
|
215
|
-
export interface JSONForumChannel extends
|
|
216
|
-
|
|
217
|
-
defaultAutoArchiveDuration: ThreadAutoArchiveDuration;
|
|
218
|
-
defaultForumLayout: ForumLayoutTypes;
|
|
219
|
-
defaultReactionEmoji: ForumEmoji | null;
|
|
220
|
-
defaultSortOrder: SortOrderTypes | null;
|
|
221
|
-
defaultThreadRateLimitPerUser: number;
|
|
222
|
-
flags: number;
|
|
223
|
-
lastThreadID: string | null;
|
|
224
|
-
permissionOverwrites: Array<JSONPermissionOverwrite>;
|
|
225
|
-
position: number;
|
|
226
|
-
rateLimitPerUser: number;
|
|
227
|
-
template: string;
|
|
228
|
-
threads: Array<string>;
|
|
229
|
-
topic: string | null;
|
|
216
|
+
export interface JSONForumChannel extends JSONThreadOnlyChannel {
|
|
217
|
+
type: ChannelTypes.GUILD_FORUM;
|
|
230
218
|
}
|
|
231
219
|
export interface JSONGroupChannel extends JSONChannel {
|
|
232
220
|
applicationID: string;
|
|
@@ -379,6 +367,9 @@ export interface JSONInviteGuild extends JSONBase {
|
|
|
379
367
|
vanityURLCode: string | null;
|
|
380
368
|
verificationLevel: VerificationLevels;
|
|
381
369
|
}
|
|
370
|
+
export interface JSONMediaChannel extends JSONThreadOnlyChannel {
|
|
371
|
+
type: ChannelTypes.GUILD_MEDIA;
|
|
372
|
+
}
|
|
382
373
|
export interface JSONMember extends JSONBase {
|
|
383
374
|
avatar: string | null;
|
|
384
375
|
communicationDisabledUntil: number | null;
|
|
@@ -599,6 +590,22 @@ export interface JSONThreadChannel extends JSONGuildChannel {
|
|
|
599
590
|
totalMessageSent: number;
|
|
600
591
|
type: ThreadChannels;
|
|
601
592
|
}
|
|
593
|
+
export interface JSONThreadOnlyChannel extends JSONGuildChannel {
|
|
594
|
+
availableTags: Array<ForumTag>;
|
|
595
|
+
defaultAutoArchiveDuration: ThreadAutoArchiveDuration;
|
|
596
|
+
defaultForumLayout: ForumLayoutTypes;
|
|
597
|
+
defaultReactionEmoji: ForumEmoji | null;
|
|
598
|
+
defaultSortOrder: SortOrderTypes | null;
|
|
599
|
+
defaultThreadRateLimitPerUser: number;
|
|
600
|
+
flags: number;
|
|
601
|
+
lastThreadID: string | null;
|
|
602
|
+
permissionOverwrites: Array<JSONPermissionOverwrite>;
|
|
603
|
+
position: number;
|
|
604
|
+
rateLimitPerUser: number;
|
|
605
|
+
threads: Array<string>;
|
|
606
|
+
topic: string | null;
|
|
607
|
+
type: ThreadOnlyChannels;
|
|
608
|
+
}
|
|
602
609
|
export interface JSONUnavailableGuild extends JSONBase {
|
|
603
610
|
unavailable: true;
|
|
604
611
|
}
|
package/dist/lib/types/misc.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
/** @module Types/Miscellaneous */
|
|
3
3
|
|
|
4
|
+
import type Client from "../Client";
|
|
5
|
+
|
|
4
6
|
export type StringMap<T extends Record<string, any>> = { [K in keyof T]: `${T[K]}` };
|
|
5
7
|
export type ReverseMap<T extends Record<keyof T, keyof any>> = {
|
|
6
8
|
[P in T[keyof T]]: {
|
|
7
9
|
[K in keyof T]: T[K] extends P ? K : never
|
|
8
10
|
}[keyof T]
|
|
9
11
|
};
|
|
12
|
+
export type AnyClass<T, I, E extends Array<unknown>> = new(data: T, client: Client, ...extra: E) => I;
|
|
@@ -23,6 +23,8 @@ export interface RequestOptions {
|
|
|
23
23
|
export interface File {
|
|
24
24
|
/** the contents of the file */
|
|
25
25
|
contents: Buffer;
|
|
26
|
+
/** The index to use when uploading the file. You can use this to reference this specific file from `attachments`.w */
|
|
27
|
+
index?: number;
|
|
26
28
|
/** the name of the file */
|
|
27
29
|
name: string;
|
|
28
30
|
}
|
|
@@ -11,7 +11,7 @@ export declare class UncachedError extends Error {
|
|
|
11
11
|
name: string;
|
|
12
12
|
constructor(...args: [message: string] | [clazz: object, property: string, intent: IntentNames, client?: Client]);
|
|
13
13
|
}
|
|
14
|
-
/** An error encountered within {@link InteractionOptionsWrapper
|
|
14
|
+
/** An error encountered within {@link InteractionOptionsWrapper | InteractionOptionsWrapper} & {@link SelectMenuValuesWrapper | SelectMenuValuesWrapper}. */
|
|
15
15
|
export declare class WrapperError extends Error {
|
|
16
16
|
name: string;
|
|
17
17
|
constructor(message: string);
|
package/dist/lib/util/Errors.js
CHANGED
|
@@ -27,7 +27,7 @@ class UncachedError extends Error {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
exports.UncachedError = UncachedError;
|
|
30
|
-
/** An error encountered within {@link InteractionOptionsWrapper
|
|
30
|
+
/** An error encountered within {@link InteractionOptionsWrapper | InteractionOptionsWrapper} & {@link SelectMenuValuesWrapper | SelectMenuValuesWrapper}. */
|
|
31
31
|
class WrapperError extends Error {
|
|
32
32
|
name = "WrapperError";
|
|
33
33
|
constructor(message) {
|
|
@@ -53,4 +53,4 @@ class GatewayError extends Error {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
exports.default = GatewayError;
|
|
56
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3V0aWwvRXJyb3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxxQkFBcUI7OztBQU1yQixnR0FBZ0c7QUFDaEcsTUFBYSxhQUFjLFNBQVEsS0FBSztJQUMzQixJQUFJLEdBQUcsZUFBZSxDQUFDO0lBQ2hDLFlBQVksS0FBcUI7UUFDN0IsS0FBSyxDQUFDLHdCQUF3QixFQUFFLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRSxDQUFDLENBQUM7SUFDdEQsQ0FBQztDQUNKO0FBTEQsc0NBS0M7QUFFRCxzRUFBc0U7QUFDdEUsTUFBYSxhQUFjLFNBQVEsS0FBSztJQUMzQixJQUFJLEdBQUcsZUFBZSxDQUFDO0lBQ2hDLDRGQUE0RjtJQUM1RixZQUFZLEdBQUcsSUFBaUc7UUFDNUcsSUFBSSxPQUFlLENBQUM7UUFDcEIsSUFBSSxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRTtZQUNuQixDQUFDLE9BQU8sQ0FBQyxHQUFHLElBQUksQ0FBQztTQUNwQjthQUFNO1lBQ0gsTUFBTSxDQUFDLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSxFQUFFLE1BQU0sQ0FBQyxHQUFHLElBQUksQ0FBQztZQUMvQyxPQUFPLEdBQUcsTUFBTSxJQUFJLE1BQU0sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxHQUFHLEtBQUssQ0FBQyxXQUFXLENBQUMsSUFBSSxJQUFJLFFBQVEsK0JBQStCLENBQUMsQ0FBQyxDQUFDLEdBQUcsS0FBSyxDQUFDLFdBQVcsQ0FBQyxJQUFJLElBQUksUUFBUSx5Q0FBeUMsTUFBTSxVQUFVLENBQUM7U0FDdk47UUFFRCxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDbkIsQ0FBQztDQUNKO0FBZEQsc0NBY0M7QUFFRCw2SkFBNko7QUFDN0osTUFBYSxZQUFhLFNBQVEsS0FBSztJQUMxQixJQUFJLEdBQUcsY0FBYyxDQUFDO0lBQy9CLFlBQVksT0FBZTtRQUN2QixLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDbkIsQ0FBQztDQUNKO0FBTEQsb0NBS0M7QUFFRCxnRUFBZ0U7QUFDaEUsTUFBYSxlQUFnQixTQUFRLEtBQUs7SUFDN0IsSUFBSSxHQUFHLGlCQUFpQixDQUFDO0lBQ2xDLFlBQVksT0FBZTtRQUN2QixLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDbkIsQ0FBQztDQUNKO0FBTEQsMENBS0M7QUFHRCx1QkFBdUI7QUFDdkIsTUFBcUIsWUFBYSxTQUFRLEtBQUs7SUFDM0MsSUFBSSxDQUFTO0lBQ0osSUFBSSxHQUFHLGNBQWMsQ0FBQztJQUMvQixZQUFZLE9BQWUsRUFBRSxJQUFZO1FBQ3JDLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUNmLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO0lBQ3JCLENBQUM7Q0FDSjtBQVBELCtCQU9DIn0=
|
|
@@ -90,12 +90,12 @@ export default class InteractionOptionsWrapper {
|
|
|
90
90
|
getMember(name: string, required?: false): Member | undefined;
|
|
91
91
|
getMember(name: string, required: true): Member;
|
|
92
92
|
/**
|
|
93
|
-
* Get a mentionable option value (
|
|
93
|
+
* Get a mentionable option value (user, role).
|
|
94
94
|
* @param name The name of the option.
|
|
95
95
|
* @param required If true, an error will be thrown if the option is not present, or if the value cannot be found.
|
|
96
96
|
*/
|
|
97
|
-
getMentionable<T extends
|
|
98
|
-
getMentionable<T extends
|
|
97
|
+
getMentionable<T extends User | Role = User | Role>(name: string, required?: false): T | undefined;
|
|
98
|
+
getMentionable<T extends User | Role = User | Role>(name: string, required: true): T;
|
|
99
99
|
/**
|
|
100
100
|
* Get a mentionable option.
|
|
101
101
|
* @param name The name of the option.
|