oceanic.js 1.11.3-dev.fb35174 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +0 -1
  2. package/dist/lib/Client.js +3 -1
  3. package/dist/lib/Constants.d.ts +68 -11
  4. package/dist/lib/Constants.js +78 -8
  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/zlib-sync.js +2 -2
  9. package/dist/lib/gateway/compression/zstd.d.ts +1 -5
  10. package/dist/lib/gateway/compression/zstd.js +5 -18
  11. package/dist/lib/gateway/events.d.ts +5 -0
  12. package/dist/lib/gateway/events.js +46 -3
  13. package/dist/lib/index.d.ts +1 -0
  14. package/dist/lib/index.js +4 -2
  15. package/dist/lib/rest/RequestHandler.js +2 -2
  16. package/dist/lib/routes/Applications.d.ts +20 -1
  17. package/dist/lib/routes/Applications.js +66 -4
  18. package/dist/lib/routes/Channels.d.ts +9 -1
  19. package/dist/lib/routes/Channels.js +19 -2
  20. package/dist/lib/routes/Guilds.d.ts +42 -1
  21. package/dist/lib/routes/Guilds.js +90 -1
  22. package/dist/lib/routes/Interactions.d.ts +5 -3
  23. package/dist/lib/routes/Interactions.js +35 -11
  24. package/dist/lib/routes/Miscellaneous.d.ts +6 -0
  25. package/dist/lib/routes/Miscellaneous.js +12 -1
  26. package/dist/lib/routes/Webhooks.js +14 -2
  27. package/dist/lib/structures/Application.d.ts +7 -1
  28. package/dist/lib/structures/Application.js +10 -1
  29. package/dist/lib/structures/ApplicationCommand.d.ts +3 -1
  30. package/dist/lib/structures/ApplicationCommand.js +5 -1
  31. package/dist/lib/structures/Attachment.d.ts +8 -0
  32. package/dist/lib/structures/Attachment.js +11 -1
  33. package/dist/lib/structures/AutocompleteInteraction.d.ts +4 -2
  34. package/dist/lib/structures/AutocompleteInteraction.js +6 -2
  35. package/dist/lib/structures/ClientApplication.d.ts +6 -1
  36. package/dist/lib/structures/ClientApplication.js +8 -1
  37. package/dist/lib/structures/CommandInteraction.d.ts +17 -12
  38. package/dist/lib/structures/CommandInteraction.js +30 -23
  39. package/dist/lib/structures/ComponentInteraction.d.ts +17 -14
  40. package/dist/lib/structures/ComponentInteraction.js +28 -25
  41. package/dist/lib/structures/Entitlement.d.ts +2 -2
  42. package/dist/lib/structures/Entitlement.js +5 -5
  43. package/dist/lib/structures/Guild.d.ts +31 -2
  44. package/dist/lib/structures/Guild.js +41 -1
  45. package/dist/lib/structures/Invite.d.ts +3 -1
  46. package/dist/lib/structures/Invite.js +4 -1
  47. package/dist/lib/structures/Message.d.ts +3 -3
  48. package/dist/lib/structures/Message.js +25 -16
  49. package/dist/lib/structures/ModalSubmitInteraction.d.ts +16 -13
  50. package/dist/lib/structures/ModalSubmitInteraction.js +26 -18
  51. package/dist/lib/structures/PingInteraction.d.ts +2 -2
  52. package/dist/lib/structures/PingInteraction.js +2 -2
  53. package/dist/lib/structures/Soundboard.d.ts +42 -0
  54. package/dist/lib/structures/Soundboard.js +73 -0
  55. package/dist/lib/structures/Subscription.d.ts +25 -0
  56. package/dist/lib/structures/Subscription.js +38 -0
  57. package/dist/lib/structures/User.d.ts +0 -5
  58. package/dist/lib/structures/User.js +1 -7
  59. package/dist/lib/types/applications.d.ts +89 -8
  60. package/dist/lib/types/channels.d.ts +354 -189
  61. package/dist/lib/types/client.d.ts +7 -2
  62. package/dist/lib/types/events.d.ts +15 -3
  63. package/dist/lib/types/gateway-raw.d.ts +39 -3
  64. package/dist/lib/types/gateway.d.ts +10 -2
  65. package/dist/lib/types/guilds.d.ts +28 -0
  66. package/dist/lib/types/interactions.d.ts +65 -7
  67. package/dist/lib/types/json.d.ts +27 -6
  68. package/dist/lib/types/webhooks.d.ts +6 -2
  69. package/dist/lib/util/Errors.d.ts +4 -0
  70. package/dist/lib/util/Errors.js +9 -2
  71. package/dist/lib/util/Routes.d.ts +7 -2
  72. package/dist/lib/util/Routes.js +18 -8
  73. package/dist/lib/util/Util.d.ts +9 -6
  74. package/dist/lib/util/Util.js +99 -12
  75. package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +5 -2
  76. package/dist/lib/util/interactions/MessageInteractionResponse.js +9 -7
  77. package/dist/package.json +6 -7
  78. package/esm.mjs +2 -0
  79. package/package.json +6 -7
