disgroove 2.2.4-dev.e509559 → 2.2.5-dev.3beface

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 (39) hide show
  1. package/README.md +1 -0
  2. package/dist/lib/Client.d.ts +76 -9
  3. package/dist/lib/Client.js +248 -77
  4. package/dist/lib/constants.d.ts +78 -10
  5. package/dist/lib/constants.js +79 -6
  6. package/dist/lib/gateway/Shard.d.ts +3 -1
  7. package/dist/lib/gateway/Shard.js +51 -0
  8. package/dist/lib/rest/Endpoints.d.ts +9 -1
  9. package/dist/lib/rest/Endpoints.js +24 -4
  10. package/dist/lib/transformers/ApplicationCommands.js +2 -0
  11. package/dist/lib/transformers/Applications.js +2 -0
  12. package/dist/lib/transformers/Interactions.d.ts +3 -1
  13. package/dist/lib/transformers/Interactions.js +42 -0
  14. package/dist/lib/transformers/Soundboards.d.ts +5 -0
  15. package/dist/lib/transformers/Soundboards.js +31 -0
  16. package/dist/lib/transformers/Stickers.js +0 -2
  17. package/dist/lib/transformers/Subscriptions.d.ts +5 -0
  18. package/dist/lib/transformers/Subscriptions.js +32 -0
  19. package/dist/lib/transformers/index.d.ts +2 -0
  20. package/dist/lib/transformers/index.js +2 -0
  21. package/dist/lib/types/application-command.d.ts +3 -1
  22. package/dist/lib/types/application.d.ts +31 -1
  23. package/dist/lib/types/entitlements.d.ts +1 -1
  24. package/dist/lib/types/gateway-events.d.ts +43 -1
  25. package/dist/lib/types/guild.d.ts +2 -0
  26. package/dist/lib/types/interaction.d.ts +44 -0
  27. package/dist/lib/types/message.d.ts +26 -5
  28. package/dist/lib/types/sku.d.ts +1 -1
  29. package/dist/lib/types/soundboard.d.ts +23 -0
  30. package/dist/lib/types/soundboard.js +2 -0
  31. package/dist/lib/types/sticker.d.ts +0 -2
  32. package/dist/lib/types/subscription.d.ts +25 -0
  33. package/dist/lib/types/subscription.js +2 -0
  34. package/dist/lib/utils/CDN.d.ts +1 -0
  35. package/dist/lib/utils/CDN.js +3 -1
  36. package/dist/lib/utils/formatters.d.ts +2 -2
  37. package/dist/lib/utils/formatters.js +5 -2
  38. package/dist/package.json +4 -4
  39. package/package.json +35 -35
@@ -268,6 +268,7 @@ class Shard {
268
268
  user: transformers_1.Users.userFromRaw(packet.d.user),
269
269
  nick: packet.d.nick,
270
270
  avatar: packet.d.avatar,
271
+ banner: packet.d.banner,
271
272
  joinedAt: packet.d.joined_at,
272
273
  premiumSince: packet.d.premium_since,
273
274
  deaf: packet.d.deaf,
@@ -318,6 +319,24 @@ class Shard {
318
319
  case constants_1.GatewayEvents.GuildScheduledEventUserRemove:
319
320
  this.client.emit("guildScheduledEventUserRemove", packet.d.user_id, packet.d.guild_scheduled_event_id, packet.d.guild_id);
320
321
  break;
322
+ case constants_1.GatewayEvents.GuildSoundboardSoundCreate:
323
+ this.client.emit("guildSoundboardSoundCreate", transformers_1.Soundboards.soundboardSoundFromRaw(packet.d));
324
+ break;
325
+ case constants_1.GatewayEvents.GuildSoundboardSoundUpdate:
326
+ this.client.emit("guildSoundboardSoundUpdate", transformers_1.Soundboards.soundboardSoundFromRaw(packet.d));
327
+ break;
328
+ case constants_1.GatewayEvents.GuildSoundboardSoundDelete:
329
+ this.client.emit("guildSoundboardSoundDelete", {
330
+ soundID: packet.d.sound_id,
331
+ guildID: packet.d.guild_id,
332
+ });
333
+ break;
334
+ case constants_1.GatewayEvents.GuildSoundboardSoundsUpdate:
335
+ this.client.emit("guildSoundboardSoundsUpdate", packet.d.soundboard_sounds.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound)), packet.d.guild_id);
336
+ break;
337
+ case constants_1.GatewayEvents.SoundboardSounds:
338
+ this.client.emit("soundboardSounds", packet.d.soundboard_sounds.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound)), packet.d.guild_id);
339
+ break;
321
340
  case constants_1.GatewayEvents.IntegrationCreate:
