disgroove 2.2.5-dev.aee496f → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,14 +7,6 @@ A module to interface with Discord
7
7
  - Flexible
8
8
  - 100% coverage of the [Official Discord API Documentation](https://discord.com/developers/docs/intro)
9
9
 
10
- ## Installation
11
-
12
- [**Node.js v18**](https://nodejs.org) or newer required
13
-
14
- ```
15
- npm install disgroove
16
- ```
17
-
18
10
  ## Example
19
11
 
20
12
  ```js
@@ -53,5 +45,4 @@ client.on("interactionCreate", async (interaction) => {
53
45
  client.connect();
54
46
  ```
55
47
 
56
- More examples on the [GitHub repository](https://github.com/XenKys/disgroove/tree/main/examples)
57
- For support and more join the [Discord server](https://discord.gg/kunfRQgRyD)
48
+ More examples on the [GitHub repository](https://github.com/sergiogotuzzo/disgroove/tree/main/examples)
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
+ /// <reference types="node" />
3
4
  import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, type MFALevel, type ReactionTypes, type ApplicationCommandTypes, type EventTypes, type TriggerTypes, type ChannelTypes, type VideoQualityModes, type SortOrderTypes, type ForumLayoutTypes, type InviteTargetTypes, type VerificationLevel, type DefaultMessageNotificationLevel, type ExplicitContentFilterLevel, type SystemChannelFlags, type ApplicationFlags, type ApplicationIntegrationTypes, type ChannelFlags, type GuildFeatures, type GuildScheduledEventEntityTypes, type GuildScheduledEventPrivacyLevel, type GuildScheduledEventStatus, type MessageFlags, type OnboardingMode, type PrivacyLevel, type GuildMemberFlags, type InteractionContextTypes } from "./constants";
4
5
  import { RequestManager, type File } from "./rest";
5
6
  import EventEmitter from "node:events";
@@ -14,10 +15,10 @@ import type { LocaleMap, snowflake, timestamp } from "./types/common";
14
15
  import type { Emoji } from "./types/emoji";
15
16
  import type { Entitlement } from "./types/entitlements";
16
17
  import type { AutoModerationActionExecutionEventFields, ChannelPinsUpdateEventFields, ThreadListSyncEventFields, ThreadMemberUpdateEventExtraFields, ThreadMembersUpdateEventFields, GuildCreateEventExtraFields, GuildAuditLogEntryCreateExtraFields, GuildBanAddEventFields, GuildBanRemoveEventFields, GuildMemberAddEventExtraFields, GuildMemberRemoveEventFields, GuildMemberUpdateEventFields, GuildMembersChunkEventFields, IntegrationCreateEventExtraFields, IntegrationUpdateEventExtraFields, IntegrationDeleteEventFields, InviteCreateEventFields, InviteDeleteEventFields, MessageCreateEventExtraFields, MessageDeleteEventFields, MessageDeleteBulkEventFields, MessageReactionAddEventFields, MessageReactionRemoveEventFields, MessageReactionRemoveAllEventFields, MessageReactionRemoveEmojiEventFields, PresenceUpdateEventFields, TypingStartEventFields, VoiceServerUpdateEventFields, MessagePollVoteAddFields, MessagePollVoteRemoveFields, GatewayPresenceUpdate, RawPayload, IdentifyConnectionProperties, VoiceChannelEffectSendEventFields, GuildSoundboardSoundDeleteEventFields } from "./types/gateway-events";
17
- import type { Guild, GuildMember, WelcomeScreen, GuildWidgetSettings, Ban, Integration, GuildOnboarding, GuildPreview, GuildWidget, UnavailableGuild, OnboardingPrompt, WelcomeScreenChannel } from "./types/guild";
18
+ import type { Guild, GuildMember, WelcomeScreen, GuildWidgetSettings, Ban, Integration, GuildOnboarding, GuildPreview, GuildWidget, UnavailableGuild, OnboardingPrompt, WelcomeScreenChannel, IncidentsData } from "./types/guild";
18
19
  import type { GuildScheduledEvent, GuildScheduledEventUser, GuildScheduledEventEntityMetadata, GuildScheduledEventRecurrenceRule } from "./types/guild-scheduled-event";
19
20
  import type { GuildTemplate } from "./types/guild-template";
20
- import type { Interaction, InteractionResponse } from "./types/interaction";
21
+ import type { Interaction, InteractionCallbackResponse, InteractionResponse } from "./types/interaction";
21
22
  import type { Invite } from "./types/invite";
22
23
  import type { ActionRow } from "./types/message-components";
23
24
  import type { PollCreateParams } from "./types/poll";
@@ -315,7 +316,9 @@ export declare class Client extends EventEmitter {
315
316
  poll?: PollCreateParams;
316
317
  }): Promise<Message>;
317
318
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */
318
- createInteractionResponse(interactionID: snowflake, interactionToken: string, options: InteractionResponse): void;
319
+ createInteractionResponse(interactionID: snowflake, interactionToken: string, options: InteractionResponse & {
320
+ withResponse?: boolean;
321
+ }): Promise<void | InteractionCallbackResponse>;
319
322
  /** https://discord.com/developers/docs/resources/message#create-message */
320
323
  createMessage(channelID: snowflake, options: {
321
324
  content?: string;
@@ -573,6 +576,11 @@ export declare class Client extends EventEmitter {
573
576
  name?: string;
574
577
  roles?: Array<snowflake> | null;
575
578
  }, reason?: string): Promise<Emoji>;
579
+ /** https://discord.com/developers/docs/resources/emoji#modify-guild-incidents-actions */
580
+ editGuildIncidentsActions(guildID: snowflake, options?: {
581
+ invitesDisabledUntil?: timestamp | null;
582
+ dmsDisabledUntil?: timestamp | null;
583
+ }, reason?: string): Promise<IncidentsData>;
576
584
  /** https://discord.com/developers/docs/resources/guild#modify-guild-member */
577
585
  editGuildMember(guildID: snowflake, userID: snowflake, options: {
578
586
  nick?: string | null;
@@ -710,6 +718,7 @@ export declare class Client extends EventEmitter {
710
718
  attachments?: Array<Partial<Attachment>> | null;
711
719
  poll?: PollCreateParams | null;
712
720
  threadID?: snowflake;
721
+ withComponents?: boolean;
713
722
  }): Promise<Message>;
714
723
  /** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
715
724
  editWebhookWithToken(webhookID: snowflake, webhookToken: string, options: {
@@ -735,6 +744,7 @@ export declare class Client extends EventEmitter {
735
744
  poll?: PollCreateParams;
736
745
  wait?: boolean;
737
746
  threadID?: snowflake;
747
+ withComponents?: boolean;
738
748
  }): Promise<Message | null>;
739
749
  /**
740
750
  * https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
@@ -807,6 +817,8 @@ export declare class Client extends EventEmitter {
807
817
  getCurrentUserVoiceState(guildID: snowflake): Promise<VoiceState>;
808
818
  /** https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds */
809
819
  getDefaultSoundboardSounds(): Promise<Array<SoundboardSound>>;
820
+ /** https://discord.com/developers/docs/resources/entitlement#get-entitlement */
821
+ getEntitlement(applicationID: snowflake, entitlementID: snowflake): Promise<Entitlement>;
810
822
  /** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
811
823
  getEntitlements(applicationID: snowflake, options?: {
812
824
  userID?: snowflake;
@@ -816,6 +828,7 @@ export declare class Client extends EventEmitter {
816
828
  limit?: number;
817
829
  guildID?: snowflake;
818
830
  excludeEnded?: boolean;
831
+ excludeDeleted?: boolean;
819
832
  }): Promise<Array<Entitlement>>;
820
833
  /** https://discord.com/developers/docs/topics/gateway#get-gateway */
821
834
  getGateway(): Promise<{
@@ -1164,7 +1177,10 @@ export interface ClientEvents {
1164
1177
  guildSoundboardSoundCreate: [sound: SoundboardSound];
1165
1178
  guildSoundboardSoundUpdate: [sound: SoundboardSound];
1166
1179
  guildSoundboardSoundDelete: [sound: GuildSoundboardSoundDeleteEventFields];
1167
- guildSoundboardSoundsUpdate: [sounds: Array<SoundboardSound>];
1180
+ guildSoundboardSoundsUpdate: [
1181
+ sounds: Array<SoundboardSound>,
1182
+ guildID: snowflake
1183
+ ];
1168
1184
  soundboardSounds: [sounds: Array<SoundboardSound>, guildID: snowflake];
1169
1185
  integrationCreate: [
1170
1186
  integration: Integration & IntegrationCreateEventExtraFields
@@ -483,106 +483,118 @@ class Client extends node_events_1.default {
483
483
  return transformers_1.Messages.messageFromRaw(response);
484
484
  }
485
485
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */
486
- createInteractionResponse(interactionID, interactionToken, options) {
486
+ async createInteractionResponse(interactionID, interactionToken, options) {
487
+ let json;
488
+ let files;
487
489
  switch (options.type) {
488
490
  case constants_1.InteractionCallbackType.ChannelMessageWithSource:
489
491
  case constants_1.InteractionCallbackType.UpdateMessage:
490
492
  {
491
- this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
492
- json: {
493
- type: options.type,
494
- data: {
495
- content: options.data?.content,
496
- embeds: options.data?.embeds !== undefined
497
- ? options.data.embeds.map((embed) => transformers_1.Messages.embedToRaw(embed))
498
- : undefined,
499
- allowed_mentions: options.data?.allowedMentions !== undefined
500
- ? {
501
- parse: options.data.allowedMentions.parse,
502
- roles: options.data.allowedMentions.roles,
503
- users: options.data.allowedMentions.users,
504
- replied_user: options.data.allowedMentions.repliedUser,
505
- }
506
- : undefined,
507
- flags: options.data?.flags,
508
- components: options.data?.components !== undefined
509
- ? transformers_1.Messages.componentsToRaw(options.data.components)
510
- : undefined,
511
- attachments: options.data?.attachments,
512
- poll: options.data?.poll !== undefined
513
- ? {
514
- question: options.data.poll.question,
515
- answers: options.data.poll.answers.map((answer) => ({
516
- answer_id: answer.answerID,
517
- poll_media: answer.pollMedia,
518
- })),
519
- duration: options.data.poll.duration,
520
- allow_multiselect: options.data.poll.allowMultiselect,
521
- layout_type: options.data.poll.layoutType,
522
- }
523
- : undefined,
524
- },
493
+ json = {
494
+ type: options.type,
495
+ data: {
496
+ content: options.data?.content,
497
+ embeds: options.data?.embeds !== undefined
498
+ ? options.data.embeds.map((embed) => transformers_1.Messages.embedToRaw(embed))
499
+ : undefined,
500
+ allowed_mentions: options.data?.allowedMentions !== undefined
501
+ ? {
502
+ parse: options.data.allowedMentions.parse,
503
+ roles: options.data.allowedMentions.roles,
504
+ users: options.data.allowedMentions.users,
505
+ replied_user: options.data.allowedMentions.repliedUser,
506
+ }
507
+ : undefined,
508
+ flags: options.data?.flags,
509
+ components: options.data?.components !== undefined
510
+ ? transformers_1.Messages.componentsToRaw(options.data.components)
511
+ : undefined,
512
+ attachments: options.data?.attachments,
513
+ poll: options.data?.poll !== undefined
514
+ ? {
515
+ question: options.data.poll.question,
516
+ answers: options.data.poll.answers.map((answer) => ({
517
+ answer_id: answer.answerID,
518
+ poll_media: answer.pollMedia,
519
+ })),
520
+ duration: options.data.poll.duration,
521
+ allow_multiselect: options.data.poll.allowMultiselect,
522
+ layout_type: options.data.poll.layoutType,
523
+ }
524
+ : undefined,
525
525
  },
526
- files: options.data?.files,
527
- });
526
+ };
527
+ files = options.data?.files;
528
528
  }
529
529
  break;
530
530
  case constants_1.InteractionCallbackType.DeferredChannelMessageWithSource:
531
531
  case constants_1.InteractionCallbackType.DeferredUpdateMessage:
532
532
  {
533
- this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
534
- json: {
535
- type: options.type,
536
- data: {
537
- flags: options.data?.flags,
538
- },
533
+ json = {
534
+ type: options.type,
535
+ data: {
536
+ flags: options.data?.flags,
539
537
  },
540
- });
538
+ };
541
539
  }
542
540
  break;
543
541
  case constants_1.InteractionCallbackType.ApplicationCommandAutocompleteResult:
544
542
  {
545
- this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
546
- json: {
547
- type: options.type,
548
- data: {
549
- choices: options.data?.choices?.map((choice) => ({
550
- name: choice.name,
551
- name_localizations: choice.nameLocalizations,
552
- value: choice.value,
553
- })),
554
- },
543
+ json = {
544
+ type: options.type,
545
+ data: {
546
+ choices: options.data?.choices?.map((choice) => ({
547
+ name: choice.name,
548
+ name_localizations: choice.nameLocalizations,
549
+ value: choice.value,
550
+ })),
555
551
  },
556
- });
552
+ };
557
553
  }
558
554
  break;
559
555
  case constants_1.InteractionCallbackType.Modal:
560
556
  {
561
- this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
562
- json: {
563
- type: options.type,
564
- data: {
565
- custom_id: options.data?.customID,
566
- components: options.data?.components !== undefined
567
- ? transformers_1.Messages.componentsToRaw(options.data.components)
568
- : undefined,
569
- title: options.data?.title,
570
- },
557
+ json = {
558
+ type: options.type,
559
+ data: {
560
+ custom_id: options.data?.customID,
561
+ components: options.data?.components !== undefined
562
+ ? transformers_1.Messages.componentsToRaw(options.data.components)
563
+ : undefined,
564
+ title: options.data?.title,
571
565
  },
572
- });
566
+ };
573
567
  }
574
568
  break;
575
569
  case constants_1.InteractionCallbackType.PremiumRequired:
570
+ case constants_1.InteractionCallbackType.LaunchActivity:
576
571
  {
577
- this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
578
- json: {
579
- type: options.type,
580
- data: {},
581
- },
582
- });
572
+ json = {
573
+ type: options.type,
574
+ data: {},
575
+ };
583
576
  }
584
577
  break;
585
578
  }
579
+ if (options.withResponse) {
580
+ const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
581
+ json,
582
+ query: {
583
+ with_response: options.withResponse,
584
+ },
585
+ files,
586
+ });
587
+ return transformers_1.Interactions.interactionCallbackResponseFromRaw(response);
588
+ }
589
+ else {
590
+ this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
591
+ json,
592
+ query: {
593
+ with_response: options.withResponse,
594
+ },
595
+ files,
596
+ });
597
+ }
586
598
  }
