oceanic.js 1.11.3-dev.078cc2b → 1.11.3-dev.22102c1

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.
Files changed (77) hide show
  1. package/README.md +0 -1
  2. package/dist/lib/Client.js +3 -1
  3. package/dist/lib/Constants.d.ts +61 -8
  4. package/dist/lib/Constants.js +70 -4
  5. package/dist/lib/gateway/Shard.d.ts +4 -1
  6. package/dist/lib/gateway/Shard.js +27 -7
  7. package/dist/lib/gateway/ShardManager.js +2 -2
  8. package/dist/lib/gateway/compression/base.d.ts +1 -0
  9. package/dist/lib/gateway/compression/pako.d.ts +1 -0
  10. package/dist/lib/gateway/compression/zlib-sync.d.ts +1 -0
  11. package/dist/lib/gateway/compression/zstd.d.ts +2 -5
  12. package/dist/lib/gateway/compression/zstd.js +5 -18
  13. package/dist/lib/gateway/events.d.ts +5 -0
  14. package/dist/lib/gateway/events.js +47 -4
  15. package/dist/lib/index.d.ts +1 -0
  16. package/dist/lib/index.js +4 -2
  17. package/dist/lib/routes/Applications.d.ts +20 -1
  18. package/dist/lib/routes/Applications.js +66 -4
  19. package/dist/lib/routes/Channels.d.ts +9 -1
  20. package/dist/lib/routes/Channels.js +21 -4
  21. package/dist/lib/routes/Guilds.d.ts +43 -1
  22. package/dist/lib/routes/Guilds.js +91 -2
  23. package/dist/lib/routes/Interactions.d.ts +5 -3
  24. package/dist/lib/routes/Interactions.js +35 -11
  25. package/dist/lib/routes/Miscellaneous.d.ts +6 -0
  26. package/dist/lib/routes/Miscellaneous.js +12 -1
  27. package/dist/lib/routes/Webhooks.js +14 -2
  28. package/dist/lib/structures/Application.d.ts +7 -1
  29. package/dist/lib/structures/Application.js +10 -1
  30. package/dist/lib/structures/ApplicationCommand.d.ts +3 -1
  31. package/dist/lib/structures/ApplicationCommand.js +5 -1
  32. package/dist/lib/structures/Attachment.d.ts +8 -0
  33. package/dist/lib/structures/Attachment.js +11 -1
  34. package/dist/lib/structures/AutocompleteInteraction.d.ts +2 -2
  35. package/dist/lib/structures/AutocompleteInteraction.js +2 -2
  36. package/dist/lib/structures/ClientApplication.d.ts +6 -1
  37. package/dist/lib/structures/ClientApplication.js +8 -1
  38. package/dist/lib/structures/CommandInteraction.d.ts +15 -12
  39. package/dist/lib/structures/CommandInteraction.js +26 -23
  40. package/dist/lib/structures/ComponentInteraction.d.ts +15 -14
  41. package/dist/lib/structures/ComponentInteraction.js +24 -25
  42. package/dist/lib/structures/Entitlement.d.ts +2 -2
  43. package/dist/lib/structures/Entitlement.js +5 -5
  44. package/dist/lib/structures/Guild.d.ts +32 -2
  45. package/dist/lib/structures/Guild.js +41 -1
  46. package/dist/lib/structures/Message.d.ts +3 -3
  47. package/dist/lib/structures/Message.js +25 -16
  48. package/dist/lib/structures/ModalSubmitInteraction.d.ts +14 -13
  49. package/dist/lib/structures/ModalSubmitInteraction.js +22 -18
  50. package/dist/lib/structures/PingInteraction.d.ts +2 -2
  51. package/dist/lib/structures/PingInteraction.js +2 -2
  52. package/dist/lib/structures/Soundboard.d.ts +42 -0
  53. package/dist/lib/structures/Soundboard.js +73 -0
  54. package/dist/lib/structures/Subscription.d.ts +25 -0
  55. package/dist/lib/structures/Subscription.js +38 -0
  56. package/dist/lib/types/applications.d.ts +89 -8
  57. package/dist/lib/types/channels.d.ts +351 -188
  58. package/dist/lib/types/client.d.ts +8 -2
  59. package/dist/lib/types/events.d.ts +15 -3
  60. package/dist/lib/types/gateway-raw.d.ts +37 -2
  61. package/dist/lib/types/gateway.d.ts +10 -2
  62. package/dist/lib/types/guilds.d.ts +28 -0
  63. package/dist/lib/types/interactions.d.ts +64 -7
  64. package/dist/lib/types/json.d.ts +23 -6
  65. package/dist/lib/types/webhooks.d.ts +6 -2
  66. package/dist/lib/util/Errors.d.ts +4 -0
  67. package/dist/lib/util/Errors.js +9 -2
  68. package/dist/lib/util/Routes.d.ts +7 -0
  69. package/dist/lib/util/Routes.js +18 -5
  70. package/dist/lib/util/Util.d.ts +10 -6
  71. package/dist/lib/util/Util.js +99 -12
  72. package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +5 -2
  73. package/dist/lib/util/interactions/MessageInteractionResponse.js +9 -7
  74. package/dist/package.json +21 -21
  75. package/esm.mjs +2 -0
  76. package/package.json +20 -21
  77. package/patches/typedoc-plugin-merge-modules@5.1.0.patch +1 -1
