oceanic.js 1.7.1 → 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 +23 -16
- package/dist/lib/Constants.js +20 -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 +7 -2
- package/dist/lib/routes/ApplicationCommands.d.ts +16 -1
- package/dist/lib/routes/ApplicationCommands.js +18 -3
- package/dist/lib/routes/Channels.d.ts +76 -6
- package/dist/lib/routes/Channels.js +80 -13
- 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/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 +2 -2
- package/dist/lib/structures/CommandInteraction.js +2 -2
- package/dist/lib/structures/ComponentInteraction.d.ts +2 -2
- package/dist/lib/structures/ComponentInteraction.js +2 -2
- 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 +35 -31
- 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 +2 -2
- package/dist/lib/structures/ModalSubmitInteraction.js +2 -2
- 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 +2 -2
- package/dist/lib/structures/TextableChannel.js +1 -1
- 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 +57 -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 +2 -0
- package/dist/lib/types/interactions.d.ts +46 -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 -20
- package/esm.mjs +6 -0
- package/package.json +22 -20
- package/patches/typedoc-plugin-merge-modules@5.0.1.patch +26 -0
|
@@ -3,17 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
/** @module TextableChannel */
|
|
5
5
|
const TextableChannel_1 = tslib_1.__importDefault(require("./TextableChannel"));
|
|
6
|
-
const
|
|
6
|
+
const Collection_1 = tslib_1.__importDefault(require("../util/Collection"));
|
|
7
7
|
/** Represents a guild textable channel. */
|
|
8
8
|
class ThreadableChannel extends TextableChannel_1.default {
|
|
9
9
|
/** The default auto archive duration for threads created in this channel. */
|
|
10
10
|
defaultAutoArchiveDuration;
|
|
11
|
-
|
|
12
|
-
threads;
|
|
13
|
-
constructor(data, client, threadChannel) {
|
|
11
|
+
constructor(data, client) {
|
|
14
12
|
super(data, client);
|
|
15
13
|
this.defaultAutoArchiveDuration = data.default_auto_archive_duration;
|
|
16
|
-
this.threads = new TypedCollection_1.default(threadChannel, client, this.client.util._getLimit("channelThreads", this.id));
|
|
17
14
|
this.update(data);
|
|
18
15
|
}
|
|
19
16
|
update(data) {
|
|
@@ -22,6 +19,10 @@ class ThreadableChannel extends TextableChannel_1.default {
|
|
|
22
19
|
this.defaultAutoArchiveDuration = data.default_auto_archive_duration;
|
|
23
20
|
}
|
|
24
21
|
}
|
|
22
|
+
/** The threads in this channel. The returned collection is disposable. */
|
|
23
|
+
get threads() {
|
|
24
|
+
return new Collection_1.default(this.guild.threads.filter(thread => thread.parentID === this.id).map(thread => [thread.id, thread]));
|
|
25
|
+
}
|
|
25
26
|
/**
|
|
26
27
|
* Get the public archived threads in this channel.
|
|
27
28
|
* @param options The options for getting the public archived threads.
|
|
@@ -54,4 +55,4 @@ class ThreadableChannel extends TextableChannel_1.default {
|
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
exports.default = ThreadableChannel;
|
|
57
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
58
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGhyZWFkYWJsZUNoYW5uZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9saWIvc3RydWN0dXJlcy9UaHJlYWRhYmxlQ2hhbm5lbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw4QkFBOEI7QUFDOUIsZ0ZBQWdEO0FBY2hELDRFQUE0QztBQUU1QywyQ0FBMkM7QUFDM0MsTUFBcUIsaUJBQWdJLFNBQVEseUJBQW1CO0lBQzVLLDZFQUE2RTtJQUM3RSwwQkFBMEIsQ0FBNEI7SUFHdEQsWUFBWSxJQUE2QyxFQUFFLE1BQWM7UUFDckUsS0FBSyxDQUFDLElBQUksRUFBRSxNQUFNLENBQUMsQ0FBQztRQUNwQixJQUFJLENBQUMsMEJBQTBCLEdBQUcsSUFBSSxDQUFDLDZCQUE2QixDQUFDO1FBQ3JFLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDdEIsQ0FBQztJQUVrQixNQUFNLENBQUMsSUFBc0Q7UUFDNUUsS0FBSyxDQUFDLE1BQU0sQ0F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Q0FBQyxRQUFRLENBQUMseUJBQXlCLENBQUssSUFBSSxDQUFDLEVBQUUsRUFBRSxPQUFPLENBQUMsQ0FBQztJQUNyRixDQUFDO0lBR1EsTUFBTTtRQUNYLE9BQU87WUFDSCxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUU7WUFDakIsMEJBQTBCLEVBQUUsSUFBSSxDQUFDLDBCQUEwQjtZQUMzRCxPQUFPLEVBQXFCLElBQUksQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQztZQUNqRSxJQUFJLEVBQXdCLElBQUksQ0FBQyxJQUFJO1NBQ3hDLENBQUM7SUFDTixDQUFDO0NBQ0o7QUF6REQsb0NBeURDIn0=
|
|
@@ -29,12 +29,13 @@ export default class User extends Base {
|
|
|
29
29
|
username: string;
|
|
30
30
|
constructor(data: RawUser, client: Client);
|
|
31
31
|
protected update(data: Partial<RawUser>): void;
|
|
32
|
-
private get isMigrated();
|
|
33
32
|
/** The default avatar value of this user. */
|
|
34
33
|
get defaultAvatar(): number;
|
|
34
|
+
/** If this user has migrated to the new username system. */
|
|
35
|
+
get isMigrated(): boolean;
|
|
35
36
|
/** A string that will mention this user. */
|
|
36
37
|
get mention(): string;
|
|
37
|
-
/** This user's
|
|
38
|
+
/** This user's unique username, if migrated, else a combination of the user's username and discriminator. */
|
|
38
39
|
get tag(): string;
|
|
39
40
|
/**
|
|
40
41
|
* The url of this user's avatar decoration. This will always be a png.
|
|
@@ -49,6 +50,12 @@ export default class User extends Base {
|
|
|
49
50
|
* @param size The dimensions of the image.
|
|
50
51
|
*/
|
|
51
52
|
avatarURL(format?: ImageFormat, size?: number): string;
|
|
53
|
+
/**
|
|
54
|
+
* The url of this user's banner.
|
|
55
|
+
* @param format The format the url should be.
|
|
56
|
+
* @param size The dimensions of the image.
|
|
57
|
+
*/
|
|
58
|
+
bannerURL(format?: ImageFormat, size?: number): string | null;
|
|
52
59
|
/**
|
|
53
60
|
* Create a direct message with this user.
|
|
54
61
|
*/
|
|
@@ -63,9 +63,6 @@ class User extends Base_1.default {
|
|
|
63
63
|
this.username = data.username;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
get isMigrated() {
|
|
67
|
-
return this.globalName !== null && (this.discriminator === undefined || this.discriminator === "0");
|
|
68
|
-
}
|
|
69
66
|
/** The default avatar value of this user. */
|
|
70
67
|
get defaultAvatar() {
|
|
71
68
|
if (this.isMigrated) {
|
|
@@ -73,14 +70,18 @@ class User extends Base_1.default {
|
|
|
73
70
|
}
|
|
74
71
|
return Number(this.discriminator) % 5;
|
|
75
72
|
}
|
|
73
|
+
/** If this user has migrated to the new username system. */
|
|
74
|
+
get isMigrated() {
|
|
75
|
+
return (this.discriminator === undefined || this.discriminator === "0");
|
|
76
|
+
}
|
|
76
77
|
/** A string that will mention this user. */
|
|
77
78
|
get mention() {
|
|
78
79
|
return `<@${this.id}>`;
|
|
79
80
|
}
|
|
80
|
-
/** This user's
|
|
81
|
+
/** This user's unique username, if migrated, else a combination of the user's username and discriminator. */
|
|
81
82
|
get tag() {
|
|
82
83
|
if (this.isMigrated) {
|
|
83
|
-
return this.
|
|
84
|
+
return this.username;
|
|
84
85
|
}
|
|
85
86
|
return `${this.username}#${this.discriminator}`;
|
|
86
87
|
}
|
|
@@ -101,6 +102,14 @@ class User extends Base_1.default {
|
|
|
101
102
|
avatarURL(format, size) {
|
|
102
103
|
return this.avatar === null ? this.defaultAvatarURL() : this.client.util.formatImage(Routes.USER_AVATAR(this.id, this.avatar), format, size);
|
|
103
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* The url of this user's banner.
|
|
107
|
+
* @param format The format the url should be.
|
|
108
|
+
* @param size The dimensions of the image.
|
|
109
|
+
*/
|
|
110
|
+
bannerURL(format, size) {
|
|
111
|
+
return this.banner ? this.client.util.formatImage(Routes.BANNER(this.id, this.banner), format, size) : null;
|
|
112
|
+
}
|
|
104
113
|
/**
|
|
105
114
|
* Create a direct message with this user.
|
|
106
115
|
*/
|
|
@@ -129,4 +138,4 @@ class User extends Base_1.default {
|
|
|
129
138
|
}
|
|
130
139
|
}
|
|
131
140
|
exports.default = User;
|
|
132
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
141
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVXNlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9zdHJ1Y3R1cmVzL1VzZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsbUJBQW1CO0FBQ25CLDBEQUEwQjtBQUcxQiwrREFBeUM7QUFLekMseUJBQXlCO0FBQ3pCLE1BQXFCLElBQUssU0FBUSxjQUFJO0lBQ2xDLHdHQUF3RztJQUN4RyxXQUFXLENBQWlCO0lBQzVCLDhCQUE4QjtJQUM5QixNQUFNLENBQWdCO0lBQ3RCLG9GQUFvRjtJQUNwRixnQkFBZ0IsQ0FBaUI7SUFDakMsdUdBQXVHO0lBQ3ZHLE1BQU0sQ0FBaUI7SUFDdkIsNkJBQTZCO0lBQzdCLEdBQUcsQ0FBVTtJQUNiLHVIQUF1SDtJQUN2SCxhQUFhLENBQVM7SUFDdEIsdUNBQXVDO0lBQ3ZDLFVBQVUsQ0FBZ0I7SUFDMUIsNEdBQTRHO0lBQzVHLFdBQVcsQ0FBUztJQUNwQix1REFBdUQ7SUFDdkQsTUFBTSxDQUFVO0lBQ2hCLDJCQUEyQjtJQUMzQixRQUFRLENBQVM7SUFDakIsWUFBWSxJQUFhLEVBQUUsTUFBYztRQUNyQyxLQUFLLENBQUMsSUFBSSxDQUFDLEVBQUUsRUFBRSxNQUFNLENBQUMsQ0FBQztRQUN2QixJQUFJLENBQUMsTUFBTSxHQUFHLElBQUksQ0FBQztRQUNuQixJQUFJLENBQUMsR0FBRyxHQUFHLENBQUMsQ0FBQyxJQUF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outThreadsTypes,
|
|
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;
|
|
@@ -920,12 +931,12 @@ export interface StartThreadWithoutMessageOptions extends StartThreadFromMessage
|
|
|
920
931
|
type: ThreadChannels;
|
|
921
932
|
}
|
|
922
933
|
|
|
923
|
-
export interface
|
|
934
|
+
export interface StartThreadInThreadOnlyChannelOptions extends StartThreadFromMessageOptions {
|
|
924
935
|
/** The message to start the thread with. */
|
|
925
|
-
message:
|
|
936
|
+
message: ThreadOnlyChannelThreadStarterMessageOptions;
|
|
926
937
|
}
|
|
927
938
|
|
|
928
|
-
export type
|
|
939
|
+
export type ThreadOnlyChannelThreadStarterMessageOptions = Pick<CreateMessageOptions, "content" | "embeds" | "allowedMentions" | "components" | "stickerIDs" | "attachments" | "flags" | "files">;
|
|
929
940
|
|
|
930
941
|
export interface GetArchivedThreadsOptions {
|
|
931
942
|
/** A **timestamp** to get threads before. */
|
|
@@ -1046,3 +1057,17 @@ export interface PurgeOptions<T extends AnyTextableGuildChannel | Uncached> {
|
|
|
1046
1057
|
}
|
|
1047
1058
|
|
|
1048
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;
|
|
@@ -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
|
}
|
|
@@ -37,6 +37,9 @@ import type InteractionOptionsWrapper from "../util/InteractionOptionsWrapper";
|
|
|
37
37
|
import type TypedCollection from "../util/TypedCollection";
|
|
38
38
|
import type InteractionResolvedChannel from "../structures/InteractionResolvedChannel";
|
|
39
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";
|
|
40
43
|
|
|
41
44
|
export interface InteractionContent extends Pick<ExecuteWebhookOptions, "tts" | "content" | "embeds" | "allowedMentions" | "flags" | "components" | "attachments" | "files"> {}
|
|
42
45
|
export interface InitialInteractionContent extends Omit<InteractionContent, "attachments" | "files"> {}
|
|
@@ -72,7 +75,7 @@ export interface ModalInteractionResponse {
|
|
|
72
75
|
|
|
73
76
|
|
|
74
77
|
export interface ModalData {
|
|
75
|
-
/** 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}. */
|
|
76
79
|
components: Array<ModalActionRow>;
|
|
77
80
|
/** The custom ID of the modal. */
|
|
78
81
|
customID: string;
|
|
@@ -138,10 +141,10 @@ export interface RawMessageComponentInteractionResolvedData {
|
|
|
138
141
|
}
|
|
139
142
|
|
|
140
143
|
export interface MessageComponentInteractionResolvedData {
|
|
141
|
-
channels: TypedCollection<
|
|
142
|
-
members: TypedCollection<
|
|
143
|
-
roles: TypedCollection<
|
|
144
|
-
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>;
|
|
145
148
|
}
|
|
146
149
|
|
|
147
150
|
export interface RawMessageComponentInteractionData {
|
|
@@ -184,12 +187,12 @@ export interface RawApplicationCommandInteractionResolvedData {
|
|
|
184
187
|
}
|
|
185
188
|
|
|
186
189
|
export interface ApplicationCommandInteractionResolvedData {
|
|
187
|
-
attachments: TypedCollection<
|
|
188
|
-
channels: TypedCollection<
|
|
189
|
-
members: TypedCollection<
|
|
190
|
-
messages: TypedCollection<
|
|
191
|
-
roles: TypedCollection<
|
|
192
|
-
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>;
|
|
193
196
|
}
|
|
194
197
|
|
|
195
198
|
export type InteractionOptions = InteractionOptionsWithOptions | InteractionOptionsWithValue;
|
|
@@ -253,28 +256,46 @@ export interface AutocompleteChoice {
|
|
|
253
256
|
value: string;
|
|
254
257
|
}
|
|
255
258
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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>> {}
|
|
259
280
|
export type AnyAutocompleteInteraction = GuildAutocompleteInteraction | PrivateAutocompleteInteraction;
|
|
260
281
|
|
|
261
|
-
export
|
|
262
|
-
export interface PrivateCommandInteraction extends CommandInteraction<AnyPrivateChannel | Uncached
|
|
282
|
+
export interface GuildCommandInteraction extends Guildify<CommandInteraction<AnyTextableGuildChannel>> {}
|
|
283
|
+
export interface PrivateCommandInteraction extends Privatify<CommandInteraction<AnyPrivateChannel | Uncached>> {}
|
|
263
284
|
export type AnyCommandInteraction = GuildCommandInteraction | PrivateCommandInteraction;
|
|
264
285
|
|
|
265
|
-
export interface GuildComponentButtonInteraction extends ComponentInteraction<ComponentTypes.BUTTON, AnyTextableGuildChannel
|
|
266
|
-
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>> {}
|
|
267
288
|
export type GuildComponentInteraction = GuildComponentButtonInteraction | GuildComponentSelectMenuInteraction;
|
|
268
289
|
|
|
269
|
-
export interface PrivateComponentButtonInteraction extends ComponentInteraction<ComponentTypes.BUTTON, AnyPrivateChannel | Uncached
|
|
270
|
-
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>> {}
|
|
271
292
|
export type PrivateComponentInteraction = PrivateComponentButtonInteraction | PrivateComponentSelectMenuInteraction;
|
|
272
293
|
export type AnyComponentButtonInteraction = GuildComponentButtonInteraction | PrivateComponentButtonInteraction;
|
|
273
294
|
export type AnyComponentSelectMenuInteraction = GuildComponentSelectMenuInteraction | PrivateComponentSelectMenuInteraction;
|
|
274
295
|
export type AnyComponentInteraction = AnyComponentButtonInteraction | AnyComponentSelectMenuInteraction;
|
|
275
296
|
|
|
276
|
-
export
|
|
277
|
-
export interface PrivateModalSubmitInteraction extends ModalSubmitInteraction<AnyPrivateChannel | Uncached
|
|
297
|
+
export interface GuildModalSubmitInteraction extends Guildify<ModalSubmitInteraction<AnyTextableGuildChannel>> {}
|
|
298
|
+
export interface PrivateModalSubmitInteraction extends Privatify<ModalSubmitInteraction<AnyPrivateChannel | Uncached>> {}
|
|
278
299
|
export type AnyModalSubmitInteraction = GuildModalSubmitInteraction | PrivateModalSubmitInteraction;
|
|
279
300
|
|
|
280
301
|
export type SubCommandArray = [subcommand: string] | [subcommandGroup: string, subcommand: string];
|
|
@@ -285,3 +306,6 @@ export interface InteractionGuild {
|
|
|
285
306
|
id: string;
|
|
286
307
|
locale: string;
|
|
287
308
|
}
|
|
309
|
+
|
|
310
|
+
export type AnyGuildInteraction = GuildAutocompleteInteraction | GuildCommandInteraction | GuildComponentInteraction | GuildModalSubmitInteraction;
|
|
311
|
+
export type AnyPrivateInteraction = PrivateAutocompleteInteraction | PrivateCommandInteraction | PrivateComponentInteraction | PrivateModalSubmitInteraction;
|