587
599
  /** https://discord.com/developers/docs/resources/message#create-message */
588
600
  async createMessage(channelID, options) {
@@ -1086,6 +1098,22 @@ class Client extends node_events_1.default {
1086
1098
  });
1087
1099
  return transformers_1.Emojis.emojiFromRaw(response);
1088
1100
  }
1101
+ /** https://discord.com/developers/docs/resources/emoji#modify-guild-incidents-actions */
1102
+ async editGuildIncidentsActions(guildID, options, reason) {
1103
+ const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildIncidentsActions(guildID), {
1104
+ json: {
1105
+ invites_disabled_until: options?.invitesDisabledUntil,
1106
+ dms_disabled_until: options?.dmsDisabledUntil,
1107
+ },
1108
+ reason,
1109
+ });
1110
+ return {
1111
+ invitesDisabledUntil: response.invites_disabled_until,
1112
+ dmsDisabledUntil: response.dms_disabled_until,
1113
+ dmSpamDetectedAt: response.dm_spam_detected_at,
1114
+ raidDetectedAt: response.raid_detected_at,
1115
+ };
1116
+ }
1089
1117
  /** https://discord.com/developers/docs/resources/guild#modify-guild-member */
1090
1118
  async editGuildMember(guildID, userID, options, reason) {
1091
1119
  const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(guildID, userID), {
@@ -1503,6 +1531,7 @@ class Client extends node_events_1.default {
1503
1531
  files: options.files,
1504
1532
  query: {
1505
1533
  thread_id: options.threadID,
1534
+ with_components: options.withComponents,
1506
1535
  },
1507
1536
  });
1508
1537
  return transformers_1.Messages.messageFromRaw(response);
@@ -1565,6 +1594,7 @@ class Client extends node_events_1.default {
1565
1594
  query: {
1566
1595
  wait: options.wait,
1567
1596
  thread_id: options.threadID,
1597
+ with_components: options.withComponents,
1568
1598
  },
1569
1599
  });