@@ -2,7 +2,7 @@
2
2
  import type { AllowedMentions } from "./channels";
3
3
  import type { GatewayOptions } from "./gateway";
4
4
  import type { ImageFormat } from "../Constants";
5
- import type { Agent } from "undici-types";
5
+ import type { Dispatcher } from "undici-types";
6
6
 
7
7
  export interface ClientOptions {
8
8
  /**
@@ -51,7 +51,7 @@ export interface RESTOptions {
51
51
  * The agent to use for requests.
52
52
  * @defaultValue null
53
53
  */
54
- agent?: Agent | null;
54
+ agent?: Dispatcher | null;
55
55
  /**
56
56
  * The base URL to use for requests - must be a fully qualified url.
57
57
  * @defaultValue https://discordapp.com/api/v\{REST_VERSION\}
@@ -201,6 +201,12 @@ export interface CollectionLimitsOptions {
201
201
  * @defaultValue Infinity
202
202
  */
203
203
  scheduledEvents?: number | Record<string, number>;
204
+ /**
205
+ * The maximum number of soundboard sounds to cache.
206
+ * @dictionaryKey guild id
207
+ * @defaultValue Infinity
208
+ */
209
+ soundboardSounds?: number | Record<string, number>;
204
210
  /**
205
211
  * The maximum number of stage instances to cache.
206
212
  * @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 `GUILD_EMOJIS_AND_STICKERS` intent. */
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 stickers are updated. Requires the `GUILD_EMOJIS_AND_STICKERS` intent. */
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";
@@ -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";
@@ -515,6 +542,14 @@ export interface InteractionCreatePacket extends BaseDispatchPacket {
515
542
  t: "INTERACTION_CREATE";
516
543
  }
517
544
 
545
+ export interface SoundboardSoundsPacket extends BaseDispatchPacket {
546
+ d: {
547
+ guild_id: string;
548
+ soundboard_sounds: Array<RawSoundboard>;
549
+ };
550
+ t: "SOUNDBOARD_SOUNDS";
551
+ }
552
+
518
553
  export interface StageInstanceCreatePacket extends BaseDispatchPacket {
519
554
  d: RawStageInstance;
520
555
  t: "STAGE_INSTANCE_CREATE";
@@ -578,10 +613,10 @@ ThreadCreatePacket | ThreadDeletePacket | ThreadUpdatePacket | ThreadListSyncPac
578
613
  GuildBanAddPacket | GuildBanRemovePacket | GuildEmojisUpdatePacket | GuildStickersUpdatePacket | GuildIntegrationsUpdatePacket |
579
614
  GuildMemberAddPacket | GuildMemberRemovePacket | GuildMemberUpdatePacket | GuildMembersChunkPacket |
580
615
  GuildRoleCreatePacket | GuildRoleDeletePacket | GuildRoleUpdatePacket |
581
- GuildScheduledEventCreatePacket | GuildScheduledEventDeletePacket | GuildScheduledEventUpdatePacket | GuildScheduledEventUserAddPacket | GuildScheduledEventUserRemovePacket |
616
+ GuildScheduledEventCreatePacket | GuildScheduledEventDeletePacket | GuildScheduledEventUpdatePacket | GuildScheduledEventUserAddPacket | GuildScheduledEventUserRemovePacket | GuildSoundboardSoundCreatePacket | GuildSoundboardSoundDeletePacket | GuildSoundboardSoundUpdatePacket | GuildSoundboardSoundsUpdatePacket |
582
617
  IntegrationCreatePacket | IntegrationDeletePacket | IntegrationUpdatePacket |
583
618
  InviteCreatePacket | InviteDeletePacket |
584
619
  MessageCreatePacket | MessageDeletePacket | MessageDeleteBulkPacket | MessageUpdatePacket | MessageReactionAddPacket | MessageReactionRemovePacket | MessageReactionRemoveAllPacket | MessageReactionRemoveEmojiPacket |
585
- TypingStartPacket | UserUpdatePacket | VoiceStateUpdatePacket | VoiceChannelEffectSendPacket | VoiceChannelStatusUpdatePacket | VoiceServerUpdatePacket | WebhooksUpdatePacket | InteractionCreatePacket | StageInstanceCreatePacket | StageInstanceDeletePacket | StageInstanceUpdatePacket |
620
+ TypingStartPacket | UserUpdatePacket | VoiceStateUpdatePacket | VoiceChannelEffectSendPacket | VoiceChannelStatusUpdatePacket | VoiceServerUpdatePacket | WebhooksUpdatePacket | InteractionCreatePacket | SoundboardSoundsPacket | StageInstanceCreatePacket | StageInstanceDeletePacket | StageInstanceUpdatePacket |
586
621
  EntitlementCreatePacket | EntitlementUpdatePacket | EntitlementDeletePacket |
587
622
  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";
@@ -683,6 +683,34 @@ export interface EditMFALevelOptions {
683
683
  reason?: string;
684
684
  }
685
685
 
686
+ export interface CreateSoundboardSoundOptions {
687
+ /** The ID of the emoji of the soundboard sound. */
688
+ emojiID?: string;
689
+ /** The name of the emoji of the soundboard sound. */
690
+ emojiName?: string;
691
+ /** The name of the soundboard sound. */
692
+ name: string;
693
+ /** The reason for creating the soundboard sound. */
694
+ reason?: string;
695
+ /** The mp3 or ogg sound data. */
696
+ sound: Buffer | string;
697
+ /** The volume of the soundboard sound. */
698
+ volume?: number;
699
+ }
700
+
701
+ export interface EditSoundboardSoundOptions {
702
+ /** The ID of the emoji of the soundboard sound. */
703
+ emojiID?: string;
704
+ /** The name of the emoji of the soundboard sound. */
705
+ emojiName?: string;
706
+ /** The name of the soundboard sound. */
707
+ name?: string;
708
+ /** The reason for editing the soundboard sound. */
709
+ reason?: string;
710
+ /** The volume of the soundboard sound. */
711
+ volume?: number;
712
+ }
713
+
686
714
  export interface CreateStickerOptions {
687
715
  /** The description of the sticker. */
688
716
  description: string;
@@ -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" | "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<ModalActionRow>;
91
+ components: Array<ModalComponent>;
90
92
  /** The custom ID of the modal. */
91
93
  customID: string;
92
94
  /** The title of the modal. */
@@ -375,3 +377,58 @@ export type ModalSubmitComponents = ModalSubmitTextInputComponent;
375
377
  export interface ModalSubmitTextInputComponent extends ModalSubmitComponentsStringValue<ComponentTypes.TEXT_INPUT> {}
376
378
 
377
379
  export type ApplicationCommandTypesWithTarget = ApplicationCommandTypes.USER | ApplicationCommandTypes.MESSAGE;
380
+
381
+ export interface RawInteractionCallbackResponse {
382
+ interaction: RawInteractionCallback;
383
+ resource?: RawInteractionCallbackResource;
384
+ }
385
+
386
+ export interface RawInteractionCallback {
387
+ activity_instance_id?: string;
388
+ id: string;
389
+ response_message_ephemeral?: boolean;
390
+ response_message_id?: string;
391
+ response_message_loading?: boolean;
392
+ type: InteractionTypes;
393
+ }
394
+
395
+ export interface RawInteractionCallbackResource {
396
+ activity_instance?: Array<InteractionCallbackActivityInstance>;
397
+ message?: RawMessage;
398
+ type: InteractionResponseTypes;
399
+ }
400
+
401
+ export interface InteractionCallbackActivityInstance {
402
+ /** Instance ID of the Activity if one was launched or joined. */
403
+ id: string;
404
+ }
405
+
406
+ export interface InteractionCallbackResponse<CH extends AnyInteractionChannel | Uncached = AnyInteractionChannel | Uncached> {
407
+ /** The interaction object associated with the interaction response. */
408
+ interaction: InteractionCallback;
409
+ /** The resource that was created by the interaction response. */
410
+ resource?: InteractionCallbackResource<CH>;
411
+ }
412
+
413
+ export interface InteractionCallback {
414
+ /** Instance ID of the Activity if one was launched or joined. */
415
+ activityInstanceID?: string;
416
+ /** ID of the interaction. */
417
+ id: string;
418
+ /** Whether or not the response message was ephemeral. */
419
+ responseMessageEphemeral?: boolean;
420
+ /** ID of the message that was created by the interaction. */
421
+ responseMessageID?: string;
422
+ /** Whether or not the message is in a loading state. */
423
+ responseMessageLoading?: boolean;
424
+ /** Interaction type. */
425
+ type: InteractionTypes;
426
+ }
427
+
428
+ export interface InteractionCallbackResource<CH extends AnyInteractionChannel | Uncached = AnyInteractionChannel | Uncached> {
429
+ /** Represents the Activity launched by this interaction. Only present if type is `LAUNCH_ACTIVITY`. */
430
+ activityInstance?: Array<InteractionCallbackActivityInstance>;
431
+ /** Message created by the interaction. Only present if type is either `CHANNEL_MESSAGE_WITH_SOURCE` or `UPDATE_MESSAGE`. */
432
+ message?: Message<CH>;
433
+ type: InteractionResponseTypes;
434
+ }
@@ -33,7 +33,6 @@ import type {
33
33
  PrivateThreadMetadata,
34
34
  ForumTag,
35
35
  ForumEmoji,
36
- MessageActionRow,
37
36
  Embed,
38
37
  GuildChannels,
39
38
  TextableGuildChannels,
@@ -43,7 +42,8 @@ import type {
43
42
  PollQuestion,
44
43
  PollResults,
45
44
  PollAnswer,
46
- MessagePollResults
45
+ MessagePollResults,
46
+ MessageComponent
47
47
  } from "./channels";
48
48
  import type { ScheduledEventEntityMetadata } from "./scheduled-events";
49
49
  import type { AvatarDecorationData } from "./users";
@@ -84,7 +84,8 @@ import type {
84
84
  ApplicationMonetizationState,
85
85
  RPCApplicationState,
86
86
  StoreApplicationState,
87
- ApplicationVerificationState
87
+ ApplicationVerificationState,
88
+ EntryPointCommandHandlerTypes
88
89
  } from "../Constants";
89
90
 
90
91
  export interface JSONAnnouncementChannel extends JSONThreadableChannel {
@@ -143,6 +144,7 @@ export interface JSONApplicationCommand extends JSONBase {
143
144
  descriptionLocalizations?: LocaleMap | null;
144
145
  dmPermission?: boolean;
145
146
  guildID?: string;
147
+ handler?: EntryPointCommandHandlerTypes;
146
148
  integrationTypes: Array<ApplicationIntegrationTypes>;
147
149
  name: string;
148
150
  nameLocalizations?: LocaleMap | null;
@@ -256,8 +258,8 @@ export interface JSONComponentInteraction extends JSONInteraction {
256
258
  user: JSONUser;
257
259
  }
258
260
  export interface JSONEntitlement extends JSONBaseEntitlement {
259
- endsAt: number;
260
- startsAt: number;
261
+ endsAt: number | null;
262
+ startsAt: number | null;
261
263
  subscriptionID: string;
262
264
  }
263
265
  export interface JSONDiscordHTTPError {
@@ -462,12 +464,13 @@ export interface JSONMessage extends JSONBase {
462
464
  attachments: Array<JSONAttachment>;
463
465
  author: JSONUser;
464
466
  channelID: string;
465
- components?: Array<MessageActionRow>;
467
+ components?: Array<MessageComponent>;
466
468
  content: string;
467
469
  editedTimestamp: number | null;
468
470
  embeds: Array<Embed>;
469
471
  flags?: number;
470
472
  guildID?: string;
473
+ /** @deprecated Use {@link JSON/JSONMessage#interactionMetadata | JSONMessage#interactionMetadata } instead. */
471
474
  interaction?: {
472
475
  id: string;
473
476
  member?: JSONMember;
@@ -481,11 +484,15 @@ export interface JSONMessage extends JSONBase {
481
484
  interactedMessageID?: string;
482
485
  name?: string;
483
486
  originalResponseMessageID?: string;
487
+ targetMessageID?: string;
488
+ targetUser?: JSONUser;
484
489
  triggeringInteractionMetadata?: {
485
490
  authorizingIntegrationOwners: AuthorizingIntegrationOwners;
486
491
  id: string;
487
492
  interactedMessageID?: string;
488
493
  originalResponseMessageID?: string;
494
+ targetMessageID?: string;
495
+ targetUser?: JSONUser;
489
496
  type: InteractionTypes;
490
497
  user: JSONUser;
491
498
  };
@@ -651,6 +658,16 @@ export interface JSONScheduledEvent extends JSONBase {
651
658
  status: GuildScheduledEventStatuses;
652
659
  userCount?: number;
653
660
  }
661
+ export interface JSONSoundboard extends JSONBase {
662
+ available: boolean;
663
+ emojiID: string | null;
664
+ emojiName: string | null;
665
+ guildID?: string;
666
+ name: string;
667
+ soundID: string;
668
+ user?: JSONUser;
669
+ volume: number;
670
+ }
654
671
  export interface JSONStageChannel extends JSONTextableVoiceChannel {
655
672
  type: ChannelTypes.GUILD_STAGE_VOICE;
656
673
  }
@@ -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">> {
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. */
@@ -32,3 +32,7 @@ export declare class RateLimitedError extends Error {
32
32
  name: string;
33
33
  constructor(message: string, delay: number);
34
34
  }
35
+ export declare class NotImplementedError extends Error {
36
+ name: string;
37
+ constructor(message?: string);
38
+ }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /** @module Errors */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.RateLimitedError = exports.GatewayError = exports.DependencyError = exports.WrapperError = exports.UncachedError = exports.UncaughtError = void 0;
4
+ exports.NotImplementedError = exports.RateLimitedError = exports.GatewayError = exports.DependencyError = exports.WrapperError = exports.UncachedError = exports.UncaughtError = void 0;
5
5
  /** An error that is thrown when we encounter an error, and no `error` listeners are present. */
6
6
  class UncaughtError extends Error {
7
7
  name = "UncaughtError";
@@ -62,4 +62,11 @@ class RateLimitedError extends Error {
62
62
  }
63
63
  }
64
64
  exports.RateLimitedError = RateLimitedError;
65
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3V0aWwvRXJyb3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxxQkFBcUI7OztBQU1yQixnR0FBZ0c7QUFDaEc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1FBQ3ZCLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUNuQixDQUFDO0NBQ0o7QUFMRCxvQ0FLQztBQUVELGdFQUFnRTtBQUNoRSxNQUFhLGVBQWdCLFNBQVEsS0FBSztJQUM3QixJQUFJLEdBQUcsaUJBQWlCLENBQUM7SUFDbEMsWUFBWSxPQUFlO1FBQ3ZCLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUNuQixDQUFDO0NBQ0o7QUFMRCwwQ0FLQztBQUdELHVCQUF1QjtBQUN2QixNQUFhLFlBQWEsU0FBUSxLQUFLO0lBQ25DLElBQUksQ0FBUztJQUNKLElBQUksR0FBRyxjQUFjLENBQUM7SUFDL0IsWUFBWSxPQUFlLEVBQUUsSUFBWTtRQUNyQyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDZixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztJQUNyQixDQUFDO0NBQ0o7QUFQRCxvQ0FPQztBQUVELE1BQWEsZ0JBQWlCLFNBQVEsS0FBSztJQUN2QyxLQUFLLENBQVM7SUFDTCxJQUFJLEdBQUcsa0JBQWtCLENBQUM7SUFDbkMsWUFBWSxPQUFlLEVBQUUsS0FBYTtRQUN0QyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDZixJQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQztJQUN2QixDQUFDO0NBQ0o7QUFQRCw0Q0FPQyJ9
65
+ class NotImplementedError extends Error {
66
+ name = "NotImplementedError";
67
+ constructor(message = "Not implemented") {
68
+ super(message);
69
+ }
70
+ }
71
+ exports.NotImplementedError = NotImplementedError;
72
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3V0aWwvRXJyb3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ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: (guildID: string) => string;
46
46
  export declare const GUILD_ONBOARDING: (guildID: string) => string;
47
47
  export declare const GUILD_INCIDENT_ACTIONS: (guildID: string) => string;
48
48
  export declare const GUILD_BULK_BAN: (guildID: string) => string;
49
+ export declare const SOUNDBOARD_SOUNDS: (guildID: string) => string;
50
+ export declare const SOUNDBOARD_SOUND: (guildID: string, soundID: string) => string;
49
51
  export declare const CHANNEL: (channelID: string) => string;
50
52
  export declare const CHANNEL_BULK_DELETE_MESSAGES: (channelID: string) => string;
51
53
  export declare const CHANNEL_FOLLOWERS: (channelID: string) => string;
@@ -74,6 +76,7 @@ export declare const GUILD_VOICE_REGIONS: (guildID: string) => string;
74
76
  export declare const VOICE_STATUS: (channelID: string) => string;
75
77
  export declare const POLL_ANSWER_USERS: (channelID: string, pollID: string, answerID: number) => string;
76
78
  export declare const POLL_EXPIRE: (channelID: string, pollID: string) => string;
79
+ export declare const SEND_SOUNDBOARD_SOUND: (channelID: string) => string;
77
80
  export declare const OAUTH_APPLICATION = "/oauth2/applications/@me";
78
81
  export declare const OAUTH_AUTHORIZE = "/oauth2/authorize";
79
82
  export declare const OAUTH_INFO = "/oauth2/@me";
@@ -121,14 +124,18 @@ export declare const ENTITLEMENTS: (applicationID: string) => string;
121
124
  export declare const ENTITLEMENT: (applicationID: string, entitlementID: string) => string;
122
125
  export declare const CONSUME_ENTITLEMENT: (applicationID: string, entitlementID: string) => string;
123
126
  export declare const SKUS: (applicationID: string) => string;
127
+ export declare const SKU_SUBSCRIPTIONS: (skuID: string) => string;
128
+ export declare const SKU_SUBSCRIPTION: (skuID: string, subscriptionID: string) => string;
124
129
  export declare const APPLICATION_EMOJIS: (applicationID: string) => string;
125
130
  export declare const APPLICATION_EMOJI: (applicationID: string, emojiID: string) => string;
131
+ export declare const APPLICATION_ACTIVITY_INSTANCE: (applicationID: string, instanceID: string) => string;
126
132
  export declare const GATEWAY = "/gateway";
127
133
  export declare const GATEWAY_BOT = "/gateway/bot";
128
134
  export declare const USER: (userID: string) => string;
129
135
  export declare const MESSAGE_LINK: (guildID: string, channelID: string, messageID: string) => string;
130
136
  export declare const STICKER_PACKS = "/sticker-packs";
131
137
  export declare const INVITE: (code: string) => string;
138
+ export declare const SOUNDBOARD_DEFAULT_SOUNDS = "/soundboard-default-sounds";
132
139
  export declare const STAGE_INSTANCES = "/stage-instances";
133
140
  export declare const STAGE_INSTANCE: (channelID: string) => string;
134
141
  export declare const REFRESH_ATTACHMENT_URLS = "/attachments/refresh-urls";