322
341
  this.client.emit("integrationCreate", {
323
342
  ...transformers_1.Guilds.integrationFromRaw(packet.d),
@@ -464,6 +483,20 @@ class Shard {
464
483
  case constants_1.GatewayEvents.UserUpdate:
465
484
  this.client.emit("userUpdate", transformers_1.Users.userFromRaw(packet.d));
466
485
  break;
486
+ case constants_1.GatewayEvents.VoiceChannelEffectSend:
487
+ this.client.emit("voiceChannelEffectSend", {
488
+ channelID: packet.d.channel_id,
489
+ guildID: packet.d.guild_id,
490
+ userID: packet.d.user_id,
491
+ emoji: packet.d.emoji !== null
492
+ ? transformers_1.Emojis.emojiFromRaw(packet.d.emoji)
493
+ : null,
494
+ animationType: packet.d.animation_type,
495
+ animationID: packet.d.animation_id,
496
+ soundID: packet.d.sound_id,
497
+ soundVolume: packet.d.sound_volume,
498
+ });
499
+ break;
467
500
  case constants_1.GatewayEvents.VoiceStateUpdate:
468
501
  this.client.emit("voiceStateUpdate", transformers_1.Voice.voiceStateFromRaw(packet.d));
469
502
  break;
@@ -479,6 +512,15 @@ class Shard {
479
512
  case constants_1.GatewayEvents.WebhooksUpdate:
480
513
  this.client.emit("webhooksUpdate", packet.d.channel_id, packet.d.guild_id);
481
514
  break;
515
+ case constants_1.GatewayEvents.SubscriptionCreate:
516
+ this.client.emit("subscriptionCreate", transformers_1.Subscriptions.subscriptionFromRaw(packet.d));
517
+ break;
518
+ case constants_1.GatewayEvents.SubscriptionUpdate:
519
+ this.client.emit("subscriptionUpdate", transformers_1.Subscriptions.subscriptionFromRaw(packet.d));
520
+ break;
521
+ case constants_1.GatewayEvents.SubscriptionDelete:
522
+ this.client.emit("subscriptionDelete", transformers_1.Subscriptions.subscriptionFromRaw(packet.d));
523
+ break;
482
524
  case constants_1.GatewayEvents.MessagePollVoteAdd:
483
525
  this.client.emit("messagePollVoteAdd", {
484
526
  userID: packet.d.user_id,
@@ -575,6 +617,15 @@ class Shard {
575
617
  },
576
618
  }));
577
619
  }
620
+ /** https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds */
621
+ requestSoundboardSounds(options) {
622
+ this.ws.send(JSON.stringify({
623
+ op: constants_1.GatewayOPCodes.RequestSoundboardSounds,
624
+ d: {
625
+ guild_ids: options.guildIDs,
626
+ },
627
+ }));
628
+ }
578
629
  /** https://discord.com/developers/docs/topics/gateway-events#resume */
579
630
  resume(options) {
580
631
  this.ws.send(JSON.stringify({
@@ -29,6 +29,8 @@ export declare const guildRoles: (guildID: snowflake) => `guilds/${string}/roles
29
29
  export declare const guildScheduledEvent: (guildID: snowflake, guildScheduledEventID: snowflake) => `guilds/${string}/scheduled-events/${string}`;
30
30
  export declare const guildScheduledEvents: (guildID: snowflake) => `guilds/${string}/scheduled-events`;
31
31
  export declare const guildScheduledEventUsers: (guildID: snowflake, guildScheduledEventID: snowflake) => `guilds/${string}/scheduled-events/${string}/users`;
32
+ export declare const guildSoundboardSound: (guildID: snowflake, soundID: snowflake) => `guilds/${string}/soundboard-sounds/${string}`;
33
+ export declare const guildSoundboardSounds: (guildID: snowflake) => `guilds/${string}/soundboard-sounds`;
32
34
  export declare const guildSticker: (guildID: snowflake, stickerID: snowflake) => `guilds/${string}/stickers/${string}`;
33
35
  export declare const guildStickers: (guildID: snowflake) => `guilds/${string}/stickers`;
34
36
  export declare const guildTemplate: (guildID: snowflake, code: string) => `guilds/${string}/templates/${string}`;
@@ -68,6 +70,7 @@ export declare const userChannels: () => "users/@me/channels";
68
70
  export declare const userConnections: () => "users/@me/connections";
69
71
  export declare const userGuild: (guildID: snowflake) => `users/@me/guilds/${string}`;
70
72
  export declare const userGuilds: () => "users/@me/guilds";
73
+ export declare const applicationActivityInstance: (applicationID: snowflake, instanceID: string) => string;
71
74
  export declare const applicationCommand: (applicationID: snowflake, commandID: snowflake) => `applications/${string}/commands/${string}`;
72
75
  export declare const applicationCommands: (applicationID: snowflake) => `applications/${string}/commands`;
73
76
  export declare const applicationCommandPermissions: (applicationID: snowflake, guildID: snowflake, commandID: snowflake) => `applications/${string}/guilds/${string}/commands/${string}/permissions`;
@@ -85,6 +88,12 @@ export declare const guildApplicationCommandsPermissions: (applicationID: snowfl
85
88
  export declare const webhook: (webhookID: snowflake, webhookToken?: string) => `webhooks/${string}`;
86
89
  export declare const webhookMessage: (webhookID: snowflake, webhookToken: string, messageID?: snowflake | "@original") => `webhooks/${string}/${string}/messages/${string}`;
87
90
  export declare const webhookPlatform: (webhookID: snowflake, webhookToken: string, platform: "github" | "slack") => `webhooks/${string}/${string}/github` | `webhooks/${string}/${string}/slack`;
91
+ export declare const stickerPack: (packID: snowflake) => `sticker-packs/${string}`;
92
+ export declare const stickerPacks: () => "sticker-packs";
93
+ export declare const skuSubscription: (skuID: snowflake, subscriptionID: snowflake) => `skus/${string}/subscriptions/${string}`;
94
+ export declare const skuSubscriptions: (skuID: snowflake) => `skus/${string}/subscriptions`;
95
+ export declare const sendSoundboardSound: (channelID: snowflake) => `channels/${string}/send-soundboard-sound`;
96
+ export declare const soundboardDefaultSounds: () => "soundboard-default-sounds";
88
97
  export declare const gateway: () => "gateway";
89
98
  export declare const gatewayBot: () => "gateway/bot";
90
99
  export declare const oauth2Authorize: () => "oauth2/authorize";
@@ -97,5 +106,4 @@ export declare const invite: (code: string) => `invites/${string}`;
97
106
  export declare const stageInstance: (channelID: snowflake) => `stage-instances/${string}`;
98
107
  export declare const stageInstances: () => "stage-instances";
99
108
  export declare const sticker: (stickerID: snowflake) => `stickers/${string}`;
100
- export declare const stickerPacks: () => "sticker-packs";
101
109
  export declare const voiceRegions: () => "voice/regions";
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.channelMessageCrosspost = exports.channelMessageAllReactions = exports.channelMessage = exports.channelInvites = exports.channelFollowers = exports.channelBulkDelete = exports.channel = exports.template = exports.guildWidgetSettings = exports.guildWidgetJSON = exports.guildWidgetImage = exports.guildWelcomeScreen = exports.guildWebhooks = exports.guildVoiceState = exports.guildVoiceRegions = exports.guildVanityURL = exports.guildTemplates = exports.guildTemplate = exports.guildStickers = exports.guildSticker = exports.guildScheduledEventUsers = exports.guildScheduledEvents = exports.guildScheduledEvent = exports.guildRoles = exports.guildRole = exports.guildPrune = exports.guildPreview = exports.guildOnboarding = exports.guildMemberVerification = exports.guildMembersSearch = exports.guildMembers = exports.guildMemberRole = exports.guildMember = exports.guildMFA = exports.guildInvites = exports.guildIntegrations = exports.guildIntegration = exports.guildEmojis = exports.guildEmoji = exports.guildMemberNickname = exports.guildChannels = exports.guildBulkBan = exports.guildBans = exports.guildBan = exports.guildAutoModerationRules = exports.guildAutoModerationRule = exports.guildAuditLog = exports.guildActiveThreads = exports.guilds = exports.guild = void 0;
4
- exports.voiceRegions = exports.stickerPacks = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = exports.oauth2Application = exports.oauth2Authorize = exports.gatewayBot = exports.gateway = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSKUs = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlementConsume = exports.applicationEntitlement = exports.applicationEmojis = exports.applicationEmoji = exports.applicationUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.pollExpire = exports.pollAnswerVoters = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = exports.channelMessageReaction = void 0;
3
+ exports.channelMessage = exports.channelInvites = exports.channelFollowers = exports.channelBulkDelete = exports.channel = exports.template = exports.guildWidgetSettings = exports.guildWidgetJSON = exports.guildWidgetImage = exports.guildWelcomeScreen = exports.guildWebhooks = exports.guildVoiceState = exports.guildVoiceRegions = exports.guildVanityURL = exports.guildTemplates = exports.guildTemplate = exports.guildStickers = exports.guildSticker = exports.guildSoundboardSounds = exports.guildSoundboardSound = exports.guildScheduledEventUsers = exports.guildScheduledEvents = exports.guildScheduledEvent = exports.guildRoles = exports.guildRole = exports.guildPrune = exports.guildPreview = exports.guildOnboarding = exports.guildMemberVerification = exports.guildMembersSearch = exports.guildMembers = exports.guildMemberRole = exports.guildMember = exports.guildMFA = exports.guildInvites = exports.guildIntegrations = exports.guildIntegration = exports.guildEmojis = exports.guildEmoji = exports.guildMemberNickname = exports.guildChannels = exports.guildBulkBan = exports.guildBans = exports.guildBan = exports.guildAutoModerationRules = exports.guildAutoModerationRule = exports.guildAuditLog = exports.guildActiveThreads = exports.guilds = exports.guild = void 0;
4
+ exports.oauth2Authorization = exports.oauth2Application = exports.oauth2Authorize = exports.gatewayBot = exports.gateway = exports.soundboardDefaultSounds = exports.sendSoundboardSound = exports.skuSubscriptions = exports.skuSubscription = exports.stickerPacks = exports.stickerPack = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSKUs = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlementConsume = exports.applicationEntitlement = exports.applicationEmojis = exports.applicationEmoji = exports.applicationUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.applicationActivityInstance = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.pollExpire = exports.pollAnswerVoters = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = exports.channelMessageReaction = exports.channelMessageCrosspost = exports.channelMessageAllReactions = void 0;
5
+ exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = void 0;
5
6
  // Guilds
6
7
  const guild = (guildID) => `guilds/${guildID}`;
7
8
  exports.guild = guild;
@@ -63,6 +64,10 @@ const guildScheduledEvents = (guildID) => `guilds/${guildID}/scheduled-events`;
63
64
  exports.guildScheduledEvents = guildScheduledEvents;
64
65
  const guildScheduledEventUsers = (guildID, guildScheduledEventID) => `guilds/${guildID}/scheduled-events/${guildScheduledEventID}/users`;
65
66
  exports.guildScheduledEventUsers = guildScheduledEventUsers;
67
+ const guildSoundboardSound = (guildID, soundID) => `guilds/${guildID}/soundboard-sounds/${soundID}`;
68
+ exports.guildSoundboardSound = guildSoundboardSound;
69
+ const guildSoundboardSounds = (guildID) => `guilds/${guildID}/soundboard-sounds`;
70
+ exports.guildSoundboardSounds = guildSoundboardSounds;
66
71
  const guildSticker = (guildID, stickerID) => `guilds/${guildID}/stickers/${stickerID}`;
67
72
  exports.guildSticker = guildSticker;
68
73
  const guildStickers = (guildID) => `guilds/${guildID}/stickers`;
@@ -152,6 +157,8 @@ exports.userGuild = userGuild;
152
157
  const userGuilds = () => "users/@me/guilds";
153
158
  exports.userGuilds = userGuilds;
154
159
  // Applications
160
+ const applicationActivityInstance = (applicationID, instanceID) => `applications/${applicationID}/activity-instances/${instanceID}`;
161
+ exports.applicationActivityInstance = applicationActivityInstance;
155
162
  const applicationCommand = (applicationID, commandID) => `applications/${applicationID}/commands/${commandID}`;
156
163
  exports.applicationCommand = applicationCommand;
157
164
  const applicationCommands = (applicationID) => `applications/${applicationID}/commands`;
@@ -189,6 +196,21 @@ const webhookMessage = (webhookID, webhookToken, messageID = "@original") => `we
189
196
  exports.webhookMessage = webhookMessage;
190
197
  const webhookPlatform = (webhookID, webhookToken, platform) => `webhooks/${webhookID}/${webhookToken}/${platform}`;
191
198
  exports.webhookPlatform = webhookPlatform;
199
+ // Sticker packs
200
+ const stickerPack = (packID) => `sticker-packs/${packID}`;
201
+ exports.stickerPack = stickerPack;
202
+ const stickerPacks = () => "sticker-packs";
203
+ exports.stickerPacks = stickerPacks;
204
+ // Subscriptions
205
+ const skuSubscription = (skuID, subscriptionID) => `skus/${skuID}/subscriptions/${subscriptionID}`;
206
+ exports.skuSubscription = skuSubscription;
207
+ const skuSubscriptions = (skuID) => `skus/${skuID}/subscriptions`;
208
+ exports.skuSubscriptions = skuSubscriptions;
209
+ // Soundboards
210
+ const sendSoundboardSound = (channelID) => `channels/${channelID}/send-soundboard-sound`;
211
+ exports.sendSoundboardSound = sendSoundboardSound;
212
+ const soundboardDefaultSounds = () => `soundboard-default-sounds`;
213
+ exports.soundboardDefaultSounds = soundboardDefaultSounds;
192
214
  // Gateway
193
215
  const gateway = () => "gateway";
194
216
  exports.gateway = gateway;
@@ -216,7 +238,5 @@ const stageInstances = () => "stage-instances";
216
238
  exports.stageInstances = stageInstances;
217
239
  const sticker = (stickerID) => `stickers/${stickerID}`;
218
240
  exports.sticker = sticker;
219
- const stickerPacks = () => "sticker-packs";
220
- exports.stickerPacks = stickerPacks;
221
241
  const voiceRegions = () => "voice/regions";
222
242
  exports.voiceRegions = voiceRegions;
@@ -20,6 +20,7 @@ class ApplicationCommands {
20
20
  contexts: command.contexts,
21
21
  nsfw: command.nsfw,
22
22
  version: command.version,
23
+ handler: command.handler,
23
24
  };
24
25
  }
25
26
  static applicationCommandToRaw(command) {
@@ -40,6 +41,7 @@ class ApplicationCommands {
40
41
  contexts: command.contexts,
41
42
  nsfw: command.nsfw,
42
43
  version: command.version,
44
+ handler: command.handler,
43
45
  };
44
46
  }
45
47
  static optionToRaw(option) {
@@ -30,6 +30,7 @@ class Applications {
30
30
  coverImage: application.cover_image,
31
31
  flags: application.flags,
32
32
  approximateGuildCount: application.approximate_guild_count,
33
+ approximateUserInstallCount: application.approximate_user_install_count,
33
34
  redirectURIs: application.redirect_uris,
34
35
  interactionsEndpointURL: application.interactions_endpoint_url,
35
36
  roleConnectionsVerificationURL: application.role_connections_verification_url,
@@ -75,6 +76,7 @@ class Applications {
75
76
  cover_image: application.coverImage,
76
77
  flags: application.flags,
77
78
  approximate_guild_count: application.approximateGuildCount,
79
+ approximate_user_install_count: application.approximateUserInstallCount,
78
80
  redirect_uris: application.redirectURIs,
79
81
  interactions_endpoint_url: application.interactionsEndpointURL,
80
82
  role_connections_verification_url: application.roleConnectionsVerificationURL,
@@ -1,6 +1,8 @@
1
- import type { RawInteraction, Interaction, RawResolvedData, ResolvedData } from "../types/interaction";
1
+ import type { RawInteraction, Interaction, RawResolvedData, ResolvedData, RawInteractionCallbackResponse, InteractionCallbackResponse } from "../types/interaction";
2
2
  import type { RawMessageInteractionMetadata, MessageInteractionMetadata } from "../types/message";
3
3
  export declare class Interactions {
4
+ static interactionCallbackResponseFromRaw(interactionCallbackResponse: RawInteractionCallbackResponse): InteractionCallbackResponse;
5
+ static interactionCallbackResponseToRaw(interactionCallbackResponse: InteractionCallbackResponse): RawInteractionCallbackResponse;
4
6
  static interactionFromRaw(interaction: RawInteraction): Interaction;
5
7
  static interactionMetadataFromRaw(interactionMetadata: RawMessageInteractionMetadata): MessageInteractionMetadata;
6
8
  static interactionMetadataToRaw(interactionMetadata: MessageInteractionMetadata): RawMessageInteractionMetadata;
@@ -8,6 +8,48 @@ const Entitlements_1 = require("./Entitlements");
8
8
  const Roles_1 = require("./Roles");
9
9
  const Messages_1 = require("./Messages");
10
10
  class Interactions {
11
+ static interactionCallbackResponseFromRaw(interactionCallbackResponse) {
12
+ return {
13
+ interaction: {
14
+ id: interactionCallbackResponse.interaction.id,
15
+ type: interactionCallbackResponse.interaction.type,
16
+ activityInstanceID: interactionCallbackResponse.interaction.activity_instance_id,
17
+ responseMessageID: interactionCallbackResponse.interaction.response_message_id,
18
+ responseMessageLoading: interactionCallbackResponse.interaction.response_message_loading,
19
+ responseMessageEphemeral: interactionCallbackResponse.interaction.response_message_ephemeral,
20
+ },
21
+ resource: interactionCallbackResponse.resource !== undefined
22
+ ? {
23
+ type: interactionCallbackResponse.resource.type,
24
+ activityInstance: interactionCallbackResponse.resource.activity_instance,
25
+ message: interactionCallbackResponse.resource.message !== undefined
26
+ ? Messages_1.Messages.messageFromRaw(interactionCallbackResponse.resource.message)
27
+ : undefined,
28
+ }
29
+ : undefined,
30
+ };
31
+ }
32
+ static interactionCallbackResponseToRaw(interactionCallbackResponse) {
33
+ return {
34
+ interaction: {
35
+ id: interactionCallbackResponse.interaction.id,
36
+ type: interactionCallbackResponse.interaction.type,
37
+ activity_instance_id: interactionCallbackResponse.interaction.activityInstanceID,
38
+ response_message_id: interactionCallbackResponse.interaction.responseMessageID,
39
+ response_message_loading: interactionCallbackResponse.interaction.responseMessageLoading,
40
+ response_message_ephemeral: interactionCallbackResponse.interaction.responseMessageEphemeral,
41
+ },
42
+ resource: interactionCallbackResponse.resource !== undefined
43
+ ? {
44
+ type: interactionCallbackResponse.resource.type,
45
+ activity_instance: interactionCallbackResponse.resource.activityInstance,
46
+ message: interactionCallbackResponse.resource.message !== undefined
47
+ ? Messages_1.Messages.messageToRaw(interactionCallbackResponse.resource.message)
48
+ : undefined,
49
+ }
50
+ : undefined,
51
+ };
52
+ }
11
53
  static interactionFromRaw(interaction) {
12
54
  return {
13
55
  id: interaction.id,
@@ -0,0 +1,5 @@
1
+ import type { RawSoundboardSound, SoundboardSound } from "../types/soundboard";
2
+ export declare class Soundboards {
3
+ static soundboardSoundFromRaw(sound: RawSoundboardSound): SoundboardSound;
4
+ static soundboardSoundToRaw(sound: SoundboardSound): RawSoundboardSound;
5
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Soundboards = void 0;
4
+ const Users_1 = require("./Users");
5
+ class Soundboards {
6
+ static soundboardSoundFromRaw(sound) {
7
+ return {
8
+ name: sound.name,
9
+ soundID: sound.sound_id,
10
+ volume: sound.volume,
11
+ emojiID: sound.emoji_id,
12
+ emojiName: sound.emoji_name,
13
+ guildID: sound.guild_id,
14
+ available: sound.available,
15
+ user: sound.user !== undefined ? Users_1.Users.userFromRaw(sound.user) : undefined,
16
+ };
17
+ }
18
+ static soundboardSoundToRaw(sound) {
19
+ return {
20
+ name: sound.name,
21
+ sound_id: sound.soundID,
22
+ volume: sound.volume,
23
+ emoji_id: sound.emojiID,
24
+ emoji_name: sound.emojiName,
25
+ guild_id: sound.guildID,
26
+ available: sound.available,
27
+ user: sound.user !== undefined ? Users_1.Users.userToRaw(sound.user) : undefined,
28
+ };
29
+ }
30
+ }
31
+ exports.Soundboards = Soundboards;
@@ -10,7 +10,6 @@ class Stickers {
10
10
  name: sticker.name,
11
11
  description: sticker.description,
12
12
  tags: sticker.tags,
13
- asset: sticker.asset,
14
13
  type: sticker.type,
15
14
  formatType: sticker.format_type,
16
15
  available: sticker.available,
@@ -28,7 +27,6 @@ class Stickers {
28
27
  name: sticker.name,
29
28
  description: sticker.description,
30
29
  tags: sticker.tags,
31
- asset: sticker.asset,
32
30
  type: sticker.type,
33
31
  format_type: sticker.formatType,
34
32
  available: sticker.available,
@@ -0,0 +1,5 @@
1
+ import type { RawSubscription, Subscription } from "../types/subscription";
2
+ export declare class Subscriptions {
3
+ static subscriptionFromRaw(subscription: RawSubscription): Subscription;
4
+ static subscriptionToRaw(subscription: Subscription): RawSubscription;
5
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Subscriptions = void 0;
4
+ class Subscriptions {
5
+ static subscriptionFromRaw(subscription) {
6
+ return {
7
+ id: subscription.id,
8
+ userID: subscription.user_id,
9
+ skuIDs: subscription.sku_ids,
10
+ entitlementIDs: subscription.entitlement_ids,
11
+ currentPeriodStart: subscription.current_period_start,
12
+ currentPeriodEnd: subscription.current_period_end,
13
+ status: subscription.status,
14
+ canceledAt: subscription.canceled_at,
15
+ country: subscription.country,
16
+ };
17
+ }
18
+ static subscriptionToRaw(subscription) {
19
+ return {
20
+ id: subscription.id,
21
+ user_id: subscription.userID,
22
+ sku_ids: subscription.skuIDs,
23
+ entitlement_ids: subscription.entitlementIDs,
24
+ current_period_start: subscription.currentPeriodStart,
25
+ current_period_end: subscription.currentPeriodEnd,
26
+ status: subscription.status,
27
+ canceled_at: subscription.canceledAt,
28
+ country: subscription.country,
29
+ };
30
+ }
31
+ }
32
+ exports.Subscriptions = Subscriptions;
@@ -16,8 +16,10 @@ export * from "./Polls";
16
16
  export * from "./Presences";
17
17
  export * from "./Roles";
18
18
  export * from "./SKUs";
19
+ export * from "./Soundboards";
19
20
  export * from "./StageInstances";
20
21
  export * from "./Stickers";
22
+ export * from "./Subscriptions";
21
23
  export * from "./Teams";
22
24
  export * from "./Users";
23
25
  export * from "./Voice";
@@ -32,8 +32,10 @@ __exportStar(require("./Polls"), exports);
32
32
  __exportStar(require("./Presences"), exports);
33
33
  __exportStar(require("./Roles"), exports);
34
34
  __exportStar(require("./SKUs"), exports);
35
+ __exportStar(require("./Soundboards"), exports);
35
36
  __exportStar(require("./StageInstances"), exports);
36
37
  __exportStar(require("./Stickers"), exports);
38
+ __exportStar(require("./Subscriptions"), exports);
37
39
  __exportStar(require("./Teams"), exports);
38
40
  __exportStar(require("./Users"), exports);
39
41
  __exportStar(require("./Voice"), exports);
@@ -1,4 +1,4 @@
1
- import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType, ApplicationIntegrationTypes, InteractionContextTypes } from "../constants";
1
+ import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType, ApplicationIntegrationTypes, InteractionContextTypes, EntryPointCommandHandlerTypes } from "../constants";
2
2
  import type { snowflake, LocaleMap } from "./common";
3
3
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */
4
4
  export interface RawApplicationCommand {
@@ -18,6 +18,7 @@ export interface RawApplicationCommand {
18
18
  contexts?: Array<InteractionContextTypes>;
19
19
  nsfw?: boolean;
20
20
  version: snowflake;
21
+ handler?: EntryPointCommandHandlerTypes;
21
22
  }
22
23
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */
23
24
  export interface RawApplicationCommandOption {
@@ -72,6 +73,7 @@ export interface ApplicationCommand {
72
73
  contexts?: Array<InteractionContextTypes>;
73
74
  nsfw?: boolean;
74
75
  version: string;
76
+ handler?: EntryPointCommandHandlerTypes;
75
77
  }
76
78
  export interface ApplicationCommandOption {
77
79
  type: ApplicationCommandOptionType;
@@ -1,4 +1,4 @@
1
- import type { ApplicationFlags, ApplicationIntegrationTypes, OAuth2Scopes } from "../constants";
1
+ import type { ActivityLocationKind, ApplicationFlags, ApplicationIntegrationTypes, OAuth2Scopes } from "../constants";
2
2
  import type { snowflake } from "./common";
3
3
  import type { RawGuild, Guild } from "./guild";
4
4
  import type { RawTeam, Team } from "./team";
@@ -24,6 +24,7 @@ export interface RawApplication {
24
24
  cover_image?: string;
25
25
  flags?: ApplicationFlags;
26
26
  approximate_guild_count?: number;
27
+ approximate_user_install_count?: number;
27
28
  redirect_uris?: Array<string>;
28
29
  interactions_endpoint_url?: string;
29
30
  role_connections_verification_url?: string;
@@ -41,6 +42,21 @@ export interface RawInstallParams {
41
42
  scopes: Array<OAuth2Scopes>;
42
43
  permissions: string;
43
44
  }
45
+ /** https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-instance-object */
46
+ export interface RawActivityInstance {
47
+ application_id: snowflake;
48
+ instance_id: string;
49
+ launch_id: snowflake;
50
+ location: RawActivityLocation;
51
+ users: Array<snowflake>;
52
+ }
53
+ /** https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-location-object */
54
+ export interface RawActivityLocation {
55
+ id: string;
56
+ kind: ActivityLocationKind;
57
+ channel_id: snowflake;
58
+ guild_id?: snowflake | null;
59
+ }
44
60
  export interface Application {
45
61
  id: snowflake;
46
62
  name: string;
@@ -61,6 +77,7 @@ export interface Application {
61
77
  coverImage?: string;
62
78
  flags?: ApplicationFlags;
63
79
  approximateGuildCount?: number;
80
+ approximateUserInstallCount?: number;
64
81
  redirectURIs?: Array<string>;
65
82
  interactionsEndpointURL?: string;
66
83
  roleConnectionsVerificationURL?: string;
@@ -76,3 +93,16 @@ export interface InstallParams {
76
93
  scopes: Array<OAuth2Scopes>;
77
94
  permissions: string;
78
95
  }
96
+ export interface ActivityInstance {
97
+ applicationID: snowflake;
98
+ instanceID: string;
99
+ launchID: snowflake;
100
+ location: ActivityLocation;
101
+ users: Array<snowflake>;
102
+ }
103
+ export interface ActivityLocation {
104
+ id: string;
105
+ kind: ActivityLocationKind;
106
+ channelID: snowflake;
107
+ guildID?: snowflake | null;
108
+ }
@@ -1,6 +1,6 @@
1
1
  import type { EntitlementTypes } from "../constants";
2
2
  import type { snowflake, timestamp } from "./common";
3
- /** https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-structure */
3
+ /** https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-structure */
4
4
  export interface RawEntitlement {
5
5
  id: snowflake;
6
6
  sku_id: snowflake;
@@ -1,4 +1,4 @@
1
- import type { ActivityFlags, ActivityType, GatewayEvents, GatewayIntents, GatewayOPCodes, GuildMemberFlags, InviteTargetTypes, ReactionTypes, StatusTypes, TriggerTypes } from "../constants";
1
+ import type { ActivityFlags, ActivityType, AnimationTypes, GatewayEvents, GatewayIntents, GatewayOPCodes, GuildMemberFlags, InviteTargetTypes, ReactionTypes, StatusTypes, TriggerTypes } from "../constants";
2
2
  import type { RawApplication, Application } from "./application";
3
3
  import type { RawAutoModerationAction, AutoModerationAction } from "./auto-moderation";
4
4
  import type { RawChannel, RawThreadMember, Channel, ThreadMember } from "./channel";
@@ -6,6 +6,7 @@ import type { snowflake, timestamp } from "./common";
6
6
  import type { RawEmoji, Emoji } from "./emoji";
7
7
  import type { RawGuildMember, GuildMember } from "./guild";
8
8
  import type { RawGuildScheduledEvent, GuildScheduledEvent } from "./guild-scheduled-event";
9
+ import type { RawSoundboardSound, SoundboardSound } from "./soundboard";
9
10
  import type { RawStageInstance, StageInstance } from "./stage-instance";
10
11
  import type { RawUser, RawAvatarDecorationData, User, AvatarDecorationData } from "./user";
11
12
  import type { RawVoiceState, VoiceState } from "./voice";
@@ -47,6 +48,10 @@ export interface RawRequestGuildMembers {
47
48
  user_ids?: snowflake | Array<snowflake>;
48
49
  nonce?: string;
49
50
  }
51
+ /** https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds-request-soundboard-sounds-structure */
52
+ export interface RequestSoundboardSounds {
53
+ guild_ids: Array<snowflake>;
54
+ }
50
55
  /** https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure */
51
56
  export interface RawGatewayPresenceUpdate {
52
57
  since: number | null;
@@ -113,6 +118,7 @@ export interface RawGuildCreateEventExtraFields {
113
118
  presences?: Array<RawPresenceUpdateEventFields>;
114
119
  stage_instances?: Array<RawStageInstance>;
115
120
  guild_scheduled_events?: Array<RawGuildScheduledEvent>;
121
+ soundboard_sounds?: Array<RawSoundboardSound>;
116
122
  }
117
123
  /** https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create-guild-audit-log-entry-create-extra-fields */
118
124
  export interface RawGuildAuditLogEntryCreateExtraFields {
@@ -148,6 +154,7 @@ export interface RawGuildMemberUpdateEventFields {
148
154
  user: RawUser;
149
155
  nick?: string | null;
150
156
  avatar: string | null;
157
+ banner: string | null;
151
158
  joined_at?: timestamp | null;
152
159
  premium_since?: number | null;
153
160
  deaf?: boolean;
@@ -167,6 +174,11 @@ export interface RawGuildMembersChunkEventFields {
167
174
  presences?: Array<RawPresenceUpdateEventFields>;
168
175
  nonce?: string;
169
176
  }
177
+ /** https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete-guild-soundboard-sound-delete-event-fields */
178
+ export interface RawGuildSoundboardSoundDeleteEventFields {
179
+ soundID: snowflake;
180
+ guildID: snowflake;
181
+ }
170
182
  /** https://discord.com/developers/docs/topics/gateway-events#integration-create-integration-create-event-additional-fields */
171
183
  export interface RawIntegrationCreateEventExtraFields {
172
184
  guild_id: snowflake;
@@ -330,6 +342,17 @@ export interface RawTypingStartEventFields {
330
342
  timestamp: timestamp;
331
343
  member?: RawGuildMember;
332
344
  }
345
+ /** https://discord.com/developers/docs/topics/gateway-events#voice-channel-effetc-send-event-fields */
346
+ export interface RawVoiceChannelEffectSendEventFields {
347
+ channel_id: snowflake;
348
+ guild_id: snowflake;
349
+ user_id: snowflake;
350
+ emoji?: RawEmoji | null;
351
+ animation_type?: AnimationTypes | null;
352
+ animation_id?: number;
353
+ sound_id?: snowflake | number;
354
+ sound_volume?: number;
355
+ }
333
356
  /** https://discord.com/developers/docs/topics/gateway-events#voice-server-update-voice-server-update-event-fields */
334
357
  export interface RawVoiceServerUpdateEventFields {
335
358
  token: string;
@@ -385,6 +408,9 @@ export interface RequestGuildMembers {
385
408
  userIDs?: snowflake | Array<snowflake>;
386
409
  nonce?: string;
387
410
  }
411
+ export interface RequestSoundboardSounds {
412
+ guildIDs: Array<snowflake>;
413
+ }
388
414
  export interface GatewayPresenceUpdate {
389
415
  since: number | null;
390
416
  activities: Array<Partial<Pick<Activity, "name" | "type" | "url" | "state">>>;
@@ -443,6 +469,7 @@ export interface GuildCreateEventExtraFields {
443
469
  presences?: Array<PresenceUpdateEventFields>;
444
470
  stageInstances?: Array<StageInstance>;
445
471
  guildScheduledEvents?: Array<GuildScheduledEvent>;
472
+ soundboardSounds?: Array<SoundboardSound>;
446
473
  }
447
474
  export interface GuildAuditLogEntryCreateExtraFields {
448
475
  guildID: snowflake;
@@ -471,6 +498,7 @@ export interface GuildMemberUpdateEventFields {
471
498
  user: User;
472
499
  nick?: string | null;
473
500
  avatar: string | null;
501
+ banner: string | null;
474
502
  joinedAt?: timestamp | null;
475
503
  premiumSince?: number | null;
476
504
  deaf?: boolean;
@@ -489,6 +517,10 @@ export interface GuildMembersChunkEventFields {
489
517
  presences?: Array<PresenceUpdateEventFields>;
490
518
  nonce?: string;
491
519
  }
520
+ export interface GuildSoundboardSoundDeleteEventFields {
521
+ soundID: snowflake;
522
+ guildID: snowflake;
523
+ }
492
524
  export interface IntegrationCreateEventExtraFields {
493
525
  guildID: snowflake;
494
526
  }
@@ -630,6 +662,16 @@ export interface TypingStartEventFields {
630
662
  timestamp: timestamp;
631
663
  member?: GuildMember;
632
664
  }
665
+ export interface VoiceChannelEffectSendEventFields {
666
+ channelID: snowflake;
667
+ guildID: snowflake;
668
+ userID: snowflake;
669
+ emoji?: Emoji | null;
670
+ animationType?: AnimationTypes | null;
671
+ animationID?: number;
672
+ soundID?: snowflake | number;
673
+ soundVolume?: number;
674
+ }
633
675
  export interface VoiceServerUpdateEventFields {
634
676
  token: string;
635
677
  guildID: snowflake;
@@ -89,6 +89,7 @@ export interface RawGuildMember {
89
89
  user?: RawUser;
90
90
  nick?: string | null;
91
91
  avatar?: string | null;
92
+ banner?: string | null;
92
93
  roles: Array<snowflake>;
93
94
  joined_at: timestamp;
94
95
  premium_since?: number | null;
@@ -257,6 +258,7 @@ export interface GuildMember {
257
258
  user?: User;
258
259
  nick?: string | null;
259
260
  avatar?: string | null;
261
+ banner?: string | null;
260
262
  roles: Array<snowflake>;
261
263
  joinedAt: string;
262
264
  premiumSince?: number | null;