1570
1600
  return response !== null ? transformers_1.Messages.messageFromRaw(response) : response;
@@ -1745,6 +1775,11 @@ class Client extends node_events_1.default {
1745
1775
  const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.soundboardDefaultSounds());
1746
1776
  return response.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound));
1747
1777
  }
1778
+ /** https://discord.com/developers/docs/resources/entitlement#get-entitlement */
1779
+ async getEntitlement(applicationID, entitlementID) {
1780
+ const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlement(applicationID, entitlementID));
1781
+ return transformers_1.Entitlements.entitlementFromRaw(response);
1782
+ }
1748
1783
  /** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
1749
1784
  async getEntitlements(applicationID, options) {
1750
1785
  const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(applicationID), {
@@ -1756,6 +1791,7 @@ class Client extends node_events_1.default {
1756
1791
  limit: options?.limit,
1757
1792
  guild_id: options?.guildID,
1758
1793
  exclude_ended: options?.excludeEnded,
1794
+ exclude_deleted: options?.excludeDeleted,
1759
1795
  },
1760
1796
  });
1761
1797
  return response.map((entitlement) => transformers_1.Entitlements.entitlementFromRaw(entitlement));
@@ -63,7 +63,8 @@ export declare enum Locales {
63
63
  export declare enum ApplicationCommandTypes {
64
64
  ChatInput = 1,
65
65
  User = 2,
66
- Message = 3
66
+ Message = 3,
67
+ PrimaryEntryPoint = 4
67
68
  }
68
69
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type */
69
70
  export declare enum ApplicationCommandOptionType {
@@ -79,6 +80,11 @@ export declare enum ApplicationCommandOptionType {
79
80
  Number = 10,
80
81
  Attachment = 11
81
82
  }
83
+ /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-entry-point-command-handler-types */
84
+ export declare enum EntryPointCommandHandlerTypes {
85
+ AppHandler = 1,
86
+ DiscordLaunchActivity = 2
87
+ }
82
88
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type */
83
89
  export declare enum ApplicationCommandPermissionType {
84
90
  Role = 1,
@@ -119,7 +125,8 @@ export declare enum InteractionCallbackType {
119
125
  UpdateMessage = 7,
120
126
  ApplicationCommandAutocompleteResult = 8,
121
127
  Modal = 9,
122
- PremiumRequired = 10
128
+ PremiumRequired = 10,
129
+ LaunchActivity = 12
123
130
  }
124
131
  /** https://discord.com/developers/docs/interactions/message-components#button-object-button-styles */
125
132
  export declare enum ButtonStyles {
@@ -542,7 +549,8 @@ export declare enum MessageFlags {
542
549
  Loading = 128,
543
550
  FailedToMentionSomeRolesInThread = 256,
544
551
  SuppressNotifications = 4096,
545
- IsVoiceMessage = 8192
552
+ IsVoiceMessage = 8192,
553
+ HasSnapshot = 16384
546
554
  }
547
555
  /** https://discord.com/developers/docs/resources/message#message-reference-types */
548
556
  export declare enum MessageReferenceTypes {
@@ -624,12 +632,17 @@ export declare enum PremiumTypes {
624
632
  export declare enum Services {
625
633
  AmazonMusic = "amazon-music",
626
634
  BattleNet = "battlenet",
635
+ BungieNet = "bungie",
636
+ Bluesky = "bluesky",
637
+ Crunchyroll = "crunchyroll",
638
+ Domain = "domain",
627
639
  Ebay = "ebay",
628
640
  EpicGames = "epicgames",
629
641
  Facebook = "facebook",
630
642
  GitHub = "github",
631
643
  Instagram = "instagram",
632
644
  LeagueOfLegends = "leagueoflegends",
645
+ Mastodon = "mastodon",
633
646
  PayPal = "paypal",
634
647
  Playstation = "playstation",
635
648
  Reddit = "reddit",
@@ -896,7 +909,8 @@ export declare enum VoiceCloseEventCodes {
896
909
  UnknownProtocol = 4012,
897
910
  Disconnect = 4014,
898
911
  VoiceServerCrashed = 4015,
899
- UnknownEncryptionMode = 4016
912
+ UnknownEncryptionMode = 4016,
913
+ BadRequest = 4020
900
914
  }
901
915
  /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#http-http-response-codes */
902
916
  export declare enum HTTPResponseCodes {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MessageTypes = exports.InviteTargetTypes = exports.InviteTypes = exports.GuildScheduledEventRecurrenceRuleMonth = exports.GuildScheduledEventRecurrenceRuleWeekday = exports.GuildScheduledEventRecurrenceRuleFrequency = exports.GuildScheduledEventStatus = exports.GuildScheduledEventEntityTypes = exports.GuildScheduledEventPrivacyLevel = exports.ImageWidgetStyleOptions = exports.PromptTypes = exports.OnboardingMode = exports.IntegrationExpireBehaviors = exports.GuildMemberFlags = exports.MutableGuildFeatures = exports.GuildFeatures = exports.SystemChannelFlags = exports.PremiumTier = exports.GuildNSFWLevel = exports.VerificationLevel = exports.MFALevel = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ActivityLocationKind = exports.ApplicationFlags = exports.ApplicationIntegrationTypes = exports.TextInputStyles = exports.ButtonStyles = exports.InteractionCallbackType = exports.ComponentTypes = exports.InteractionContextTypes = exports.InteractionType = exports.ApplicationCommandPermissionType = exports.ApplicationCommandOptionType = exports.ApplicationCommandTypes = exports.Locales = exports.ImageFormats = exports.GuildNavigationTypes = exports.TimestampStyles = void 0;
4
- exports.EntitlementTypes = exports.SKUFlags = exports.SKUTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.AnimationTypes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.SubscriptionStatuses = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.ReactionTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.EmbedTypes = exports.MessageReferenceTypes = exports.MessageFlags = exports.MessageActivityTypes = void 0;
3
+ exports.InviteTargetTypes = exports.InviteTypes = exports.GuildScheduledEventRecurrenceRuleMonth = exports.GuildScheduledEventRecurrenceRuleWeekday = exports.GuildScheduledEventRecurrenceRuleFrequency = exports.GuildScheduledEventStatus = exports.GuildScheduledEventEntityTypes = exports.GuildScheduledEventPrivacyLevel = exports.ImageWidgetStyleOptions = exports.PromptTypes = exports.OnboardingMode = exports.IntegrationExpireBehaviors = exports.GuildMemberFlags = exports.MutableGuildFeatures = exports.GuildFeatures = exports.SystemChannelFlags = exports.PremiumTier = exports.GuildNSFWLevel = exports.VerificationLevel = exports.MFALevel = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ActivityLocationKind = exports.ApplicationFlags = exports.ApplicationIntegrationTypes = exports.TextInputStyles = exports.ButtonStyles = exports.InteractionCallbackType = exports.ComponentTypes = exports.InteractionContextTypes = exports.InteractionType = exports.ApplicationCommandPermissionType = exports.EntryPointCommandHandlerTypes = exports.ApplicationCommandOptionType = exports.ApplicationCommandTypes = exports.Locales = exports.ImageFormats = exports.GuildNavigationTypes = exports.TimestampStyles = void 0;
4
+ exports.EntitlementTypes = exports.SKUFlags = exports.SKUTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.AnimationTypes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.SubscriptionStatuses = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.ReactionTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.EmbedTypes = exports.MessageReferenceTypes = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = void 0;
5
5
  /** https://discord.com/developers/docs/reference#message-formatting-timestamp-styles */
6
6
  var TimestampStyles;
7
7
  (function (TimestampStyles) {
@@ -73,6 +73,7 @@ var ApplicationCommandTypes;
73
73
  ApplicationCommandTypes[ApplicationCommandTypes["ChatInput"] = 1] = "ChatInput";
74
74
  ApplicationCommandTypes[ApplicationCommandTypes["User"] = 2] = "User";
75
75
  ApplicationCommandTypes[ApplicationCommandTypes["Message"] = 3] = "Message";
76
+ ApplicationCommandTypes[ApplicationCommandTypes["PrimaryEntryPoint"] = 4] = "PrimaryEntryPoint";
76
77
  })(ApplicationCommandTypes || (exports.ApplicationCommandTypes = ApplicationCommandTypes = {}));
77
78
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type */
78
79
  var ApplicationCommandOptionType;
@@ -89,6 +90,12 @@ var ApplicationCommandOptionType;
89
90
  ApplicationCommandOptionType[ApplicationCommandOptionType["Number"] = 10] = "Number";
90
91
  ApplicationCommandOptionType[ApplicationCommandOptionType["Attachment"] = 11] = "Attachment";
91
92
  })(ApplicationCommandOptionType || (exports.ApplicationCommandOptionType = ApplicationCommandOptionType = {}));
93
+ /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-entry-point-command-handler-types */
94
+ var EntryPointCommandHandlerTypes;
95
+ (function (EntryPointCommandHandlerTypes) {
96
+ EntryPointCommandHandlerTypes[EntryPointCommandHandlerTypes["AppHandler"] = 1] = "AppHandler";
97
+ EntryPointCommandHandlerTypes[EntryPointCommandHandlerTypes["DiscordLaunchActivity"] = 2] = "DiscordLaunchActivity";
98
+ })(EntryPointCommandHandlerTypes || (exports.EntryPointCommandHandlerTypes = EntryPointCommandHandlerTypes = {}));
92
99
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type */
93
100
  var ApplicationCommandPermissionType;
94
101
  (function (ApplicationCommandPermissionType) {
@@ -135,6 +142,7 @@ var InteractionCallbackType;
135
142
  InteractionCallbackType[InteractionCallbackType["ApplicationCommandAutocompleteResult"] = 8] = "ApplicationCommandAutocompleteResult";
136
143
  InteractionCallbackType[InteractionCallbackType["Modal"] = 9] = "Modal";
137
144
  InteractionCallbackType[InteractionCallbackType["PremiumRequired"] = 10] = "PremiumRequired";
145
+ InteractionCallbackType[InteractionCallbackType["LaunchActivity"] = 12] = "LaunchActivity";
138
146
  })(InteractionCallbackType || (exports.InteractionCallbackType = InteractionCallbackType = {}));
139
147
  /** https://discord.com/developers/docs/interactions/message-components#button-object-button-styles */
140
148
  var ButtonStyles;
@@ -599,6 +607,7 @@ var MessageFlags;
599
607
  MessageFlags[MessageFlags["FailedToMentionSomeRolesInThread"] = 256] = "FailedToMentionSomeRolesInThread";
600
608
  MessageFlags[MessageFlags["SuppressNotifications"] = 4096] = "SuppressNotifications";
601
609
  MessageFlags[MessageFlags["IsVoiceMessage"] = 8192] = "IsVoiceMessage";
610
+ MessageFlags[MessageFlags["HasSnapshot"] = 16384] = "HasSnapshot";
602
611
  })(MessageFlags || (exports.MessageFlags = MessageFlags = {}));
603
612
  /** https://discord.com/developers/docs/resources/message#message-reference-types */
604
613
  var MessageReferenceTypes;
@@ -692,12 +701,17 @@ var Services;
692
701
  (function (Services) {
693
702
  Services["AmazonMusic"] = "amazon-music";
694
703
  Services["BattleNet"] = "battlenet";
704
+ Services["BungieNet"] = "bungie";
705
+ Services["Bluesky"] = "bluesky";
706
+ Services["Crunchyroll"] = "crunchyroll";
707
+ Services["Domain"] = "domain";
695
708
  Services["Ebay"] = "ebay";
696
709
  Services["EpicGames"] = "epicgames";
697
710
  Services["Facebook"] = "facebook";
698
711
  Services["GitHub"] = "github";
699
712
  Services["Instagram"] = "instagram";
700
713
  Services["LeagueOfLegends"] = "leagueoflegends";
714
+ Services["Mastodon"] = "mastodon";
701
715
  Services["PayPal"] = "paypal";
702
716
  Services["Playstation"] = "playstation";
703
717
  Services["Reddit"] = "reddit";
@@ -980,6 +994,7 @@ var VoiceCloseEventCodes;
980
994
  VoiceCloseEventCodes[VoiceCloseEventCodes["Disconnect"] = 4014] = "Disconnect";
981
995
  VoiceCloseEventCodes[VoiceCloseEventCodes["VoiceServerCrashed"] = 4015] = "VoiceServerCrashed";
982
996
  VoiceCloseEventCodes[VoiceCloseEventCodes["UnknownEncryptionMode"] = 4016] = "UnknownEncryptionMode";
997
+ VoiceCloseEventCodes[VoiceCloseEventCodes["BadRequest"] = 4020] = "BadRequest";
983
998
  })(VoiceCloseEventCodes || (exports.VoiceCloseEventCodes = VoiceCloseEventCodes = {}));
984
999
  /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#http-http-response-codes */
985
1000
  var HTTPResponseCodes;
@@ -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,
@@ -331,7 +332,7 @@ class Shard {
331
332
  });
332
333
  break;
333
334
  case constants_1.GatewayEvents.GuildSoundboardSoundsUpdate:
334
- this.client.emit("guildSoundboardSoundsUpdate", packet.d.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound)));
335
+ this.client.emit("guildSoundboardSoundsUpdate", packet.d.soundboard_sounds.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound)), packet.d.guild_id);
335
336
  break;
