disgroove 2.1.0-dev.4032d61 → 2.1.0-dev.67a3bb5

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.
@@ -51,6 +51,8 @@ export declare class Client extends EventEmitter {
51
51
  bulkEditGuildApplicationCommands(applicationId: string, guildId: string, commands: BulkEditGuildApplicationCommandsParams): Promise<Array<ApplicationCommand>>;
52
52
  /** https://discord.com/developers/docs/topics/gateway#connections */
53
53
  connect(): Promise<void>;
54
+ /** https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement */
55
+ consumeEntitlement(applicationId: string, entitlementId: string): void;
54
56
  /** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
55
57
  createAutoModerationRule(guildId: string, options: CreateAutoModerationRuleParams, reason?: string): Promise<AutoModerationRule>;
56
58
  /** https://discord.com/developers/docs/resources/guild#create-guild-channel */
@@ -131,6 +131,10 @@ class Client extends node_events_1.default {
131
131
  this.shards.set(i, new gateway_1.Shard(i, this));
132
132
  this.shards.connect();
133
133
  }
134
+ /** https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement */
135
+ consumeEntitlement(applicationId, entitlementId) {
136
+ this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlementConsume(applicationId, entitlementId));
137
+ }
134
138
  /** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
135
139
  createAutoModerationRule(guildId, options, reason) {
136
140
  return this.rest
@@ -1097,6 +1097,8 @@ export declare enum MembershipState {
1097
1097
  }
1098
1098
  /** https://discord.com/developers/docs/monetization/skus#sku-object-sku-types */
1099
1099
  export declare enum SkuTypes {
1100
+ Durable = 2,
1101
+ Consumable = 3,
1100
1102
  Subscription = 5,
1101
1103
  SubscriptionGroup = 6
1102
1104
  }
@@ -1108,5 +1110,12 @@ export declare enum SkuFlags {
1108
1110
  }
1109
1111
  /** https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types */
1110
1112
  export declare enum EntitlementTypes {
1113
+ Purchase = 1,
1114
+ PremiumSubscription = 2,
1115
+ DeveloperGift = 3,
1116
+ TestModePurchase = 4,
1117
+ FreePurchase = 5,
1118
+ UserGift = 6,
1119
+ PremiumPurchase = 7,
1111
1120
  ApplicationSubscription = 8
1112
1121
  }
@@ -1176,6 +1176,8 @@ var MembershipState;
1176
1176
  /** https://discord.com/developers/docs/monetization/skus#sku-object-sku-types */
1177
1177
  var SkuTypes;
1178
1178
  (function (SkuTypes) {
1179
+ SkuTypes[SkuTypes["Durable"] = 2] = "Durable";
1180
+ SkuTypes[SkuTypes["Consumable"] = 3] = "Consumable";
1179
1181
  SkuTypes[SkuTypes["Subscription"] = 5] = "Subscription";
1180
1182
  SkuTypes[SkuTypes["SubscriptionGroup"] = 6] = "SubscriptionGroup";
1181
1183
  })(SkuTypes || (exports.SkuTypes = SkuTypes = {}));
@@ -1189,5 +1191,12 @@ var SkuFlags;
1189
1191
  /** https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types */
1190
1192
  var EntitlementTypes;
1191
1193
  (function (EntitlementTypes) {
1194
+ EntitlementTypes[EntitlementTypes["Purchase"] = 1] = "Purchase";
1195
+ EntitlementTypes[EntitlementTypes["PremiumSubscription"] = 2] = "PremiumSubscription";
1196
+ EntitlementTypes[EntitlementTypes["DeveloperGift"] = 3] = "DeveloperGift";
1197
+ EntitlementTypes[EntitlementTypes["TestModePurchase"] = 4] = "TestModePurchase";
1198
+ EntitlementTypes[EntitlementTypes["FreePurchase"] = 5] = "FreePurchase";
1199
+ EntitlementTypes[EntitlementTypes["UserGift"] = 6] = "UserGift";
1200
+ EntitlementTypes[EntitlementTypes["PremiumPurchase"] = 7] = "PremiumPurchase";
1192
1201
  EntitlementTypes[EntitlementTypes["ApplicationSubscription"] = 8] = "ApplicationSubscription";
1193
1202
  })(EntitlementTypes || (exports.EntitlementTypes = EntitlementTypes = {}));