@@ -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
- * @note This currently defaults to Infinity for backwards compatibility, but this will be changed in 1.12.0.
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 `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";
@@ -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";
@@ -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. */
@@ -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
+ }
@@ -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;
@@ -166,6 +168,7 @@ export interface JSONAttachment extends JSONBase {
166
168
  }
167
169
  export interface JSONAutocompleteInteraction extends JSONInteraction {
168
170
  appPermissions: JSONPermission;
171
+ attachmentSizeLimit: number;
169
172
  authorizingIntegrationOwners: AuthorizingIntegrationOwners;
170
173
  channelID: string;
171
174
  context?: InteractionContextTypes;
@@ -231,6 +234,7 @@ export interface JSONClientUser extends JSONUser {
231
234
  }
232
235
  export interface JSONCommandInteraction extends JSONInteraction {
233
236
  appPermissions: JSONPermission;
237
+ attachmentSizeLimit: number;
234
238
  authorizingIntegrationOwners: AuthorizingIntegrationOwners;
235
239
  channelID: string;
236
240
  context?: InteractionContextTypes;
@@ -244,6 +248,7 @@ export interface JSONCommandInteraction extends JSONInteraction {
244
248
  }
245
249
  export interface JSONComponentInteraction extends JSONInteraction {
246
250
  appPermissions: JSONPermission;
251
+ attachmentSizeLimit: number;
247
252
  authorizingIntegrationOwners: AuthorizingIntegrationOwners;
248
253
  channelID: string;
249
254
  context?: InteractionContextTypes;
@@ -256,8 +261,8 @@ export interface JSONComponentInteraction extends JSONInteraction {
256
261
  user: JSONUser;
257
262
  }
258
263
  export interface JSONEntitlement extends JSONBaseEntitlement {
259
- endsAt: number;
260
- startsAt: number;
264
+ endsAt: number | null;
265
+ startsAt: number | null;
261
266
  subscriptionID: string;
262
267
  }
263
268
  export interface JSONDiscordHTTPError {
@@ -462,12 +467,13 @@ export interface JSONMessage extends JSONBase {
462
467
  attachments: Array<JSONAttachment>;
463
468
  author: JSONUser;
464
469
  channelID: string;
465
- components?: Array<MessageActionRow>;
470
+ components?: Array<MessageComponent>;
466
471
  content: string;
467
472
  editedTimestamp: number | null;
468
473
  embeds: Array<Embed>;
469
474
  flags?: number;
470
475
  guildID?: string;
476
+ /** @deprecated Use {@link JSON/JSONMessage#interactionMetadata | JSONMessage#interactionMetadata } instead. */
471
477
  interaction?: {
472
478
  id: string;
473
479
  member?: JSONMember;
@@ -481,11 +487,15 @@ export interface JSONMessage extends JSONBase {
481
487
  interactedMessageID?: string;
482
488
  name?: string;
483
489
  originalResponseMessageID?: string;
490
+ targetMessageID?: string;
491
+ targetUser?: JSONUser;
484
492
  triggeringInteractionMetadata?: {
485
493
  authorizingIntegrationOwners: AuthorizingIntegrationOwners;
486
494
  id: string;
487
495
  interactedMessageID?: string;
488
496
  originalResponseMessageID?: string;
497
+ targetMessageID?: string;
498
+ targetUser?: JSONUser;
489
499
  type: InteractionTypes;
490
500
  user: JSONUser;
491
501
  };
@@ -533,6 +543,7 @@ export interface JSONMessage extends JSONBase {
533
543
  }
534
544
  export interface JSONModalSubmitInteraction extends JSONInteraction {
535
545
  appPermissions: JSONPermission;
546
+ attachmentSizeLimit: number;
536
547
  authorizingIntegrationOwners: AuthorizingIntegrationOwners;
537
548
  channelID: string;
538
549
  context?: InteractionContextTypes;
@@ -651,6 +662,16 @@ export interface JSONScheduledEvent extends JSONBase {
651
662
  status: GuildScheduledEventStatuses;
652
663
  userCount?: number;
653
664
  }
665
+ export interface JSONSoundboard extends JSONBase {
666
+ available: boolean;
667
+ emojiID: string | null;
668
+ emojiName: string | null;
669
+ guildID?: string;
670
+ name: string;
671
+ soundID: string;
672
+ user?: JSONUser;
673
+ volume: number;
674
+ }
654
675
  export interface JSONStageChannel extends JSONTextableVoiceChannel {
655
676
  type: ChannelTypes.GUILD_STAGE_VOICE;
656
677
  }
@@ -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
- //# sourceMapping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QUFVLENBQUM7UUFDeE4sQ0FBQztRQUVELEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUNuQixDQUFDO0NBQ0o7QUFkRCxzQ0FjQztBQUVELDZKQUE2SjtBQUM3SixNQUFhLFlBQWEsU0FBUSxLQUFLO0lBQzFCLElBQUksR0FBRyxjQUFjLENBQUM7SUFDL0IsWUFBWSxPQUFlO1FBQ3ZCLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUNuQixDQUFDO0NBQ0o7QUFMRCxvQ0FLQztBQUVELGdFQUFnRTtBQUNoRSxNQUFhLGVBQWdCLFNBQVEsS0FBSztJQUM3QixJQUFJLEdBQUcsaUJBQWlCLENBQUM7SUFDbEMsWUFBWSxPQUFlO1FBQ3ZCLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUNuQixDQUFDO0NBQ0o7QUFMRCwwQ0FLQztBQUdELHVCQUF1QjtBQUN2QixNQUFhLFlBQWEsU0FBUSxLQUFLO0lBQ25DLElBQUksQ0FBUztJQUNKLElBQUksR0FBRyxjQUFjLENBQUM7SUFDL0IsWUFBWSxPQUFlLEVBQUUsSUFBWTtRQUNyQyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDZixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztJQUNyQixDQUFDO0NBQ0o7QUFQRCxvQ0FPQztBQUVELE1BQWEsZ0JBQWlCLFNBQVEsS0FBSztJQUN2QyxLQUFLLENBQVM7SUFDTCxJQUFJLEdBQUcsa0JBQWtCLENBQUM7SUFDbkMsWUFBWSxPQUFlLEVBQUUsS0FBYTtRQUN0QyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDZixJQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQztJQUN2QixDQUFDO0NBQ0o7QUFQRCw0Q0FPQyJ9
65
+ class NotImplementedError extends Error {
66
+ name = "NotImplementedError";
67
+ constructor(message = "Not implemented") {
68
+ super(message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JBQW9CLFNBQVEsS0FBSztJQUNqQyxJQUFJLEdBQUcscUJBQXFCLENBQUM7SUFDdEMsWUFBWSxPQUFPLEdBQUcsaUJBQWlCO1FBQ25DLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUNuQixDQUFDO0NBQ0o7QUFMRCxrREFLQyJ9
@@ -46,6 +46,8 @@ export declare const GUILD_STICKERS: (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";
@@ -107,8 +110,6 @@ export declare const STICKER_PACK_BANNER: (assetID: string) => string;
107
110
  export declare const TEAM_ICON: (teamID: string, hash: string) => string;
108
111
  export declare const USER_AVATAR: (userID: string, hash: string) => string;
109
112
  export declare const AVATAR_DECORATION: (hash: string) => string;
110
- /** @deprecated Use {@link Routes~AVATAR_DECORATION | AVATAR_DECORATION} instead. This will be removed in 1.12.0. */
111
- export declare const USER_AVATAR_DECORATION: (_userID: string, hash: string) => string;
112
113
  export declare const APPLICATION_COMMAND: (applicationID: string, commandID: string) => string;
113
114
  export declare const APPLICATION_COMMANDS: (applicationID: string) => string;
114
115
  export declare const GUILD_APPLICATION_COMMAND: (applicationID: string, guildID: string, commandID: string) => string;
@@ -121,14 +122,18 @@ export declare const ENTITLEMENTS: (applicationID: string) => string;
121
122
  export declare const ENTITLEMENT: (applicationID: string, entitlementID: string) => string;
122
123
  export declare const CONSUME_ENTITLEMENT: (applicationID: string, entitlementID: string) => string;
123
124
  export declare const SKUS: (applicationID: string) => string;
125
+ export declare const SKU_SUBSCRIPTIONS: (skuID: string) => string;
126
+ export declare const SKU_SUBSCRIPTION: (skuID: string, subscriptionID: string) => string;
124
127
  export declare const APPLICATION_EMOJIS: (applicationID: string) => string;
125
128
  export declare const APPLICATION_EMOJI: (applicationID: string, emojiID: string) => string;
129
+ export declare const APPLICATION_ACTIVITY_INSTANCE: (applicationID: string, instanceID: string) => string;
126
130
  export declare const GATEWAY = "/gateway";
127
131
  export declare const GATEWAY_BOT = "/gateway/bot";
128
132
  export declare const USER: (userID: string) => string;
129
133
  export declare const MESSAGE_LINK: (guildID: string, channelID: string, messageID: string) => string;
130
134
  export declare const STICKER_PACKS = "/sticker-packs";
131
135
  export declare const INVITE: (code: string) => string;
136
+ export declare const SOUNDBOARD_DEFAULT_SOUNDS = "/soundboard-default-sounds";
132
137
  export declare const STAGE_INSTANCES = "/stage-instances";
133
138
  export declare const STAGE_INSTANCE: (channelID: string) => string;
134
139
  export declare const REFRESH_ATTACHMENT_URLS = "/attachments/refresh-urls";