336
337
  case constants_1.GatewayEvents.SoundboardSounds:
337
338
  this.client.emit("soundboardSounds", packet.d.soundboard_sounds.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound)), packet.d.guild_id);
@@ -12,6 +12,7 @@ export declare const guildChannels: (guildID: snowflake) => `guilds/${string}/ch
12
12
  export declare const guildMemberNickname: (guildID: snowflake) => `guilds/${string}/members/@me/nick`;
13
13
  export declare const guildEmoji: (guildID: snowflake, emojiID: snowflake) => `guilds/${string}/emojis/${string}`;
14
14
  export declare const guildEmojis: (guildID: snowflake) => `guilds/${string}/emojis`;
15
+ export declare const guildIncidentsActions: (guildID: snowflake) => `guilds/${string}/incidents-actions`;
15
16
  export declare const guildIntegration: (guildID: snowflake, integrationID: snowflake) => `guilds/${string}/integrations/${string}`;
16
17
  export declare const guildIntegrations: (guildID: snowflake) => `guilds/${string}/integrations`;
17
18
  export declare const guildInvites: (guildID: snowflake) => `guilds/${string}/invites`;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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;
3
+ 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.guildIncidentsActions = 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.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 = exports.channelMessage = void 0;
5
+ exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = void 0;
6
6
  // Guilds
7
7
  const guild = (guildID) => `guilds/${guildID}`;
8
8
  exports.guild = guild;
@@ -30,6 +30,8 @@ const guildEmoji = (guildID, emojiID) => `guilds/${guildID}/emojis/${emojiID}`;
30
30
  exports.guildEmoji = guildEmoji;
31
31
  const guildEmojis = (guildID) => `guilds/${guildID}/emojis`;
32
32
  exports.guildEmojis = guildEmojis;
33
+ const guildIncidentsActions = (guildID) => `guilds/${guildID}/incidents-actions`;
34
+ exports.guildIncidentsActions = guildIncidentsActions;
33
35
  const guildIntegration = (guildID, integrationID) => `guilds/${guildID}/integrations/${integrationID}`;
34
36
  exports.guildIntegration = guildIntegration;
35
37
  const guildIntegrations = (guildID) => `guilds/${guildID}/integrations`;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { type JSONErrorCodes } from "../constants";
3
4
  export declare enum RESTMethods {
4
5
  Get = "GET",
@@ -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) {
@@ -85,6 +85,14 @@ class Guilds {
85
85
  stickers: guild.stickers?.map((sticker) => Stickers_1.Stickers.stickerFromRaw(sticker)),
86
86
  premiumProgressBarEnabled: guild.premium_progress_bar_enabled,
87
87
  safetyAlertsChannelID: guild.safety_alerts_channel_id,
88
+ incidentsData: guild.incidents_data !== null
89
+ ? {
90
+ invitesDisabledUntil: guild.incidents_data.invites_disabled_until,
91
+ dmsDisabledUntil: guild.incidents_data.dms_disabled_until,
92
+ dmSpamDetectedAt: guild.incidents_data.dm_spam_detected_at,
93
+ raidDetectedAt: guild.incidents_data.raid_detected_at,
94
+ }
95
+ : null,
88
96
  };
89
97
  }
90
98
  static guildMemberFromRaw(guildMember) {
@@ -194,6 +202,14 @@ class Guilds {
194
202
  stickers: guild.stickers?.map((sticker) => Stickers_1.Stickers.stickerToRaw(sticker)),
195
203
  premium_progress_bar_enabled: guild.premiumProgressBarEnabled,
196
204
  safety_alerts_channel_id: guild.safetyAlertsChannelID,
205
+ incidents_data: guild.incidentsData !== null
206
+ ? {
207
+ invites_disabled_until: guild.incidentsData.invitesDisabledUntil,
208
+ dms_disabled_until: guild.incidentsData.dmsDisabledUntil,
209
+ dm_spam_detected_at: guild.incidentsData.dmSpamDetectedAt,
210
+ raid_detected_at: guild.incidentsData.raidDetectedAt,
211
+ }
212
+ : null,
197
213
  };
198
214
  }
199
215
  static integrationFromRaw(integration) {
@@ -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,
@@ -8,6 +8,7 @@ class Subscriptions {
8
8
  userID: subscription.user_id,
9
9
  skuIDs: subscription.sku_ids,
10
10
  entitlementIDs: subscription.entitlement_ids,
11
+ renewalSKUIDs: subscription.renewal_sku_ids,
11
12
  currentPeriodStart: subscription.current_period_start,
12
13
  currentPeriodEnd: subscription.current_period_end,
13
14
  status: subscription.status,
@@ -21,6 +22,7 @@ class Subscriptions {
21
22
  user_id: subscription.userID,
22
23
  sku_ids: subscription.skuIDs,
23
24
  entitlement_ids: subscription.entitlementIDs,
25
+ renewal_sku_ids: subscription.renewalSKUIDs,
24
26
  current_period_start: subscription.currentPeriodStart,
25
27
  current_period_end: subscription.currentPeriodEnd,
26
28
  status: subscription.status,
@@ -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;
@@ -9,8 +9,8 @@ export interface RawEntitlement {
9
9
  type: EntitlementTypes;
10
10
  deleted: boolean;
11
11
  consumed?: boolean;
12
- starts_at?: timestamp;
13
- ends_at?: timestamp;
12
+ starts_at: timestamp | null;
13
+ ends_at: timestamp | null;
14
14
  guild_id?: snowflake;
15
15
  }
16
16
  export interface Entitlement {
@@ -21,7 +21,7 @@ export interface Entitlement {
21
21
  type: EntitlementTypes;
22
22
  deleted: boolean;
23
23
  consumed?: boolean;
24
- startsAt?: timestamp;
25
- endsAt?: timestamp;
24
+ startsAt: timestamp | null;
25
+ endsAt: timestamp | null;
26
26
  guildID?: snowflake;
27
27
  }
@@ -154,6 +154,7 @@ export interface RawGuildMemberUpdateEventFields {
154
154
  user: RawUser;
155
155
  nick?: string | null;
156
156
  avatar: string | null;
157
+ banner: string | null;
157
158
  joined_at?: timestamp | null;
158
159
  premium_since?: number | null;
159
160
  deaf?: boolean;
@@ -497,6 +498,7 @@ export interface GuildMemberUpdateEventFields {
497
498
  user: User;
498
499
  nick?: string | null;
499
500
  avatar: string | null;
501
+ banner: string | null;
500
502
  joinedAt?: timestamp | null;
501
503
  premiumSince?: number | null;
502
504
  deaf?: boolean;
@@ -50,6 +50,7 @@ export interface RawGuild {
50
50
  stickers?: Array<RawSticker>;
51
51
  premium_progress_bar_enabled: boolean;
52
52
  safety_alerts_channel_id: snowflake | null;
53
+ incidents_data: RawIncidentsData | null;
53
54
  }
54
55
  /** https://discord.com/developers/docs/resources/guild#unavailable-guild-object */
55
56
  export interface RawUnavailableGuild {
@@ -89,6 +90,7 @@ export interface RawGuildMember {
89
90
  user?: RawUser;
90
91
  nick?: string | null;
91
92
  avatar?: string | null;
93
+ banner?: string | null;
92
94
  roles: Array<snowflake>;
93
95
  joined_at: timestamp;
94
96
  premium_since?: number | null;
@@ -179,6 +181,13 @@ export interface RawPromptOption {
179
181
  title: string;
180
182
  description: string | null;
181
183
  }
184
+ /** https://discord.com/developers/docs/resources/guild#incidents-data-object-incidents-data-structure */
185
+ export interface RawIncidentsData {
186
+ invites_disabled_until: timestamp | null;
187
+ dms_disabled_until: timestamp | null;
188
+ dm_spam_detected_at?: timestamp | null;
189
+ raid_detected_at?: timestamp | null;
190
+ }
182
191
  export interface Guild {
183
192
  id: snowflake;
184
193
  name: string;
@@ -223,6 +232,7 @@ export interface Guild {
223
232
  stickers?: Array<Sticker>;
224
233
  premiumProgressBarEnabled: boolean;
225
234
  safetyAlertsChannelID: snowflake | null;
235
+ incidentsData: IncidentsData | null;
226
236
  }
227
237
  export interface UnavailableGuild {
228
238
  id: snowflake;
@@ -257,6 +267,7 @@ export interface GuildMember {
257
267
  user?: User;
258
268
  nick?: string | null;
259
269
  avatar?: string | null;
270
+ banner?: string | null;
260
271
  roles: Array<snowflake>;
261
272
  joinedAt: string;
262
273
  premiumSince?: number | null;
@@ -338,3 +349,9 @@ export interface PromptOption {
338
349
  title: string;
339
350
  description: string | null;
340
351
  }
352
+ export interface IncidentsData {
353
+ invitesDisabledUntil: timestamp | null;
354
+ dmsDisabledUntil: timestamp | null;
355
+ dmSpamDetectedAt?: timestamp | null;
356
+ raidDetectedAt?: timestamp | null;
357
+ }
@@ -104,6 +104,30 @@ export interface RawInteractionCallbackData {
104
104
  custom_id?: string;
105
105
  title?: string;
106
106
  }
107
+ /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-response-object */
108
+ export interface RawInteractionCallbackResponse {
109
+ interaction: RawInteractionCallback;
110
+ resource?: RawInteractionResource;
111
+ }
112
+ /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-object */
113
+ export interface RawInteractionCallback {
114
+ id: snowflake;
115
+ type: InteractionType;
116
+ activity_instance_id?: string;
117
+ response_message_id?: snowflake;
118
+ response_message_loading?: boolean;
119
+ response_message_ephemeral?: boolean;
120
+ }
121
+ /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-resource-object */
122
+ export interface RawInteractionResource {
123
+ type: InteractionCallbackType;
124
+ activity_instance?: RawActivityInstanceResource;
125
+ message?: RawMessage;
126
+ }
127
+ /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-activity-instance-resource */
128
+ export interface RawActivityInstanceResource {
129
+ id: string;
130
+ }
107
131
  export interface Interaction {
108
132
  id: snowflake;
109
133
  applicationID: snowflake;
@@ -189,3 +213,23 @@ export interface InteractionCallbackData {
189
213
  customID?: string;
190
214
  title?: string;
191
215
  }
216
+ export interface InteractionCallbackResponse {
217
+ interaction: InteractionCallback;
218
+ resource?: InteractionResource;
219
+ }
220
+ export interface InteractionCallback {
221
+ id: snowflake;
222
+ type: InteractionType;
223
+ activityInstanceID?: string;
224
+ responseMessageID?: snowflake;
225
+ responseMessageLoading?: boolean;
226
+ responseMessageEphemeral?: boolean;
227
+ }
228
+ export interface InteractionResource {
229
+ type: InteractionCallbackType;
230
+ activityInstance?: ActivityInstanceResource;
231
+ message?: Message;
232
+ }
233
+ export interface ActivityInstanceResource {
234
+ id: string;
235
+ }
@@ -191,10 +191,10 @@ export interface RawChannelMention {
191
191
  }
192
192
  /** https://discord.com/developers/docs/resources/message#allowed-mentions-object-allowed-mentions-structure */
193
193
  export interface RawAllowedMentions {
194
- parse: Array<AllowedMentionTypes>;
195
- roles: Array<snowflake>;
196
- users: Array<snowflake>;
197
- replied_user: boolean;
194
+ parse?: Array<AllowedMentionTypes>;
195
+ roles?: Array<snowflake>;
196
+ users?: Array<snowflake>;
197
+ replied_user?: boolean;
198
198
  }
199
199
  export interface Message {
200
200
  id: snowflake;
@@ -359,8 +359,8 @@ export interface ChannelMention {
359
359
  name: string;
360
360
  }
361
361
  export interface AllowedMentions {
362
- parse: Array<AllowedMentionTypes>;
363
- roles: Array<snowflake>;
364
- users: Array<snowflake>;
365
- repliedUser: boolean;
362
+ parse?: Array<AllowedMentionTypes>;
363
+ roles?: Array<snowflake>;
364
+ users?: Array<snowflake>;
365
+ repliedUser?: boolean;
366
366
  }
@@ -6,6 +6,7 @@ export interface RawSubscription {
6
6
  user_id: snowflake;
7
7
  sku_ids: Array<snowflake>;
8
8
  entitlement_ids: Array<snowflake>;
9
+ renewal_sku_ids: Array<snowflake>;
9
10
  current_period_start: timestamp;
10
11
  current_period_end: timestamp;
11
12
  status: SubscriptionStatuses;
@@ -17,6 +18,7 @@ export interface Subscription {
17
18
  userID: snowflake;
18
19
  skuIDs: Array<snowflake>;
19
20
  entitlementIDs: Array<snowflake>;
21
+ renewalSKUIDs: Array<snowflake>;
20
22
  currentPeriodStart: timestamp;
21
23
  currentPeriodEnd: timestamp;
22
24
  status: SubscriptionStatuses;
package/dist/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.2.5-dev.aee496f",
3
+ "version": "2.2.5",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/XenKys/disgroove.git"
9
+ "url": "git+https://github.com/sergiogotuzzo/disgroove.git"
10
10
  },
11
11
  "keywords": [
12
12
  "api",
@@ -21,15 +21,15 @@
21
21
  "author": "XenKys",
22
22
  "license": "MIT",
23
23
  "bugs": {
24
- "url": "https://github.com/XenKys/disgroove/issues"
24
+ "url": "https://github.com/sergiogotuzzo/disgroove/issues"
25
25
  },
26
- "homepage": "https://github.com/XenKys/disgroove#readme",
26
+ "homepage": "https://github.com/sergiogotuzzo/disgroove#readme",
27
27
  "devDependencies": {
28
- "@types/node": "^22.5.3",
29
- "@types/ws": "^8.5.12",
30
- "typescript": "^5.5.4"
28
+ "@types/node": "^22.13.11",
29
+ "@types/ws": "^8.18.0",
30
+ "typescript": "^5.8.2"
31
31
  },
32
32
  "dependencies": {
33
- "ws": "^8.18.0"
33
+ "ws": "^8.18.1"
34
34
  }
35
35
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.2.5-dev.aee496f",
3
+ "version": "2.2.5",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/XenKys/disgroove.git"
9
+ "url": "git+https://github.com/sergiogotuzzo/disgroove.git"
10
10
  },
11
11
  "keywords": [
12
12
  "api",
@@ -21,15 +21,15 @@
21
21
  "author": "XenKys",
22
22
  "license": "MIT",
23
23
  "bugs": {
24
- "url": "https://github.com/XenKys/disgroove/issues"
24
+ "url": "https://github.com/sergiogotuzzo/disgroove/issues"
25
25
  },
26
- "homepage": "https://github.com/XenKys/disgroove#readme",
26
+ "homepage": "https://github.com/sergiogotuzzo/disgroove#readme",
27
27
  "devDependencies": {
28
- "@types/node": "^22.5.3",
29
- "@types/ws": "^8.5.12",
30
- "typescript": "^5.5.4"
28
+ "@types/node": "^22.13.11",
29
+ "@types/ws": "^8.18.0",
30
+ "typescript": "^5.8.2"
31
31
  },
32
32
  "dependencies": {
33
- "ws": "^8.18.0"
33
+ "ws": "^8.18.1"
34
34
  }
35
35
  }