@@ -72,6 +72,7 @@ export declare const applicationCommands: (applicationId: string) => `applicatio
72
72
  export declare const applicationCommandPermissions: (applicationId: string, guildId: string, commandId: string) => `applications/${string}/guilds/${string}/commands/${string}/permissions`;
73
73
  export declare const applicationCurrentUser: () => "applications/@me";
74
74
  export declare const applicationEntitlement: (applicationId: string, entitlementId: string) => `applications/${string}/entitlements/${string}`;
75
+ export declare const applicationEntitlementConsume: (applicationId: string, entitlementId: string) => `applications/${string}/entitlements/${string}/consume`;
75
76
  export declare const applicationEntitlements: (applicationId: string) => `applications/${string}/entitlements`;
76
77
  export declare const applicationGuildCommand: (applicationId: string, guildId: string, commandId: string) => `applications/${string}/guilds/${string}/commands/${string}`;
77
78
  export declare const applicationGuildCommands: (applicationId: string, guildId: string) => `applications/${string}/guilds/${string}/commands`;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
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.guildCurrentMemberNickname = exports.guildChannels = exports.guildBans = exports.guildBan = exports.guildAutoModerationRules = exports.guildAutoModerationRule = exports.guildAuditLog = exports.guildActiveThreads = exports.guilds = exports.guild = exports.bulkGuildBan = void 0;
4
- exports.voiceRegions = exports.stickerPacks = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2CurrentAuthorization = exports.oauth2CurrentApplication = exports.oauth2Authorization = exports.gatewayBot = exports.gateway = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSkus = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlement = exports.applicationCurrentUser = 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;
4
+ exports.voiceRegions = exports.stickerPacks = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2CurrentAuthorization = exports.oauth2CurrentApplication = exports.oauth2Authorization = 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.applicationCurrentUser = 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;
5
5
  // Guilds
6
6
  const bulkGuildBan = (guildId) => `guilds/${guildId}/bulk-ban`;
7
7
  exports.bulkGuildBan = bulkGuildBan;
@@ -162,6 +162,8 @@ const applicationCurrentUser = () => "applications/@me";
162
162
  exports.applicationCurrentUser = applicationCurrentUser;
163
163
  const applicationEntitlement = (applicationId, entitlementId) => `applications/${applicationId}/entitlements/${entitlementId}`;
164
164
  exports.applicationEntitlement = applicationEntitlement;
165
+ const applicationEntitlementConsume = (applicationId, entitlementId) => `applications/${applicationId}/entitlements/${entitlementId}/consume`;
166
+ exports.applicationEntitlementConsume = applicationEntitlementConsume;
165
167
  const applicationEntitlements = (applicationId) => `applications/${applicationId}/entitlements`;
166
168
  exports.applicationEntitlements = applicationEntitlements;
167
169
  const applicationGuildCommand = (applicationId, guildId, commandId) => `applications/${applicationId}/guilds/${guildId}/commands/${commandId}`;
@@ -1,4 +1,4 @@
1
- import type { AllowedMentionTypes, AttachmentFlags, ChannelFlags, ChannelTypes, ForumLayoutTypes, InviteTargetTypes, MessageActivityTypes, MessageFlags, MessageTypes, SortOrderTypes, VideoQualityModes } from "../constants";
1
+ import type { AllowedMentionTypes, ApplicationIntegrationTypes, AttachmentFlags, ChannelFlags, ChannelTypes, ForumLayoutTypes, InteractionType, InviteTargetTypes, MessageActivityTypes, MessageFlags, MessageTypes, SortOrderTypes, VideoQualityModes } from "../constants";
2
2
  import type { RawApplication, RawGuildMember, RawUser, RawEmoji, RawSticker, RawStickerItem, RawMessageInteraction, MessageInteraction, StickerItem, Sticker, Emoji, User, Application, GuildMember, RawActionRow, ActionRow, RawResolvedData, ResolvedData, RawPollCreateParams, PollCreateParams } from ".";
3
3
  import type { File } from "../rest";
4
4
  /** https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */
@@ -65,6 +65,7 @@ export interface RawMessage {
65
65
  message_reference?: RawMessageReference;
66
66
  flags?: MessageFlags;
67
67
  referenced_message?: RawMessage | null;
68
+ interaction_metadata?: RawMessageInteractionMetadata;
68
69
  interaction?: RawMessageInteraction;
69
70
  thread?: RawChannel;
70
71
  components?: Array<RawActionRow>;
@@ -80,6 +81,16 @@ export interface RawMessageActivity {
80
81
  type: MessageActivityTypes;
81
82
  party_id?: string;
82
83
  }
84
+ /** https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object-message-interaction-metadata-structure */
85
+ export interface RawMessageInteractionMetadata {
86
+ id: string;
87
+ type: InteractionType;
88
+ user: RawUser;
89
+ authorizing_integration_owners: Record<ApplicationIntegrationTypes, string>;
90
+ original_response_message_id?: string;
91
+ interacted_message_id?: string;
92
+ triggering_interaction_metadata?: RawMessageInteractionMetadata;
93
+ }
83
94
  /** https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */
84
95
  export interface RawMessageReference {
85
96
  message_id?: string;
@@ -303,6 +314,7 @@ export interface Message {
303
314
  messageReference?: MessageReference;
304
315
  flags?: MessageFlags;
305
316
  referencedMessage?: Message | null;
317
+ interactionMetadata?: MessageInteractionMetadata;
306
318
  interaction?: MessageInteraction;
307
319
  thread?: Channel;
308
320
  components?: Array<ActionRow>;
@@ -317,6 +329,14 @@ export interface MessageActivity {
317
329
  type: MessageActivityTypes;
318
330
  partyId?: string;
319
331
  }
332
+ export interface MessageInteractionMetadata {
333
+ id: string;
334
+ type: InteractionType;
335
+ user: User;
336
+ authorizingIntegrationOwners: Record<ApplicationIntegrationTypes, string>;
337
+ originalResponseMessageId?: string;
338
+ interactedMessageId?: string;
339
+ }
320
340
  export interface MessageReference {
321
341
  messageId?: string;
322
342
  channelId?: string;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.1.0-dev.4032d61",
3
+ "version": "2.1.0-dev.67a3bb5",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.1.0-dev.4032d61",
3
+ "version": "2.1.0-dev.67a3bb5",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",