disgroove 2.2.4-dev.7c1cced → 2.2.4-dev.9c07d33
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/dist/lib/Client.d.ts +17 -4
- package/dist/lib/Client.js +21 -4
- package/dist/lib/constants.d.ts +18 -4
- package/dist/lib/constants.js +19 -4
- package/dist/lib/gateway/Shard.js +9 -0
- package/dist/lib/rest/Endpoints.d.ts +2 -0
- package/dist/lib/rest/Endpoints.js +7 -2
- package/dist/lib/transformers/Stickers.js +0 -2
- package/dist/lib/transformers/Subscriptions.d.ts +5 -0
- package/dist/lib/transformers/Subscriptions.js +32 -0
- package/dist/lib/transformers/index.d.ts +1 -0
- package/dist/lib/transformers/index.js +1 -0
- package/dist/lib/types/entitlements.d.ts +1 -1
- package/dist/lib/types/sku.d.ts +1 -1
- package/dist/lib/types/sticker.d.ts +0 -2
- package/dist/lib/types/subscription.d.ts +25 -0
- package/dist/lib/types/subscription.js +2 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/lib/Client.d.ts
CHANGED
@@ -29,6 +29,7 @@ import type { VoiceRegion, VoiceState } from "./types/voice";
|
|
29
29
|
import type { Webhook } from "./types/webhook";
|
30
30
|
import type { ClientOptions as WebSocketOptions } from "ws";
|
31
31
|
import type { Embed, AllowedMentions, Attachment, Message, MessageReference } from "./types/message";
|
32
|
+
import { Subscription } from "./types/subscription";
|
32
33
|
export interface GatewayOptions {
|
33
34
|
properties?: IdentifyConnectionProperties;
|
34
35
|
compress?: boolean;
|
@@ -124,7 +125,7 @@ export declare class Client extends EventEmitter {
|
|
124
125
|
}>): Promise<Array<ApplicationCommand>>;
|
125
126
|
/** https://discord.com/developers/docs/topics/gateway#connections */
|
126
127
|
connect(): Promise<void>;
|
127
|
-
/** https://discord.com/developers/docs/
|
128
|
+
/** https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement */
|
128
129
|
consumeEntitlement(applicationID: snowflake, entitlementID: snowflake): void;
|
129
130
|
/** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
|
130
131
|
createAutoModerationRule(guildID: snowflake, options: {
|
@@ -331,7 +332,7 @@ export declare class Client extends EventEmitter {
|
|
331
332
|
sendStartNotifications?: boolean;
|
332
333
|
guildScheduledEventID?: snowflake;
|
333
334
|
}, reason?: string): Promise<StageInstance>;
|
334
|
-
/** https://discord.com/developers/docs/
|
335
|
+
/** https://discord.com/developers/docs/resources/entitlement#create-test-entitlement */
|
335
336
|
createTestEntitlement(applicationID: snowflake, options: {
|
336
337
|
skuID: snowflake;
|
337
338
|
ownerID: snowflake;
|
@@ -782,7 +783,7 @@ export declare class Client extends EventEmitter {
|
|
782
783
|
getCurrentUserConnections(): Promise<Array<Connection>>;
|
783
784
|
/** https://discord.com/developers/docs/resources/voice#get-current-user-voice-state */
|
784
785
|
getCurrentUserVoiceState(guildID: snowflake): Promise<VoiceState>;
|
785
|
-
/** https://discord.com/developers/docs/
|
786
|
+
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
786
787
|
getEntitlements(applicationID: snowflake, options?: {
|
787
788
|
userID?: snowflake;
|
788
789
|
skuIDs?: Array<snowflake>;
|
@@ -959,8 +960,17 @@ export declare class Client extends EventEmitter {
|
|
959
960
|
}): Promise<{
|
960
961
|
users: Array<User>;
|
961
962
|
}>;
|
962
|
-
/** https://discord.com/developers/docs/
|
963
|
+
/** https://discord.com/developers/docs/resources/sku#list-skus */
|
963
964
|
getSKUs(applicationID: snowflake): Promise<Array<SKU>>;
|
965
|
+
/** https://discord.com/developers/docs/resources/subscription#get-sku-subscription */
|
966
|
+
getSKUSubscription(skuID: snowflake, subscriptionID: snowflake): Promise<Subscription>;
|
967
|
+
/** https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions */
|
968
|
+
getSKUSubscriptions(skuID: snowflake, options: {
|
969
|
+
before?: snowflake;
|
970
|
+
after?: snowflake;
|
971
|
+
limit?: number;
|
972
|
+
userID?: snowflake;
|
973
|
+
}): Promise<Array<Subscription>>;
|
964
974
|
/** https://discord.com/developers/docs/resources/stage-instance#get-stage-instance */
|
965
975
|
getStageInstance(channelID: snowflake): Promise<StageInstance>;
|
966
976
|
/** https://discord.com/developers/docs/resources/sticker#get-sticker-pack */
|
@@ -1139,6 +1149,9 @@ export interface ClientEvents {
|
|
1139
1149
|
stageInstanceCreate: [stageInstance: StageInstance];
|
1140
1150
|
stageInstanceUpdate: [stageInstance: StageInstance];
|
1141
1151
|
stageInstanceDelete: [stageInstance: StageInstance];
|
1152
|
+
subscriptionCreate: [subscription: Subscription];
|
1153
|
+
subscriptionUpdate: [subscription: Subscription];
|
1154
|
+
subscriptionDelete: [subscription: Subscription];
|
1142
1155
|
typingStart: [typing: TypingStartEventFields];
|
1143
1156
|
userUpdate: [user: User];
|
1144
1157
|
voiceChannelEffectSend: [voiceEffect: VoiceChannelEffectSendEventFields];
|
package/dist/lib/Client.js
CHANGED
@@ -160,7 +160,7 @@ class Client extends node_events_1.default {
|
|
160
160
|
this.shards.set(i, new gateway_1.Shard(i, this));
|
161
161
|
this.shards.forEach((shard) => shard.connect());
|
162
162
|
}
|
163
|
-
/** https://discord.com/developers/docs/
|
163
|
+
/** https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement */
|
164
164
|
consumeEntitlement(applicationID, entitlementID) {
|
165
165
|
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlementConsume(applicationID, entitlementID));
|
166
166
|
}
|
@@ -636,7 +636,7 @@ class Client extends node_events_1.default {
|
|
636
636
|
});
|
637
637
|
return transformers_1.StageInstances.stageInstanceFromRaw(response);
|
638
638
|
}
|
639
|
-
/** https://discord.com/developers/docs/
|
639
|
+
/** https://discord.com/developers/docs/resources/entitlement#create-test-entitlement */
|
640
640
|
async createTestEntitlement(applicationID, options) {
|
641
641
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlements(applicationID), {
|
642
642
|
json: {
|
@@ -1665,7 +1665,7 @@ class Client extends node_events_1.default {
|
|
1665
1665
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceState(guildID));
|
1666
1666
|
return transformers_1.Voice.voiceStateFromRaw(response);
|
1667
1667
|
}
|
1668
|
-
/** https://discord.com/developers/docs/
|
1668
|
+
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
1669
1669
|
async getEntitlements(applicationID, options) {
|
1670
1670
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(applicationID), {
|
1671
1671
|
query: {
|
@@ -2089,11 +2089,28 @@ class Client extends node_events_1.default {
|
|
2089
2089
|
users: response.users.map((user) => transformers_1.Users.userFromRaw(user)),
|
2090
2090
|
};
|
2091
2091
|
}
|
2092
|
-
/** https://discord.com/developers/docs/
|
2092
|
+
/** https://discord.com/developers/docs/resources/sku#list-skus */
|
2093
2093
|
async getSKUs(applicationID) {
|
2094
2094
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationSKUs(applicationID));
|
2095
2095
|
return response.map((sku) => transformers_1.SKUs.skuFromRaw(sku));
|
2096
2096
|
}
|
2097
|
+
/** https://discord.com/developers/docs/resources/subscription#get-sku-subscription */
|
2098
|
+
async getSKUSubscription(skuID, subscriptionID) {
|
2099
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.skuSubscription(skuID, subscriptionID));
|
2100
|
+
return transformers_1.Subscriptions.subscriptionFromRaw(response);
|
2101
|
+
}
|
2102
|
+
/** https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions */
|
2103
|
+
async getSKUSubscriptions(skuID, options) {
|
2104
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.skuSubscriptions(skuID), {
|
2105
|
+
query: {
|
2106
|
+
before: options.before,
|
2107
|
+
after: options.after,
|
2108
|
+
limit: options.limit,
|
2109
|
+
user_id: options.userID,
|
2110
|
+
},
|
2111
|
+
});
|
2112
|
+
return response.map((subscription) => transformers_1.Subscriptions.subscriptionFromRaw(subscription));
|
2113
|
+
}
|
2097
2114
|
/** https://discord.com/developers/docs/resources/stage-instance#get-stage-instance */
|
2098
2115
|
async getStageInstance(channelID) {
|
2099
2116
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stageInstance(channelID));
|
package/dist/lib/constants.d.ts
CHANGED
@@ -387,7 +387,12 @@ export declare enum GuildMemberFlags {
|
|
387
387
|
DidRejoin = 1,
|
388
388
|
CompletedOnboarding = 2,
|
389
389
|
BypassesVerification = 4,
|
390
|
-
StartedOnboarding = 8
|
390
|
+
StartedOnboarding = 8,
|
391
|
+
IsGuest = 16,
|
392
|
+
StartedHomeActions = 32,
|
393
|
+
CompletedHomeActions = 64,
|
394
|
+
AutomodQuarantinedUsername = 128,
|
395
|
+
DMSettingsUpsellAckownledge = 512
|
391
396
|
}
|
392
397
|
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors */
|
393
398
|
export declare enum IntegrationExpireBehaviors {
|
@@ -637,6 +642,12 @@ export declare enum VisibilityTypes {
|
|
637
642
|
None = 0,
|
638
643
|
Everyone = 1
|
639
644
|
}
|
645
|
+
/** https://discord.com/developers/docs/resources/subscription#subscription-statuses */
|
646
|
+
export declare enum SubscriptionStatuses {
|
647
|
+
Active = 0,
|
648
|
+
Ending = 1,
|
649
|
+
Inactive = 2
|
650
|
+
}
|
640
651
|
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */
|
641
652
|
export declare enum WebhookTypes {
|
642
653
|
Incoming = 1,
|
@@ -745,6 +756,9 @@ export declare enum GatewayEvents {
|
|
745
756
|
StageInstanceCreate = "STAGE_INSTANCE_CREATE",
|
746
757
|
StageInstanceUpdate = "STAGE_INSTANCE_UPDATE",
|
747
758
|
StageInstanceDelete = "STAGE_INSTANCE_DELETE",
|
759
|
+
SubscriptionCreate = "SUBSCRIPTION_CREATE",
|
760
|
+
SubscriptionUpdate = "SUBSCRIPTION_UPDATE",
|
761
|
+
SubscriptionDelete = "SUBSCRIPTION_DELETE",
|
748
762
|
TypingStart = "TYPING_START",
|
749
763
|
UserUpdate = "USER_UPDATE",
|
750
764
|
VoiceChannelEffectSend = "VOICE_CHANNEL_EFFECT_SEND",
|
@@ -1197,20 +1211,20 @@ export declare enum MembershipState {
|
|
1197
1211
|
Invited = 1,
|
1198
1212
|
Accepted = 2
|
1199
1213
|
}
|
1200
|
-
/** https://discord.com/developers/docs/
|
1214
|
+
/** https://discord.com/developers/docs/resources/sku#sku-object-sku-types */
|
1201
1215
|
export declare enum SKUTypes {
|
1202
1216
|
Durable = 2,
|
1203
1217
|
Consumable = 3,
|
1204
1218
|
Subscription = 5,
|
1205
1219
|
SubscriptionGroup = 6
|
1206
1220
|
}
|
1207
|
-
/** https://discord.com/developers/docs/
|
1221
|
+
/** https://discord.com/developers/docs/resources/sku#sku-object-sku-flags */
|
1208
1222
|
export declare enum SKUFlags {
|
1209
1223
|
Available = 4,
|
1210
1224
|
GuildSubscription = 128,
|
1211
1225
|
UserSubscription = 256
|
1212
1226
|
}
|
1213
|
-
/** https://discord.com/developers/docs/
|
1227
|
+
/** https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-types */
|
1214
1228
|
export declare enum EntitlementTypes {
|
1215
1229
|
Purchase = 1,
|
1216
1230
|
PremiumSubscription = 2,
|
package/dist/lib/constants.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
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.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;
|
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;
|
5
5
|
/** https://discord.com/developers/docs/reference#message-formatting-timestamp-styles */
|
6
6
|
var TimestampStyles;
|
7
7
|
(function (TimestampStyles) {
|
@@ -429,6 +429,11 @@ var GuildMemberFlags;
|
|
429
429
|
GuildMemberFlags[GuildMemberFlags["CompletedOnboarding"] = 2] = "CompletedOnboarding";
|
430
430
|
GuildMemberFlags[GuildMemberFlags["BypassesVerification"] = 4] = "BypassesVerification";
|
431
431
|
GuildMemberFlags[GuildMemberFlags["StartedOnboarding"] = 8] = "StartedOnboarding";
|
432
|
+
GuildMemberFlags[GuildMemberFlags["IsGuest"] = 16] = "IsGuest";
|
433
|
+
GuildMemberFlags[GuildMemberFlags["StartedHomeActions"] = 32] = "StartedHomeActions";
|
434
|
+
GuildMemberFlags[GuildMemberFlags["CompletedHomeActions"] = 64] = "CompletedHomeActions";
|
435
|
+
GuildMemberFlags[GuildMemberFlags["AutomodQuarantinedUsername"] = 128] = "AutomodQuarantinedUsername";
|
436
|
+
GuildMemberFlags[GuildMemberFlags["DMSettingsUpsellAckownledge"] = 512] = "DMSettingsUpsellAckownledge";
|
432
437
|
})(GuildMemberFlags || (exports.GuildMemberFlags = GuildMemberFlags = {}));
|
433
438
|
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors */
|
434
439
|
var IntegrationExpireBehaviors;
|
@@ -706,6 +711,13 @@ var VisibilityTypes;
|
|
706
711
|
VisibilityTypes[VisibilityTypes["None"] = 0] = "None";
|
707
712
|
VisibilityTypes[VisibilityTypes["Everyone"] = 1] = "Everyone";
|
708
713
|
})(VisibilityTypes || (exports.VisibilityTypes = VisibilityTypes = {}));
|
714
|
+
/** https://discord.com/developers/docs/resources/subscription#subscription-statuses */
|
715
|
+
var SubscriptionStatuses;
|
716
|
+
(function (SubscriptionStatuses) {
|
717
|
+
SubscriptionStatuses[SubscriptionStatuses["Active"] = 0] = "Active";
|
718
|
+
SubscriptionStatuses[SubscriptionStatuses["Ending"] = 1] = "Ending";
|
719
|
+
SubscriptionStatuses[SubscriptionStatuses["Inactive"] = 2] = "Inactive";
|
720
|
+
})(SubscriptionStatuses || (exports.SubscriptionStatuses = SubscriptionStatuses = {}));
|
709
721
|
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */
|
710
722
|
var WebhookTypes;
|
711
723
|
(function (WebhookTypes) {
|
@@ -819,6 +831,9 @@ var GatewayEvents;
|
|
819
831
|
GatewayEvents["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE";
|
820
832
|
GatewayEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE";
|
821
833
|
GatewayEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE";
|
834
|
+
GatewayEvents["SubscriptionCreate"] = "SUBSCRIPTION_CREATE";
|
835
|
+
GatewayEvents["SubscriptionUpdate"] = "SUBSCRIPTION_UPDATE";
|
836
|
+
GatewayEvents["SubscriptionDelete"] = "SUBSCRIPTION_DELETE";
|
822
837
|
GatewayEvents["TypingStart"] = "TYPING_START";
|
823
838
|
GatewayEvents["UserUpdate"] = "USER_UPDATE";
|
824
839
|
GatewayEvents["VoiceChannelEffectSend"] = "VOICE_CHANNEL_EFFECT_SEND";
|
@@ -1286,7 +1301,7 @@ var MembershipState;
|
|
1286
1301
|
MembershipState[MembershipState["Invited"] = 1] = "Invited";
|
1287
1302
|
MembershipState[MembershipState["Accepted"] = 2] = "Accepted";
|
1288
1303
|
})(MembershipState || (exports.MembershipState = MembershipState = {}));
|
1289
|
-
/** https://discord.com/developers/docs/
|
1304
|
+
/** https://discord.com/developers/docs/resources/sku#sku-object-sku-types */
|
1290
1305
|
var SKUTypes;
|
1291
1306
|
(function (SKUTypes) {
|
1292
1307
|
SKUTypes[SKUTypes["Durable"] = 2] = "Durable";
|
@@ -1294,14 +1309,14 @@ var SKUTypes;
|
|
1294
1309
|
SKUTypes[SKUTypes["Subscription"] = 5] = "Subscription";
|
1295
1310
|
SKUTypes[SKUTypes["SubscriptionGroup"] = 6] = "SubscriptionGroup";
|
1296
1311
|
})(SKUTypes || (exports.SKUTypes = SKUTypes = {}));
|
1297
|
-
/** https://discord.com/developers/docs/
|
1312
|
+
/** https://discord.com/developers/docs/resources/sku#sku-object-sku-flags */
|
1298
1313
|
var SKUFlags;
|
1299
1314
|
(function (SKUFlags) {
|
1300
1315
|
SKUFlags[SKUFlags["Available"] = 4] = "Available";
|
1301
1316
|
SKUFlags[SKUFlags["GuildSubscription"] = 128] = "GuildSubscription";
|
1302
1317
|
SKUFlags[SKUFlags["UserSubscription"] = 256] = "UserSubscription";
|
1303
1318
|
})(SKUFlags || (exports.SKUFlags = SKUFlags = {}));
|
1304
|
-
/** https://discord.com/developers/docs/
|
1319
|
+
/** https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-types */
|
1305
1320
|
var EntitlementTypes;
|
1306
1321
|
(function (EntitlementTypes) {
|
1307
1322
|
EntitlementTypes[EntitlementTypes["Purchase"] = 1] = "Purchase";
|
@@ -493,6 +493,15 @@ class Shard {
|
|
493
493
|
case constants_1.GatewayEvents.WebhooksUpdate:
|
494
494
|
this.client.emit("webhooksUpdate", packet.d.channel_id, packet.d.guild_id);
|
495
495
|
break;
|
496
|
+
case constants_1.GatewayEvents.SubscriptionCreate:
|
497
|
+
this.client.emit("subscriptionCreate", transformers_1.Subscriptions.subscriptionFromRaw(packet.d));
|
498
|
+
break;
|
499
|
+
case constants_1.GatewayEvents.SubscriptionUpdate:
|
500
|
+
this.client.emit("subscriptionUpdate", transformers_1.Subscriptions.subscriptionFromRaw(packet.d));
|
501
|
+
break;
|
502
|
+
case constants_1.GatewayEvents.SubscriptionDelete:
|
503
|
+
this.client.emit("subscriptionDelete", transformers_1.Subscriptions.subscriptionFromRaw(packet.d));
|
504
|
+
break;
|
496
505
|
case constants_1.GatewayEvents.MessagePollVoteAdd:
|
497
506
|
this.client.emit("messagePollVoteAdd", {
|
498
507
|
userID: packet.d.user_id,
|
@@ -88,6 +88,8 @@ export declare const webhookMessage: (webhookID: snowflake, webhookToken: string
|
|
88
88
|
export declare const webhookPlatform: (webhookID: snowflake, webhookToken: string, platform: "github" | "slack") => `webhooks/${string}/${string}/github` | `webhooks/${string}/${string}/slack`;
|
89
89
|
export declare const stickerPack: (packID: snowflake) => `sticker-packs/${string}`;
|
90
90
|
export declare const stickerPacks: () => "sticker-packs";
|
91
|
+
export declare const skuSubscription: (skuID: snowflake, subscriptionID: snowflake) => `skus/${string}/subscriptions/${string}`;
|
92
|
+
export declare const skuSubscriptions: (skuID: snowflake) => `skus/${string}/subscriptions`;
|
91
93
|
export declare const gateway: () => "gateway";
|
92
94
|
export declare const gatewayBot: () => "gateway/bot";
|
93
95
|
export declare const oauth2Authorize: () => "oauth2/authorize";
|
@@ -1,8 +1,8 @@
|
|
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.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.
|
5
|
-
exports.voiceRegions = exports.sticker = void 0;
|
4
|
+
exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = exports.oauth2Application = exports.oauth2Authorize = exports.gatewayBot = exports.gateway = 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 = void 0;
|
5
|
+
exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = void 0;
|
6
6
|
// Guilds
|
7
7
|
const guild = (guildID) => `guilds/${guildID}`;
|
8
8
|
exports.guild = guild;
|
@@ -197,6 +197,11 @@ const stickerPack = (packID) => `sticker-packs/${packID}`;
|
|
197
197
|
exports.stickerPack = stickerPack;
|
198
198
|
const stickerPacks = () => "sticker-packs";
|
199
199
|
exports.stickerPacks = stickerPacks;
|
200
|
+
// Subscriptions
|
201
|
+
const skuSubscription = (skuID, subscriptionID) => `skus/${skuID}/subscriptions/${subscriptionID}`;
|
202
|
+
exports.skuSubscription = skuSubscription;
|
203
|
+
const skuSubscriptions = (skuID) => `skus/${skuID}/subscriptions`;
|
204
|
+
exports.skuSubscriptions = skuSubscriptions;
|
200
205
|
// Gateway
|
201
206
|
const gateway = () => "gateway";
|
202
207
|
exports.gateway = gateway;
|
@@ -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,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;
|
@@ -34,6 +34,7 @@ __exportStar(require("./Roles"), exports);
|
|
34
34
|
__exportStar(require("./SKUs"), exports);
|
35
35
|
__exportStar(require("./StageInstances"), exports);
|
36
36
|
__exportStar(require("./Stickers"), exports);
|
37
|
+
__exportStar(require("./Subscriptions"), exports);
|
37
38
|
__exportStar(require("./Teams"), exports);
|
38
39
|
__exportStar(require("./Users"), exports);
|
39
40
|
__exportStar(require("./Voice"), exports);
|
@@ -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/
|
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;
|
package/dist/lib/types/sku.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { SKUFlags, SKUTypes } from "../constants";
|
2
2
|
import type { snowflake } from "./common";
|
3
|
-
/** https://discord.com/developers/docs/
|
3
|
+
/** https://discord.com/developers/docs/resources/sku#sku-object-sku-structure */
|
4
4
|
export interface RawSKU {
|
5
5
|
id: snowflake;
|
6
6
|
type: SKUTypes;
|
@@ -8,7 +8,6 @@ export interface RawSticker {
|
|
8
8
|
name: string;
|
9
9
|
description: string | null;
|
10
10
|
tags: string;
|
11
|
-
asset?: string;
|
12
11
|
type: StickerTypes;
|
13
12
|
format_type: StickerFormatTypes;
|
14
13
|
available?: boolean;
|
@@ -38,7 +37,6 @@ export interface Sticker {
|
|
38
37
|
name: string;
|
39
38
|
description: string | null;
|
40
39
|
tags: string;
|
41
|
-
asset?: string;
|
42
40
|
type: StickerTypes;
|
43
41
|
formatType: StickerFormatTypes;
|
44
42
|
available?: boolean;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { SubscriptionStatuses } from "../constants";
|
2
|
+
import type { snowflake, timestamp } from "./common";
|
3
|
+
/** https://discord.com/developers/docs/resources/subscription#subscription-object */
|
4
|
+
export interface RawSubscription {
|
5
|
+
id: snowflake;
|
6
|
+
user_id: snowflake;
|
7
|
+
sku_ids: Array<snowflake>;
|
8
|
+
entitlement_ids: Array<snowflake>;
|
9
|
+
current_period_start: timestamp;
|
10
|
+
current_period_end: timestamp;
|
11
|
+
status: SubscriptionStatuses;
|
12
|
+
canceled_at: timestamp | null;
|
13
|
+
country?: string;
|
14
|
+
}
|
15
|
+
export interface Subscription {
|
16
|
+
id: snowflake;
|
17
|
+
userID: snowflake;
|
18
|
+
skuIDs: Array<snowflake>;
|
19
|
+
entitlementIDs: Array<snowflake>;
|
20
|
+
currentPeriodStart: timestamp;
|
21
|
+
currentPeriodEnd: timestamp;
|
22
|
+
status: SubscriptionStatuses;
|
23
|
+
canceledAt: timestamp | null;
|
24
|
+
country?: string;
|
25
|
+
}
|
package/dist/package.json
CHANGED