oceanic.js 1.11.3-dev.fb35174 → 1.12.1-dev.02ecdc3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/lib/Client.d.ts +3 -3
- package/dist/lib/Client.js +11 -13
- package/dist/lib/Constants.d.ts +68 -11
- package/dist/lib/Constants.js +79 -8
- package/dist/lib/gateway/Shard.d.ts +4 -1
- package/dist/lib/gateway/Shard.js +28 -8
- package/dist/lib/gateway/ShardManager.js +3 -3
- package/dist/lib/gateway/compression/zlib-sync.js +2 -2
- package/dist/lib/gateway/compression/zstd.d.ts +1 -5
- package/dist/lib/gateway/compression/zstd.js +5 -18
- package/dist/lib/gateway/events.d.ts +5 -0
- package/dist/lib/gateway/events.js +49 -6
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +4 -2
- package/dist/lib/rest/RequestHandler.js +2 -2
- package/dist/lib/routes/Applications.d.ts +20 -1
- package/dist/lib/routes/Applications.js +101 -45
- package/dist/lib/routes/Channels.d.ts +9 -1
- package/dist/lib/routes/Channels.js +89 -126
- package/dist/lib/routes/Guilds.d.ts +46 -32
- package/dist/lib/routes/Guilds.js +211 -265
- package/dist/lib/routes/Interactions.d.ts +5 -3
- package/dist/lib/routes/Interactions.js +32 -11
- package/dist/lib/routes/Miscellaneous.d.ts +6 -0
- package/dist/lib/routes/Miscellaneous.js +12 -1
- package/dist/lib/routes/OAuth.js +11 -14
- package/dist/lib/routes/Users.js +10 -4
- package/dist/lib/routes/Webhooks.js +47 -55
- package/dist/lib/structures/Application.d.ts +7 -1
- package/dist/lib/structures/Application.js +10 -1
- package/dist/lib/structures/ApplicationCommand.d.ts +3 -1
- package/dist/lib/structures/ApplicationCommand.js +5 -1
- package/dist/lib/structures/Attachment.d.ts +8 -0
- package/dist/lib/structures/Attachment.js +11 -1
- package/dist/lib/structures/AutocompleteInteraction.d.ts +4 -2
- package/dist/lib/structures/AutocompleteInteraction.js +6 -2
- package/dist/lib/structures/Base.js +5 -4
- package/dist/lib/structures/ClientApplication.d.ts +6 -1
- package/dist/lib/structures/ClientApplication.js +8 -1
- package/dist/lib/structures/CommandInteraction.d.ts +17 -12
- package/dist/lib/structures/CommandInteraction.js +30 -23
- package/dist/lib/structures/ComponentInteraction.d.ts +17 -14
- package/dist/lib/structures/ComponentInteraction.js +28 -25
- package/dist/lib/structures/Entitlement.d.ts +2 -2
- package/dist/lib/structures/Entitlement.js +5 -5
- package/dist/lib/structures/Guild.d.ts +33 -12
- package/dist/lib/structures/Guild.js +49 -21
- package/dist/lib/structures/GuildTemplate.d.ts +1 -6
- package/dist/lib/structures/GuildTemplate.js +1 -8
- package/dist/lib/structures/Invite.d.ts +3 -1
- package/dist/lib/structures/Invite.js +4 -1
- package/dist/lib/structures/Message.d.ts +3 -3
- package/dist/lib/structures/Message.js +25 -16
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +16 -13
- package/dist/lib/structures/ModalSubmitInteraction.js +26 -18
- package/dist/lib/structures/PingInteraction.d.ts +2 -2
- package/dist/lib/structures/PingInteraction.js +2 -2
- package/dist/lib/structures/Role.d.ts +7 -2
- package/dist/lib/structures/Role.js +20 -2
- package/dist/lib/structures/Soundboard.d.ts +42 -0
- package/dist/lib/structures/Soundboard.js +73 -0
- package/dist/lib/structures/Subscription.d.ts +25 -0
- package/dist/lib/structures/Subscription.js +38 -0
- package/dist/lib/structures/User.d.ts +3 -6
- package/dist/lib/structures/User.js +15 -7
- package/dist/lib/types/applications.d.ts +89 -8
- package/dist/lib/types/channels.d.ts +354 -189
- package/dist/lib/types/client.d.ts +7 -2
- package/dist/lib/types/events.d.ts +15 -3
- package/dist/lib/types/gateway-raw.d.ts +39 -3
- package/dist/lib/types/gateway.d.ts +10 -2
- package/dist/lib/types/guild-template.d.ts +0 -7
- package/dist/lib/types/guilds.d.ts +46 -34
- package/dist/lib/types/interactions.d.ts +65 -7
- package/dist/lib/types/json.d.ts +33 -8
- package/dist/lib/types/users.d.ts +26 -1
- package/dist/lib/types/webhooks.d.ts +6 -2
- package/dist/lib/util/Errors.d.ts +9 -0
- package/dist/lib/util/Errors.js +22 -2
- package/dist/lib/util/QueryBuilder.d.ts +5 -0
- package/dist/lib/util/QueryBuilder.js +21 -0
- package/dist/lib/util/Routes.d.ts +7 -4
- package/dist/lib/util/Routes.js +18 -11
- package/dist/lib/util/Util.d.ts +11 -6
- package/dist/lib/util/Util.js +118 -13
- package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +5 -2
- package/dist/lib/util/interactions/MessageInteractionResponse.js +9 -7
- package/dist/package.json +8 -9
- package/esm.mjs +2 -0
- package/package.json +8 -9
@@ -79,8 +79,7 @@ export interface RESTOptions {
|
|
79
79
|
latencyThreshold?: number;
|
80
80
|
/**
|
81
81
|
* In milliseconds, the maximum ratelimit delay (in milliseconds) the lib will internally wait for to retry the request. If a ratelimit resets after this window, an error will be thrown instead.
|
82
|
-
* @
|
83
|
-
* @defaultValue Infinity
|
82
|
+
* @defaultValue 30000
|
84
83
|
*/
|
85
84
|
maxRatelimitRetryWindow?: number;
|
86
85
|
/**
|
@@ -201,6 +200,12 @@ export interface CollectionLimitsOptions {
|
|
201
200
|
* @defaultValue Infinity
|
202
201
|
*/
|
203
202
|
scheduledEvents?: number | Record<string, number>;
|
203
|
+
/**
|
204
|
+
* The maximum number of soundboard sounds to cache.
|
205
|
+
* @dictionaryKey guild id
|
206
|
+
* @defaultValue Infinity
|
207
|
+
*/
|
208
|
+
soundboardSounds?: number | Record<string, number>;
|
204
209
|
/**
|
205
210
|
* The maximum number of stage instances to cache.
|
206
211
|
* @dictionaryKey guild id
|
@@ -35,7 +35,8 @@ import type {
|
|
35
35
|
JSONUser,
|
36
36
|
JSONVoiceState,
|
37
37
|
JSONEntitlement,
|
38
|
-
JSONTestEntitlement
|
38
|
+
JSONTestEntitlement,
|
39
|
+
JSONSoundboard
|
39
40
|
} from "./json";
|
40
41
|
import type { GuildApplicationCommandPermissions } from "./applications";
|
41
42
|
import type {
|
@@ -68,6 +69,7 @@ import type GroupChannel from "../structures/GroupChannel";
|
|
68
69
|
import type Entitlement from "../structures/Entitlement";
|
69
70
|
import type TestEntitlement from "../structures/TestEntitlement";
|
70
71
|
import type { JSONChannelTypeMap } from "../Constants";
|
72
|
+
import type Soundboard from "../structures/Soundboard";
|
71
73
|
|
72
74
|
|
73
75
|
export interface ClientEvents {
|
@@ -115,7 +117,7 @@ export interface ClientEvents {
|
|
115
117
|
guildCreate: [guild: Guild];
|
116
118
|
/** @event Emitted when the client leaves a guild. Requires the `GUILDS` intent. */
|
117
119
|
guildDelete: [guild: Guild | Uncached];
|
118
|
-
/** @event Emitted when a guild's emojis are updated. Requires the `
|
120
|
+
/** @event Emitted when a guild's emojis are updated. Requires the `GUILD_EXPRESSIONS` intent. */
|
119
121
|
guildEmojisUpdate: [guild: Guild | Uncached, emojis: Array<GuildEmoji>, oldEmojis: Array<GuildEmoji> | null];
|
120
122
|
/** @event Emitted when a guild's integrations are updated. Requires the `GUILD_INTEGRATIONS` intent. */
|
121
123
|
guildIntegrationsUpdate: [guild: Guild | Uncached];
|
@@ -143,7 +145,15 @@ export interface ClientEvents {
|
|
143
145
|
guildScheduledEventUserAdd: [event: GuildScheduledEvent | Uncached, user: User | Uncached];
|
144
146
|
/** @event Emitted when a user unsubscribes from a scheduled event. Requires the `GUILD_SCHEDULED_EVENTS` intent. */
|
145
147
|
guildScheduledEventUserRemove: [event: GuildScheduledEvent | Uncached, user: User | Uncached];
|
146
|
-
/** @event Emitted when a guild's
|
148
|
+
/** @event Emitted when a guild's soundboard sound is created. Requires the `GUILD_EXPRESSIONS` intent. */
|
149
|
+
guildSoundboardSoundCreate: [soundboardSound: Soundboard];
|
150
|
+
/** @event Emitted when a guild's soundboard sound is deleted. Requires the `GUILD_EXPRESSIONS` intent. */
|
151
|
+
guildSoundboardSoundDelete: [soundboardSound: Soundboard | Uncached];
|
152
|
+
/** @event Emitted when a guild's soundboard sound is updated. Requires the `GUILD_EXPRESSIONS` intent. */
|
153
|
+
guildSoundboardSoundUpdate: [soundboardSound: Soundboard, oldSoundboardSound: JSONSoundboard | null];
|
154
|
+
/** @event Emitted when multiple guild's soundboard sounds are updated. Requires the `GUILD_EXPRESSIONS` intent. */
|
155
|
+
guildSoundboardSoundsUpdate: [soundboardSounds: Array<Soundboard>, oldSoundboardSounds: Array<JSONSoundboard | null>, guildID: string];
|
156
|
+
/** @event Emitted when a guild's stickers are updated. Requires the `GUILD_EXPRESSIONS` intent. */
|
147
157
|
guildStickersUpdate: [guild: Guild | Uncached, stickers: Array<Sticker>, oldStickers: Array<Sticker> | null];
|
148
158
|
/** @event Emitted when a guild becomes unavailable. Requires the `GUILDS` intent. */
|
149
159
|
guildUnavailable: [guild: UnavailableGuild];
|
@@ -199,6 +209,8 @@ export interface ClientEvents {
|
|
199
209
|
shardReady: [id: number];
|
200
210
|
/** @event Emitted when a shard resumes a connection. */
|
201
211
|
shardResume: [id: number];
|
212
|
+
/** @event Emitted when a shard receives the SOUNDBOARD_SOUNDS packet. */
|
213
|
+
soundboardSounds: [guildID: string, soundboardSounds: Array<Soundboard>];
|
202
214
|
/** @event Emitted when a stage instance is created. */
|
203
215
|
stageInstanceCreate: [instance: StageInstance];
|
204
216
|
/** @event Emitted when a stage instance is deleted. */
|
@@ -30,6 +30,7 @@ import type {
|
|
30
30
|
RawGroupChannel,
|
31
31
|
RawGuildChannel,
|
32
32
|
RawMessage,
|
33
|
+
RawSoundboard,
|
33
34
|
RawThreadChannel,
|
34
35
|
RawThreadMember
|
35
36
|
} from "./channels";
|
@@ -37,7 +38,7 @@ import type { RawScheduledEvent } from "./scheduled-events";
|
|
37
38
|
import type { RawVoiceState } from "./voice";
|
38
39
|
import type { RawInteraction } from "./interactions";
|
39
40
|
import type { RawAuditLogEntry } from "./audit-log";
|
40
|
-
import type { GatewayOPCodes, InviteTargetTypes, ReactionType } from "../Constants";
|
41
|
+
import type { GatewayOPCodes, InviteTargetTypes, InviteTypes, ReactionType } from "../Constants";
|
41
42
|
|
42
43
|
export type AnyReceivePacket = AnyDispatchPacket | HeartbeatPacket | ReconnectPacket | InvalidSessionPacket | HelloPacket | HeartbeatAckPacket;
|
43
44
|
export interface RawPacket {
|
@@ -345,6 +346,32 @@ export interface GuildScheduledEventUserRemovePacket extends BaseDispatchPacket
|
|
345
346
|
t: "GUILD_SCHEDULED_EVENT_USER_REMOVE";
|
346
347
|
}
|
347
348
|
|
349
|
+
export interface GuildSoundboardSoundCreatePacket extends BaseDispatchPacket {
|
350
|
+
d: RawSoundboard & { guild_id: string; };
|
351
|
+
t: "GUILD_SOUNDBOARD_SOUND_CREATE";
|
352
|
+
}
|
353
|
+
|
354
|
+
export interface GuildSoundboardSoundDeletePacket extends BaseDispatchPacket {
|
355
|
+
d: {
|
356
|
+
guild_id: string;
|
357
|
+
sound_id: string;
|
358
|
+
};
|
359
|
+
t: "GUILD_SOUNDBOARD_SOUND_DELETE";
|
360
|
+
}
|
361
|
+
|
362
|
+
export interface GuildSoundboardSoundUpdatePacket extends BaseDispatchPacket {
|
363
|
+
d: RawSoundboard & { guild_id: string; };
|
364
|
+
t: "GUILD_SOUNDBOARD_SOUND_UPDATE";
|
365
|
+
}
|
366
|
+
|
367
|
+
export interface GuildSoundboardSoundsUpdatePacket extends BaseDispatchPacket {
|
368
|
+
d: {
|
369
|
+
guild_id: string;
|
370
|
+
soundboard_sounds: Array<RawSoundboard & { guild_id: string; }>;
|
371
|
+
};
|
372
|
+
t: "GUILD_SOUNDBOARD_SOUNDS_UPDATE";
|
373
|
+
}
|
374
|
+
|
348
375
|
export interface IntegrationCreatePacket extends BaseDispatchPacket {
|
349
376
|
d: RawIntegration & { guild_id: string; };
|
350
377
|
t: "INTEGRATION_CREATE";
|
@@ -377,6 +404,7 @@ export interface InviteCreatePacket extends BaseDispatchPacket {
|
|
377
404
|
target_type?: InviteTargetTypes;
|
378
405
|
target_user?: RawUser;
|
379
406
|
temporary: boolean;
|
407
|
+
type: InviteTypes;
|
380
408
|
uses: number;
|
381
409
|
};
|
382
410
|
t: "INVITE_CREATE";
|
@@ -515,6 +543,14 @@ export interface InteractionCreatePacket extends BaseDispatchPacket {
|
|
515
543
|
t: "INTERACTION_CREATE";
|
516
544
|
}
|
517
545
|
|
546
|
+
export interface SoundboardSoundsPacket extends BaseDispatchPacket {
|
547
|
+
d: {
|
548
|
+
guild_id: string;
|
549
|
+
soundboard_sounds: Array<RawSoundboard>;
|
550
|
+
};
|
551
|
+
t: "SOUNDBOARD_SOUNDS";
|
552
|
+
}
|
553
|
+
|
518
554
|
export interface StageInstanceCreatePacket extends BaseDispatchPacket {
|
519
555
|
d: RawStageInstance;
|
520
556
|
t: "STAGE_INSTANCE_CREATE";
|
@@ -578,10 +614,10 @@ ThreadCreatePacket | ThreadDeletePacket | ThreadUpdatePacket | ThreadListSyncPac
|
|
578
614
|
GuildBanAddPacket | GuildBanRemovePacket | GuildEmojisUpdatePacket | GuildStickersUpdatePacket | GuildIntegrationsUpdatePacket |
|
579
615
|
GuildMemberAddPacket | GuildMemberRemovePacket | GuildMemberUpdatePacket | GuildMembersChunkPacket |
|
580
616
|
GuildRoleCreatePacket | GuildRoleDeletePacket | GuildRoleUpdatePacket |
|
581
|
-
GuildScheduledEventCreatePacket | GuildScheduledEventDeletePacket | GuildScheduledEventUpdatePacket | GuildScheduledEventUserAddPacket | GuildScheduledEventUserRemovePacket |
|
617
|
+
GuildScheduledEventCreatePacket | GuildScheduledEventDeletePacket | GuildScheduledEventUpdatePacket | GuildScheduledEventUserAddPacket | GuildScheduledEventUserRemovePacket | GuildSoundboardSoundCreatePacket | GuildSoundboardSoundDeletePacket | GuildSoundboardSoundUpdatePacket | GuildSoundboardSoundsUpdatePacket |
|
582
618
|
IntegrationCreatePacket | IntegrationDeletePacket | IntegrationUpdatePacket |
|
583
619
|
InviteCreatePacket | InviteDeletePacket |
|
584
620
|
MessageCreatePacket | MessageDeletePacket | MessageDeleteBulkPacket | MessageUpdatePacket | MessageReactionAddPacket | MessageReactionRemovePacket | MessageReactionRemoveAllPacket | MessageReactionRemoveEmojiPacket |
|
585
|
-
TypingStartPacket | UserUpdatePacket | VoiceStateUpdatePacket | VoiceChannelEffectSendPacket | VoiceChannelStatusUpdatePacket | VoiceServerUpdatePacket | WebhooksUpdatePacket | InteractionCreatePacket | StageInstanceCreatePacket | StageInstanceDeletePacket | StageInstanceUpdatePacket |
|
621
|
+
TypingStartPacket | UserUpdatePacket | VoiceStateUpdatePacket | VoiceChannelEffectSendPacket | VoiceChannelStatusUpdatePacket | VoiceServerUpdatePacket | WebhooksUpdatePacket | InteractionCreatePacket | SoundboardSoundsPacket | StageInstanceCreatePacket | StageInstanceDeletePacket | StageInstanceUpdatePacket |
|
586
622
|
EntitlementCreatePacket | EntitlementUpdatePacket | EntitlementDeletePacket |
|
587
623
|
MessagePollVoteAdd | MessagePollVoteRemove;
|
@@ -29,7 +29,7 @@ interface GatewayOptions {
|
|
29
29
|
* @note `true` is the same as `zlib-stream`. This behavior is deprecated.
|
30
30
|
* @defaultValue false
|
31
31
|
*/
|
32
|
-
compress?: boolean | "zlib-stream" | "zstd-stream";
|
32
|
+
compress?: boolean | "zlib-stream"; // | "zstd-stream";
|
33
33
|
/**
|
34
34
|
* The concurrency for shard connections. If you don't know what this is, don't mess with it. Only bots in >150,000 servers can use any non-default value.
|
35
35
|
* @defaultValue 1
|
@@ -166,7 +166,7 @@ export interface OverrideOptions {
|
|
166
166
|
}
|
167
167
|
|
168
168
|
export interface ShardManagerInstanceOptions extends Required<Omit<GatewayOptions, "concurrency" | "connectionProperties" | "intents" | "maxShards" | "presence" | "dispatcher" | "compress">> {
|
169
|
-
compress: false | "zlib-stream" | "zstd-stream";
|
169
|
+
compress: false | "zlib-stream"; // | "zstd-stream";
|
170
170
|
concurrency: number;
|
171
171
|
connectionProperties: Required<GatewayOptions["connectionProperties"]>;
|
172
172
|
dispatcher: DispatcherInstanceOptions;
|
@@ -236,6 +236,14 @@ export interface RequestGuildMembersOptions {
|
|
236
236
|
userIDs?: Array<string>;
|
237
237
|
}
|
238
238
|
|
239
|
+
export interface RequestSoundboardSoundsOptions {
|
240
|
+
/**
|
241
|
+
* The maximum amount of time in milliseconds to wait.
|
242
|
+
* @defaultValue `client.rest.options.requestTimeout`
|
243
|
+
*/
|
244
|
+
timeout?: number;
|
245
|
+
}
|
246
|
+
|
239
247
|
export type MutualStatuses = "online" | "dnd" | "idle";
|
240
248
|
export type SendStatuses = MutualStatuses | "invisible";
|
241
249
|
export type ReceiveStatuses = MutualStatuses | "offline";
|
@@ -16,13 +16,6 @@ export interface RawGuildTemplate {
|
|
16
16
|
usage_count: number;
|
17
17
|
}
|
18
18
|
|
19
|
-
export interface CreateGuildFromTemplateOptions {
|
20
|
-
/** The icon for the created guild (buffer, or full data url). */
|
21
|
-
icon?: Buffer | string;
|
22
|
-
/** The name of the guild. */
|
23
|
-
name: string;
|
24
|
-
}
|
25
|
-
|
26
19
|
export interface CreateTemplateOptions {
|
27
20
|
/** The description of the template. */
|
28
21
|
description?: string | null;
|
@@ -108,7 +108,9 @@ export interface RawGuild {
|
|
108
108
|
export interface RawInviteGuild extends Pick<RawGuild, "id" | "name" | "splash" | "banner" | "description" | "icon" | "features" | "verification_level" | "vanity_url_code" | "premium_subscription_count" | "nsfw_level"> {}
|
109
109
|
|
110
110
|
export interface RawRole {
|
111
|
+
/** @deprecated */
|
111
112
|
color: number;
|
113
|
+
colors: RawRoleColors;
|
112
114
|
flags: number;
|
113
115
|
hoist: boolean;
|
114
116
|
icon?: string | null;
|
@@ -137,6 +139,19 @@ export interface RoleTags {
|
|
137
139
|
premiumSubscriber: boolean;
|
138
140
|
subscriptionListingID?: string;
|
139
141
|
}
|
142
|
+
|
143
|
+
export interface RawRoleColors {
|
144
|
+
primary_color: number;
|
145
|
+
secondary_color: number | null;
|
146
|
+
tertiary_color: number | null;
|
147
|
+
}
|
148
|
+
|
149
|
+
export interface RoleColors {
|
150
|
+
primaryColor: number;
|
151
|
+
secondaryColor: number | null;
|
152
|
+
tertiaryColor: number | null;
|
153
|
+
}
|
154
|
+
|
140
155
|
export interface RawGuildEmoji extends Required<Omit<Emoji, "user" | "id">> { id: string; user?: RawUser; }
|
141
156
|
export interface GuildEmoji extends Omit<RawGuildEmoji, "user" | "id" | "require_colons"> { id: string; requireColons?: boolean; user?: User; }
|
142
157
|
export interface RawWelcomeScreen {
|
@@ -291,33 +306,6 @@ export interface RawGuildPreview {
|
|
291
306
|
stickers: Array<RawSticker>;
|
292
307
|
}
|
293
308
|
|
294
|
-
export interface CreateGuildOptions {
|
295
|
-
/** The ID of the AFK voice channel. */
|
296
|
-
afkChannelID?: string;
|
297
|
-
/** The AFK timeout in seconds. */
|
298
|
-
afkTimeout?: number;
|
299
|
-
/** The initial channels of the guild. */
|
300
|
-
channels?: Array<CreateChannelOptions>;
|
301
|
-
/** The default message notification level. */
|
302
|
-
defaultMessageNotifications?: DefaultMessageNotificationLevels;
|
303
|
-
/** The explicit content filter level. */
|
304
|
-
explicitContentFilter?: ExplicitContentFilterLevels;
|
305
|
-
/** The icon of the guild. */
|
306
|
-
icon?: Buffer | string;
|
307
|
-
/** The name of the guild. */
|
308
|
-
name: string;
|
309
|
-
/** @deprecated The region of the guild. */
|
310
|
-
region?: string | null;
|
311
|
-
/** The initial roles of the guild. */
|
312
|
-
roles?: Array<Omit<CreateRoleOptions, "reason">>;
|
313
|
-
/** The system channel flags. */
|
314
|
-
systemChannelFlags?: number;
|
315
|
-
/** The ID of the system channel. */
|
316
|
-
systemChannelID?: string;
|
317
|
-
/** The verification level of the guild. */
|
318
|
-
verificationLevel?: VerificationLevels;
|
319
|
-
}
|
320
|
-
|
321
309
|
export interface EditGuildOptions {
|
322
310
|
/** The ID of the AFK voice channel. `null` to reset. */
|
323
311
|
afkChannelID?: string | null;
|
@@ -339,8 +327,6 @@ export interface EditGuildOptions {
|
|
339
327
|
icon?: Buffer | string | null;
|
340
328
|
/** The name of the guild. */
|
341
329
|
name?: string;
|
342
|
-
/** The ID of the member to transfer guild ownership to. */
|
343
|
-
ownerID?: string;
|
344
330
|
/** The preferred [locale](https://discord.com/developers/docs/reference#locales) of the guild. `null` to reset. */
|
345
331
|
preferredLocale?: string | null;
|
346
332
|
/** If the premium progress bar is enabled. */
|
@@ -411,8 +397,13 @@ export interface CreateAnnouncementChannelOptions extends Omit<CreateChannelOpti
|
|
411
397
|
export interface CreateStageChannelOptions extends Omit<CreateChannelOptions<ChannelTypes.GUILD_STAGE_VOICE>, "defaultAutoArchiveDuration" | "nsfw" | "rtcRegion" | "topic" | "userLimit" | "videoQualityMode"> {}
|
412
398
|
|
413
399
|
export interface CreateRoleOptions {
|
414
|
-
/**
|
400
|
+
/**
|
401
|
+
* The color of the role.
|
402
|
+
* @deprecated Use {@link CreateRoleOptions#colors | CreateRoleOptions#colors.primaryColor} instead.
|
403
|
+
*/
|
415
404
|
color?: number;
|
405
|
+
/** The colors of the role. */
|
406
|
+
colors?: Partial<RoleColors>;
|
416
407
|
/** If the role should be hoisted. */
|
417
408
|
hoist?: boolean;
|
418
409
|
/** The icon for the role (buffer, or full data url). Requires the `ROLE_ICONS` feature. */
|
@@ -676,11 +667,32 @@ export interface EditStageInstanceOptions extends Pick<CreateStageInstanceOption
|
|
676
667
|
reason?: string;
|
677
668
|
}
|
678
669
|
|
679
|
-
export interface
|
680
|
-
/** The
|
681
|
-
|
682
|
-
/** The
|
670
|
+
export interface CreateSoundboardSoundOptions {
|
671
|
+
/** The ID of the emoji of the soundboard sound. */
|
672
|
+
emojiID?: string;
|
673
|
+
/** The name of the emoji of the soundboard sound. */
|
674
|
+
emojiName?: string;
|
675
|
+
/** The name of the soundboard sound. */
|
676
|
+
name: string;
|
677
|
+
/** The reason for creating the soundboard sound. */
|
678
|
+
reason?: string;
|
679
|
+
/** The mp3 or ogg sound data. */
|
680
|
+
sound: Buffer | string;
|
681
|
+
/** The volume of the soundboard sound. */
|
682
|
+
volume?: number;
|
683
|
+
}
|
684
|
+
|
685
|
+
export interface EditSoundboardSoundOptions {
|
686
|
+
/** The ID of the emoji of the soundboard sound. */
|
687
|
+
emojiID?: string;
|
688
|
+
/** The name of the emoji of the soundboard sound. */
|
689
|
+
emojiName?: string;
|
690
|
+
/** The name of the soundboard sound. */
|
691
|
+
name?: string;
|
692
|
+
/** The reason for editing the soundboard sound. */
|
683
693
|
reason?: string;
|
694
|
+
/** The volume of the soundboard sound. */
|
695
|
+
volume?: number;
|
684
696
|
}
|
685
697
|
|
686
698
|
export interface CreateStickerOptions {
|
@@ -3,11 +3,11 @@ import type { EditWebhookMessageOptions, ExecuteWebhookOptions } from "./webhook
|
|
3
3
|
import type {
|
4
4
|
AnyTextableGuildChannel,
|
5
5
|
AnyPrivateChannel,
|
6
|
-
ModalActionRow,
|
7
6
|
RawAttachment,
|
8
7
|
RawInteractionResolvedChannel,
|
9
8
|
RawMessage,
|
10
|
-
AnyInteractionChannel
|
9
|
+
AnyInteractionChannel,
|
10
|
+
ModalComponent
|
11
11
|
} from "./channels";
|
12
12
|
import type { InteractionMember, RawMember, RawRole } from "./guilds";
|
13
13
|
import type { RawUser } from "./users";
|
@@ -46,10 +46,9 @@ import type Permission from "../structures/Permission";
|
|
46
46
|
import type ModalSubmitInteractionComponentsWrapper from "../util/interactions/ModalSubmitInteractionComponentsWrapper";
|
47
47
|
|
48
48
|
export interface InteractionContent extends Pick<ExecuteWebhookOptions, "tts" | "content" | "embeds" | "allowedMentions" | "flags" | "components" | "attachments" | "files" | "poll"> {}
|
49
|
-
export interface EditInteractionContent extends Pick<EditWebhookMessageOptions, "content" | "embeds" | "allowedMentions" | "components" | "attachments" | "files"> {}
|
50
|
-
export interface InitialInteractionContent extends Omit<InteractionContent, "attachments" | "files"> {}
|
49
|
+
export interface EditInteractionContent extends Pick<EditWebhookMessageOptions, "content" | "embeds" | "allowedMentions" | "flags" | "components" | "attachments" | "files" | "poll"> {}
|
51
50
|
|
52
|
-
export type InteractionResponse = PingInteractionResponse | MessageInteractionResponse | DeferredInteractionResponse | AutocompleteInteractionResponse | ModalSubmitInteractionResponse | PremiumRequiredResponse;
|
51
|
+
export type InteractionResponse = PingInteractionResponse | MessageInteractionResponse | DeferredInteractionResponse | AutocompleteInteractionResponse | ModalSubmitInteractionResponse | PremiumRequiredResponse | LaunchActivityResponse;
|
53
52
|
export interface PingInteractionResponse {
|
54
53
|
type: InteractionResponseTypes.PONG;
|
55
54
|
}
|
@@ -79,14 +78,17 @@ export interface ModalSubmitInteractionResponse {
|
|
79
78
|
}
|
80
79
|
|
81
80
|
export interface PremiumRequiredResponse {
|
82
|
-
data: Record<string, never>;
|
83
81
|
type: InteractionResponseTypes.PREMIUM_REQUIRED;
|
84
82
|
}
|
85
83
|
|
84
|
+
export interface LaunchActivityResponse {
|
85
|
+
type: InteractionResponseTypes.LAUNCH_ACTIVITY;
|
86
|
+
}
|
87
|
+
|
86
88
|
|
87
89
|
export interface ModalData {
|
88
90
|
/** 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}. */
|
89
|
-
components: Array<
|
91
|
+
components: Array<ModalComponent>;
|
90
92
|
/** The custom ID of the modal. */
|
91
93
|
customID: string;
|
92
94
|
/** The title of the modal. */
|
@@ -96,6 +98,7 @@ export interface ModalData {
|
|
96
98
|
export interface RawInteraction {
|
97
99
|
app_permissions: string;
|
98
100
|
application_id: string;
|
101
|
+
attachment_size_limit: number;
|
99
102
|
authorizing_integration_owners: AuthorizingIntegrationOwners;
|
100
103
|
channel_id?: string;
|
101
104
|
context?: InteractionContextTypes;
|
@@ -375,3 +378,58 @@ export type ModalSubmitComponents = ModalSubmitTextInputComponent;
|
|
375
378
|
export interface ModalSubmitTextInputComponent extends ModalSubmitComponentsStringValue<ComponentTypes.TEXT_INPUT> {}
|
376
379
|
|
377
380
|
export type ApplicationCommandTypesWithTarget = ApplicationCommandTypes.USER | ApplicationCommandTypes.MESSAGE;
|
381
|
+
|
382
|
+
export interface RawInteractionCallbackResponse {
|
383
|
+
interaction: RawInteractionCallback;
|
384
|
+
resource?: RawInteractionCallbackResource;
|
385
|
+
}
|
386
|
+
|
387
|
+
export interface RawInteractionCallback {
|
388
|
+
activity_instance_id?: string;
|
389
|
+
id: string;
|
390
|
+
response_message_ephemeral?: boolean;
|
391
|
+
response_message_id?: string;
|
392
|
+
response_message_loading?: boolean;
|
393
|
+
type: InteractionTypes;
|
394
|
+
}
|
395
|
+
|
396
|
+
export interface RawInteractionCallbackResource {
|
397
|
+
activity_instance?: Array<InteractionCallbackActivityInstance>;
|
398
|
+
message?: RawMessage;
|
399
|
+
type: InteractionResponseTypes;
|
400
|
+
}
|
401
|
+
|
402
|
+
export interface InteractionCallbackActivityInstance {
|
403
|
+
/** Instance ID of the Activity if one was launched or joined. */
|
404
|
+
id: string;
|
405
|
+
}
|
406
|
+
|
407
|
+
export interface InteractionCallbackResponse<CH extends AnyInteractionChannel | Uncached = AnyInteractionChannel | Uncached> {
|
408
|
+
/** The interaction object associated with the interaction response. */
|
409
|
+
interaction: InteractionCallback;
|
410
|
+
/** The resource that was created by the interaction response. */
|
411
|
+
resource?: InteractionCallbackResource<CH>;
|
412
|
+
}
|
413
|
+
|
414
|
+
export interface InteractionCallback {
|
415
|
+
/** Instance ID of the Activity if one was launched or joined. */
|
416
|
+
activityInstanceID?: string;
|
417
|
+
/** ID of the interaction. */
|
418
|
+
id: string;
|
419
|
+
/** Whether or not the response message was ephemeral. */
|
420
|
+
responseMessageEphemeral?: boolean;
|
421
|
+
/** ID of the message that was created by the interaction. */
|
422
|
+
responseMessageID?: string;
|
423
|
+
/** Whether or not the message is in a loading state. */
|
424
|
+
responseMessageLoading?: boolean;
|
425
|
+
/** Interaction type. */
|
426
|
+
type: InteractionTypes;
|
427
|
+
}
|
428
|
+
|
429
|
+
export interface InteractionCallbackResource<CH extends AnyInteractionChannel | Uncached = AnyInteractionChannel | Uncached> {
|
430
|
+
/** Represents the Activity launched by this interaction. Only present if type is `LAUNCH_ACTIVITY`. */
|
431
|
+
activityInstance?: Array<InteractionCallbackActivityInstance>;
|
432
|
+
/** Message created by the interaction. Only present if type is either `CHANNEL_MESSAGE_WITH_SOURCE` or `UPDATE_MESSAGE`. */
|
433
|
+
message?: Message<CH>;
|
434
|
+
type: InteractionResponseTypes;
|
435
|
+
}
|
package/dist/lib/types/json.d.ts
CHANGED
@@ -20,7 +20,8 @@ import type {
|
|
20
20
|
WelcomeScreen,
|
21
21
|
Sticker,
|
22
22
|
Presence,
|
23
|
-
IncidentActions
|
23
|
+
IncidentActions,
|
24
|
+
RoleColors
|
24
25
|
} from "./guilds";
|
25
26
|
import type {
|
26
27
|
ChannelMention,
|
@@ -33,7 +34,6 @@ import type {
|
|
33
34
|
PrivateThreadMetadata,
|
34
35
|
ForumTag,
|
35
36
|
ForumEmoji,
|
36
|
-
MessageActionRow,
|
37
37
|
Embed,
|
38
38
|
GuildChannels,
|
39
39
|
TextableGuildChannels,
|
@@ -43,10 +43,11 @@ import type {
|
|
43
43
|
PollQuestion,
|
44
44
|
PollResults,
|
45
45
|
PollAnswer,
|
46
|
-
MessagePollResults
|
46
|
+
MessagePollResults,
|
47
|
+
MessageComponent
|
47
48
|
} from "./channels";
|
48
49
|
import type { ScheduledEventEntityMetadata } from "./scheduled-events";
|
49
|
-
import type { AvatarDecorationData } from "./users";
|
50
|
+
import type { AvatarDecorationData, Collectibles } from "./users";
|
50
51
|
import type {
|
51
52
|
ApplicationCommandTypes,
|
52
53
|
AutoModerationEventTypes,
|
@@ -84,7 +85,8 @@ import type {
|
|
84
85
|
ApplicationMonetizationState,
|
85
86
|
RPCApplicationState,
|
86
87
|
StoreApplicationState,
|
87
|
-
ApplicationVerificationState
|
88
|
+
ApplicationVerificationState,
|
89
|
+
EntryPointCommandHandlerTypes
|
88
90
|
} from "../Constants";
|
89
91
|
|
90
92
|
export interface JSONAnnouncementChannel extends JSONThreadableChannel {
|
@@ -143,6 +145,7 @@ export interface JSONApplicationCommand extends JSONBase {
|
|
143
145
|
descriptionLocalizations?: LocaleMap | null;
|
144
146
|
dmPermission?: boolean;
|
145
147
|
guildID?: string;
|
148
|
+
handler?: EntryPointCommandHandlerTypes;
|
146
149
|
integrationTypes: Array<ApplicationIntegrationTypes>;
|
147
150
|
name: string;
|
148
151
|
nameLocalizations?: LocaleMap | null;
|
@@ -166,6 +169,7 @@ export interface JSONAttachment extends JSONBase {
|
|
166
169
|
}
|
167
170
|
export interface JSONAutocompleteInteraction extends JSONInteraction {
|
168
171
|
appPermissions: JSONPermission;
|
172
|
+
attachmentSizeLimit: number;
|
169
173
|
authorizingIntegrationOwners: AuthorizingIntegrationOwners;
|
170
174
|
channelID: string;
|
171
175
|
context?: InteractionContextTypes;
|
@@ -231,6 +235,7 @@ export interface JSONClientUser extends JSONUser {
|
|
231
235
|
}
|
232
236
|
export interface JSONCommandInteraction extends JSONInteraction {
|
233
237
|
appPermissions: JSONPermission;
|
238
|
+
attachmentSizeLimit: number;
|
234
239
|
authorizingIntegrationOwners: AuthorizingIntegrationOwners;
|
235
240
|
channelID: string;
|
236
241
|
context?: InteractionContextTypes;
|
@@ -244,6 +249,7 @@ export interface JSONCommandInteraction extends JSONInteraction {
|
|
244
249
|
}
|
245
250
|
export interface JSONComponentInteraction extends JSONInteraction {
|
246
251
|
appPermissions: JSONPermission;
|
252
|
+
attachmentSizeLimit: number;
|
247
253
|
authorizingIntegrationOwners: AuthorizingIntegrationOwners;
|
248
254
|
channelID: string;
|
249
255
|
context?: InteractionContextTypes;
|
@@ -256,8 +262,8 @@ export interface JSONComponentInteraction extends JSONInteraction {
|
|
256
262
|
user: JSONUser;
|
257
263
|
}
|
258
264
|
export interface JSONEntitlement extends JSONBaseEntitlement {
|
259
|
-
endsAt: number;
|
260
|
-
startsAt: number;
|
265
|
+
endsAt: number | null;
|
266
|
+
startsAt: number | null;
|
261
267
|
subscriptionID: string;
|
262
268
|
}
|
263
269
|
export interface JSONDiscordHTTPError {
|
@@ -462,12 +468,13 @@ export interface JSONMessage extends JSONBase {
|
|
462
468
|
attachments: Array<JSONAttachment>;
|
463
469
|
author: JSONUser;
|
464
470
|
channelID: string;
|
465
|
-
components?: Array<
|
471
|
+
components?: Array<MessageComponent>;
|
466
472
|
content: string;
|
467
473
|
editedTimestamp: number | null;
|
468
474
|
embeds: Array<Embed>;
|
469
475
|
flags?: number;
|
470
476
|
guildID?: string;
|
477
|
+
/** @deprecated Use {@link JSON/JSONMessage#interactionMetadata | JSONMessage#interactionMetadata } instead. */
|
471
478
|
interaction?: {
|
472
479
|
id: string;
|
473
480
|
member?: JSONMember;
|
@@ -481,11 +488,15 @@ export interface JSONMessage extends JSONBase {
|
|
481
488
|
interactedMessageID?: string;
|
482
489
|
name?: string;
|
483
490
|
originalResponseMessageID?: string;
|
491
|
+
targetMessageID?: string;
|
492
|
+
targetUser?: JSONUser;
|
484
493
|
triggeringInteractionMetadata?: {
|
485
494
|
authorizingIntegrationOwners: AuthorizingIntegrationOwners;
|
486
495
|
id: string;
|
487
496
|
interactedMessageID?: string;
|
488
497
|
originalResponseMessageID?: string;
|
498
|
+
targetMessageID?: string;
|
499
|
+
targetUser?: JSONUser;
|
489
500
|
type: InteractionTypes;
|
490
501
|
user: JSONUser;
|
491
502
|
};
|
@@ -533,6 +544,7 @@ export interface JSONMessage extends JSONBase {
|
|
533
544
|
}
|
534
545
|
export interface JSONModalSubmitInteraction extends JSONInteraction {
|
535
546
|
appPermissions: JSONPermission;
|
547
|
+
attachmentSizeLimit: number;
|
536
548
|
authorizingIntegrationOwners: AuthorizingIntegrationOwners;
|
537
549
|
channelID: string;
|
538
550
|
context?: InteractionContextTypes;
|
@@ -623,7 +635,9 @@ export interface JSONPublicThreadChannel extends JSONThreadChannel {
|
|
623
635
|
type: ChannelTypes.PUBLIC_THREAD;
|
624
636
|
}
|
625
637
|
export interface JSONRole extends JSONBase {
|
638
|
+
/** @deprecated */
|
626
639
|
color: number;
|
640
|
+
colors: RoleColors;
|
627
641
|
guildID: string;
|
628
642
|
hoist: boolean;
|
629
643
|
icon: string | null;
|
@@ -651,6 +665,16 @@ export interface JSONScheduledEvent extends JSONBase {
|
|
651
665
|
status: GuildScheduledEventStatuses;
|
652
666
|
userCount?: number;
|
653
667
|
}
|
668
|
+
export interface JSONSoundboard extends JSONBase {
|
669
|
+
available: boolean;
|
670
|
+
emojiID: string | null;
|
671
|
+
emojiName: string | null;
|
672
|
+
guildID?: string;
|
673
|
+
name: string;
|
674
|
+
soundID: string;
|
675
|
+
user?: JSONUser;
|
676
|
+
volume: number;
|
677
|
+
}
|
654
678
|
export interface JSONStageChannel extends JSONTextableVoiceChannel {
|
655
679
|
type: ChannelTypes.GUILD_STAGE_VOICE;
|
656
680
|
}
|
@@ -734,6 +758,7 @@ export interface JSONUser extends JSONBase {
|
|
734
758
|
avatarDecorationData: AvatarDecorationData | null;
|
735
759
|
banner?: string | null;
|
736
760
|
bot: boolean;
|
761
|
+
collectibles: Collectibles | null;
|
737
762
|
discriminator: string;
|
738
763
|
globalName: string | null;
|
739
764
|
publicFlags: number;
|
@@ -9,6 +9,7 @@ export interface RESTUser {
|
|
9
9
|
banner?: string | null;
|
10
10
|
bot?: boolean;
|
11
11
|
clan?: RawClan | null;
|
12
|
+
collectibles?: RawCollectibles | null;
|
12
13
|
discriminator: string;
|
13
14
|
email?: string | null;
|
14
15
|
flags?: number;
|
@@ -23,7 +24,7 @@ export interface RESTUser {
|
|
23
24
|
username: string;
|
24
25
|
verified?: boolean;
|
25
26
|
}
|
26
|
-
export interface RawUser extends Pick<RESTUser, "id" | "username" | "discriminator" | "avatar" | "avatar_decoration_data" | "bot" | "system" | "banner" | "accent_color" | "clan">, Required<Pick<RESTUser, "public_flags" | "global_name">> {}
|
27
|
+
export interface RawUser extends Pick<RESTUser, "id" | "username" | "discriminator" | "avatar" | "avatar_decoration_data" | "bot" | "system" | "banner" | "accent_color" | "clan" | "collectibles">, Required<Pick<RESTUser, "public_flags" | "global_name">> {}
|
27
28
|
export interface RawUserWithMember extends RawUser, Pick<RESTUser, "member"> {}
|
28
29
|
export interface RawOAuthUser extends Pick<RESTUser, "id" | "username" | "discriminator" | "avatar" | "avatar_decoration_data" | "bot" | "system" | "global_name">, Required<Pick<RESTUser, "banner" | "accent_color" | "locale" | "mfa_enabled" | "email" | "verified" | "flags" | "public_flags" | "clan">> {}
|
29
30
|
export interface RawExtendedUser extends Pick<RawOAuthUser, "avatar" | "avatar_decoration_data" | "bot" | "discriminator" | "email" | "flags" | "id" | "mfa_enabled" | "username" | "verified" | "global_name" | "clan"> {}
|
@@ -60,3 +61,27 @@ export interface AvatarDecorationData {
|
|
60
61
|
asset: string;
|
61
62
|
skuID: string;
|
62
63
|
}
|
64
|
+
|
65
|
+
export interface RawCollectibles {
|
66
|
+
nameplate?: RawNameplate;
|
67
|
+
}
|
68
|
+
|
69
|
+
export interface Collectibles {
|
70
|
+
nameplate?: Nameplate;
|
71
|
+
}
|
72
|
+
|
73
|
+
export interface RawNameplate {
|
74
|
+
asset: string;
|
75
|
+
label: string;
|
76
|
+
palette: NameplatePalette;
|
77
|
+
sku_id: string;
|
78
|
+
}
|
79
|
+
|
80
|
+
export interface Nameplate {
|
81
|
+
asset: string;
|
82
|
+
label: string;
|
83
|
+
palette: NameplatePalette;
|
84
|
+
skuID: string;
|
85
|
+
}
|
86
|
+
|
87
|
+
export type NameplatePalette = "crimson" | "berry" | "sky" | "teal" | "forest" | "bubble_gum" | "violet" | "cobalt" | "clover" | "lemon" | "white";
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/** @module Types/Webhooks */
|
2
|
-
import type { CreateMessageOptions, RawChannel } from "./channels";
|
2
|
+
import type { CreateMessageOptions, MessagePollOptions, RawChannel } from "./channels";
|
3
3
|
import type { RawGuild } from "./guilds";
|
4
4
|
import type { RawUser } from "./users";
|
5
5
|
import type { Nullable } from "./misc";
|
@@ -58,6 +58,7 @@ export interface ExecuteWebhookOptions extends Pick<CreateMessageOptions, "conte
|
|
58
58
|
username?: string;
|
59
59
|
/** If the created message should be returned. */
|
60
60
|
wait?: boolean;
|
61
|
+
withComponents?: boolean;
|
61
62
|
}
|
62
63
|
export interface ExecuteWebhookWaitOptions extends Omit<ExecuteWebhookOptions, "wait"> { wait: true; }
|
63
64
|
|
@@ -66,7 +67,10 @@ export interface GetWebhookMessageOptions {
|
|
66
67
|
threadID?: string;
|
67
68
|
}
|
68
69
|
|
69
|
-
export interface EditWebhookMessageOptions extends Nullable<Pick<ExecuteWebhookOptions, "content" | "embeds" | "allowedMentions" | "components" | "attachments" | "threadID" | "files">> {
|
70
|
+
export interface EditWebhookMessageOptions extends Nullable<Pick<ExecuteWebhookOptions, "content" | "embeds" | "allowedMentions" | "components" | "attachments" | "threadID" | "files" | "flags">> {
|
71
|
+
/** Polls can only be added when editing a deferred interaction response. */
|
72
|
+
poll?: MessagePollOptions;
|
73
|
+
}
|
70
74
|
|
71
75
|
export interface DeleteWebhookMessageOptions {
|
72
76
|
/** The id of the thread the message is in. */
|