disgroove 2.2.5-dev.aee496f → 2.2.5-dev.e91b2b6
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 +11 -3
- package/dist/lib/Client.js +90 -72
- package/dist/lib/constants.d.ts +9 -2
- package/dist/lib/constants.js +10 -2
- package/dist/lib/gateway/Shard.js +2 -1
- package/dist/lib/transformers/ApplicationCommands.js +2 -0
- package/dist/lib/transformers/Interactions.d.ts +3 -1
- package/dist/lib/transformers/Interactions.js +42 -0
- package/dist/lib/transformers/Subscriptions.js +2 -0
- package/dist/lib/types/application-command.d.ts +3 -1
- package/dist/lib/types/entitlements.d.ts +4 -4
- package/dist/lib/types/gateway-events.d.ts +2 -0
- package/dist/lib/types/guild.d.ts +2 -0
- package/dist/lib/types/interaction.d.ts +44 -0
- package/dist/lib/types/subscription.d.ts +2 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/lib/Client.d.ts
CHANGED
@@ -17,7 +17,7 @@ import type { AutoModerationActionExecutionEventFields, ChannelPinsUpdateEventFi
|
|
17
17
|
import type { Guild, GuildMember, WelcomeScreen, GuildWidgetSettings, Ban, Integration, GuildOnboarding, GuildPreview, GuildWidget, UnavailableGuild, OnboardingPrompt, WelcomeScreenChannel } from "./types/guild";
|
18
18
|
import type { GuildScheduledEvent, GuildScheduledEventUser, GuildScheduledEventEntityMetadata, GuildScheduledEventRecurrenceRule } from "./types/guild-scheduled-event";
|
19
19
|
import type { GuildTemplate } from "./types/guild-template";
|
20
|
-
import type { Interaction, InteractionResponse } from "./types/interaction";
|
20
|
+
import type { Interaction, InteractionCallbackResponse, InteractionResponse } from "./types/interaction";
|
21
21
|
import type { Invite } from "./types/invite";
|
22
22
|
import type { ActionRow } from "./types/message-components";
|
23
23
|
import type { PollCreateParams } from "./types/poll";
|
@@ -315,7 +315,9 @@ export declare class Client extends EventEmitter {
|
|
315
315
|
poll?: PollCreateParams;
|
316
316
|
}): Promise<Message>;
|
317
317
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */
|
318
|
-
createInteractionResponse(interactionID: snowflake, interactionToken: string, options: InteractionResponse
|
318
|
+
createInteractionResponse(interactionID: snowflake, interactionToken: string, options: InteractionResponse & {
|
319
|
+
withResponse?: boolean;
|
320
|
+
}): Promise<void | InteractionCallbackResponse>;
|
319
321
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
320
322
|
createMessage(channelID: snowflake, options: {
|
321
323
|
content?: string;
|
@@ -807,6 +809,8 @@ export declare class Client extends EventEmitter {
|
|
807
809
|
getCurrentUserVoiceState(guildID: snowflake): Promise<VoiceState>;
|
808
810
|
/** https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds */
|
809
811
|
getDefaultSoundboardSounds(): Promise<Array<SoundboardSound>>;
|
812
|
+
/** https://discord.com/developers/docs/resources/entitlement#get-entitlement */
|
813
|
+
getEntitlement(applicationID: snowflake, entitlementID: snowflake): Promise<Entitlement>;
|
810
814
|
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
811
815
|
getEntitlements(applicationID: snowflake, options?: {
|
812
816
|
userID?: snowflake;
|
@@ -816,6 +820,7 @@ export declare class Client extends EventEmitter {
|
|
816
820
|
limit?: number;
|
817
821
|
guildID?: snowflake;
|
818
822
|
excludeEnded?: boolean;
|
823
|
+
excludeDeleted?: boolean;
|
819
824
|
}): Promise<Array<Entitlement>>;
|
820
825
|
/** https://discord.com/developers/docs/topics/gateway#get-gateway */
|
821
826
|
getGateway(): Promise<{
|
@@ -1164,7 +1169,10 @@ export interface ClientEvents {
|
|
1164
1169
|
guildSoundboardSoundCreate: [sound: SoundboardSound];
|
1165
1170
|
guildSoundboardSoundUpdate: [sound: SoundboardSound];
|
1166
1171
|
guildSoundboardSoundDelete: [sound: GuildSoundboardSoundDeleteEventFields];
|
1167
|
-
guildSoundboardSoundsUpdate: [
|
1172
|
+
guildSoundboardSoundsUpdate: [
|
1173
|
+
sounds: Array<SoundboardSound>,
|
1174
|
+
guildID: snowflake
|
1175
|
+
];
|
1168
1176
|
soundboardSounds: [sounds: Array<SoundboardSound>, guildID: snowflake];
|
1169
1177
|
integrationCreate: [
|
1170
1178
|
integration: Integration & IntegrationCreateEventExtraFields
|
package/dist/lib/Client.js
CHANGED
@@ -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
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
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
|
-
|
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
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
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
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
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
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
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
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
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) {
|
@@ -1745,6 +1757,11 @@ class Client extends node_events_1.default {
|
|
1745
1757
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.soundboardDefaultSounds());
|
1746
1758
|
return response.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound));
|
1747
1759
|
}
|
1760
|
+
/** https://discord.com/developers/docs/resources/entitlement#get-entitlement */
|
1761
|
+
async getEntitlement(applicationID, entitlementID) {
|
1762
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlement(applicationID, entitlementID));
|
1763
|
+
return transformers_1.Entitlements.entitlementFromRaw(response);
|
1764
|
+
}
|
1748
1765
|
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
1749
1766
|
async getEntitlements(applicationID, options) {
|
1750
1767
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(applicationID), {
|
@@ -1756,6 +1773,7 @@ class Client extends node_events_1.default {
|
|
1756
1773
|
limit: options?.limit,
|
1757
1774
|
guild_id: options?.guildID,
|
1758
1775
|
exclude_ended: options?.excludeEnded,
|
1776
|
+
exclude_deleted: options?.excludeDeleted,
|
1759
1777
|
},
|
1760
1778
|
});
|
1761
1779
|
return response.map((entitlement) => transformers_1.Entitlements.entitlementFromRaw(entitlement));
|
package/dist/lib/constants.d.ts
CHANGED
@@ -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 {
|
package/dist/lib/constants.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
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;
|
@@ -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);
|
@@ -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) {
|
@@ -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
|
13
|
-
ends_at
|
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
|
25
|
-
endsAt
|
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;
|
@@ -89,6 +89,7 @@ export interface RawGuildMember {
|
|
89
89
|
user?: RawUser;
|
90
90
|
nick?: string | null;
|
91
91
|
avatar?: string | null;
|
92
|
+
banner?: string | null;
|
92
93
|
roles: Array<snowflake>;
|
93
94
|
joined_at: timestamp;
|
94
95
|
premium_since?: number | null;
|
@@ -257,6 +258,7 @@ export interface GuildMember {
|
|
257
258
|
user?: User;
|
258
259
|
nick?: string | null;
|
259
260
|
avatar?: string | null;
|
261
|
+
banner?: string | null;
|
260
262
|
roles: Array<snowflake>;
|
261
263
|
joinedAt: string;
|
262
264
|
premiumSince?: number | null;
|
@@ -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
|
+
}
|
@@ -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