disgroove 2.2.5-dev.4e978d8 → 2.2.5-dev.5577cd8
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 +48 -4
- package/dist/lib/Client.js +148 -72
- package/dist/lib/constants.d.ts +30 -4
- package/dist/lib/constants.js +30 -3
- package/dist/lib/gateway/Shard.d.ts +3 -1
- package/dist/lib/gateway/Shard.js +28 -0
- package/dist/lib/rest/Endpoints.d.ts +4 -0
- package/dist/lib/rest/Endpoints.js +12 -3
- 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/Soundboards.d.ts +5 -0
- package/dist/lib/transformers/Soundboards.js +31 -0
- package/dist/lib/transformers/index.d.ts +1 -0
- package/dist/lib/transformers/index.js +1 -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 +21 -0
- package/dist/lib/types/guild.d.ts +2 -0
- package/dist/lib/types/interaction.d.ts +44 -0
- package/dist/lib/types/soundboard.d.ts +23 -0
- package/dist/lib/types/soundboard.js +2 -0
- package/dist/lib/utils/CDN.d.ts +1 -0
- package/dist/lib/utils/CDN.js +3 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/lib/Client.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
+
/// <reference types="node" />
|
2
3
|
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";
|
3
4
|
import { RequestManager, type File } from "./rest";
|
4
5
|
import EventEmitter from "node:events";
|
@@ -12,11 +13,11 @@ import type { Channel, FollowedChannel, ThreadMember, Overwrite, DefaultReaction
|
|
12
13
|
import type { LocaleMap, snowflake, timestamp } from "./types/common";
|
13
14
|
import type { Emoji } from "./types/emoji";
|
14
15
|
import type { Entitlement } from "./types/entitlements";
|
15
|
-
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 } from "./types/gateway-events";
|
16
|
+
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";
|
16
17
|
import type { Guild, GuildMember, WelcomeScreen, GuildWidgetSettings, Ban, Integration, GuildOnboarding, GuildPreview, GuildWidget, UnavailableGuild, OnboardingPrompt, WelcomeScreenChannel } from "./types/guild";
|
17
18
|
import type { GuildScheduledEvent, GuildScheduledEventUser, GuildScheduledEventEntityMetadata, GuildScheduledEventRecurrenceRule } from "./types/guild-scheduled-event";
|
18
19
|
import type { GuildTemplate } from "./types/guild-template";
|
19
|
-
import type { Interaction, InteractionResponse } from "./types/interaction";
|
20
|
+
import type { Interaction, InteractionCallbackResponse, InteractionResponse } from "./types/interaction";
|
20
21
|
import type { Invite } from "./types/invite";
|
21
22
|
import type { ActionRow } from "./types/message-components";
|
22
23
|
import type { PollCreateParams } from "./types/poll";
|
@@ -29,7 +30,8 @@ import type { VoiceRegion, VoiceState } from "./types/voice";
|
|
29
30
|
import type { Webhook } from "./types/webhook";
|
30
31
|
import type { ClientOptions as WebSocketOptions } from "ws";
|
31
32
|
import type { Embed, AllowedMentions, Attachment, Message, MessageReference } from "./types/message";
|
32
|
-
import { Subscription } from "./types/subscription";
|
33
|
+
import type { Subscription } from "./types/subscription";
|
34
|
+
import type { SoundboardSound } from "./types/soundboard";
|
33
35
|
export interface GatewayOptions {
|
34
36
|
properties?: IdentifyConnectionProperties;
|
35
37
|
compress?: boolean;
|
@@ -285,6 +287,14 @@ export declare class Client extends EventEmitter {
|
|
285
287
|
tags: string;
|
286
288
|
file: File;
|
287
289
|
}, reason?: string): Promise<Sticker>;
|
290
|
+
/** https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound */
|
291
|
+
createGuildSoundboardSound(guildID: snowflake, options: {
|
292
|
+
name: string;
|
293
|
+
sound: Buffer;
|
294
|
+
volume?: number | null;
|
295
|
+
emojiID?: snowflake | null;
|
296
|
+
emojiName?: snowflake | null;
|
297
|
+
}, reason?: string): Promise<SoundboardSound>;
|
288
298
|
/** https://discord.com/developers/docs/resources/guild-template#create-guild-template */
|
289
299
|
createGuildTemplate(guildID: snowflake, options: {
|
290
300
|
name: string;
|
@@ -305,7 +315,9 @@ export declare class Client extends EventEmitter {
|
|
305
315
|
poll?: PollCreateParams;
|
306
316
|
}): Promise<Message>;
|
307
317
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */
|
308
|
-
createInteractionResponse(interactionID: snowflake, interactionToken: string, options: InteractionResponse
|
318
|
+
createInteractionResponse(interactionID: snowflake, interactionToken: string, options: InteractionResponse & {
|
319
|
+
withResponse?: boolean;
|
320
|
+
}): Promise<void | InteractionCallbackResponse>;
|
309
321
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
310
322
|
createMessage(channelID: snowflake, options: {
|
311
323
|
content?: string;
|
@@ -397,6 +409,8 @@ export declare class Client extends EventEmitter {
|
|
397
409
|
deleteGuildScheduledEvent(guildID: snowflake, guildScheduledEventID: snowflake): void;
|
398
410
|
/** https://discord.com/developers/docs/resources/sticker#delete-guild-sticker */
|
399
411
|
deleteGuildSticker(guildID: snowflake, stickerID: snowflake, reason?: string): void;
|
412
|
+
/** https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound */
|
413
|
+
deleteGuildSoundboardSound(guildID: snowflake, soundID: snowflake, reason?: string): void;
|
400
414
|
/** https://discord.com/developers/docs/resources/guild-template#delete-guild-template */
|
401
415
|
deleteGuildTemplate(guildID: snowflake, code: string): Promise<GuildTemplate>;
|
402
416
|
/** https://discord.com/developers/docs/resources/invite#delete-invite */
|
@@ -617,6 +631,13 @@ export declare class Client extends EventEmitter {
|
|
617
631
|
description?: string | null;
|
618
632
|
tags?: string;
|
619
633
|
}, reason?: string): Promise<Sticker>;
|
634
|
+
/** https://discord.com/developers/docs/resources/soundboard#edit-guild-soundboard-sound */
|
635
|
+
editGuildSoundboardSound(guildID: snowflake, soundID: snowflake, options: {
|
636
|
+
name?: string;
|
637
|
+
volume?: number | null;
|
638
|
+
emojiID?: snowflake | null;
|
639
|
+
emojiName?: snowflake | null;
|
640
|
+
}, reason?: string): Promise<SoundboardSound>;
|
620
641
|
/** https://discord.com/developers/docs/resources/guild-template#modify-guild-template */
|
621
642
|
editGuildTemplate(guildID: snowflake, code: string, options: {
|
622
643
|
name?: string;
|
@@ -786,6 +807,10 @@ export declare class Client extends EventEmitter {
|
|
786
807
|
getCurrentUserConnections(): Promise<Array<Connection>>;
|
787
808
|
/** https://discord.com/developers/docs/resources/voice#get-current-user-voice-state */
|
788
809
|
getCurrentUserVoiceState(guildID: snowflake): Promise<VoiceState>;
|
810
|
+
/** https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds */
|
811
|
+
getDefaultSoundboardSounds(): Promise<Array<SoundboardSound>>;
|
812
|
+
/** https://discord.com/developers/docs/resources/entitlement#get-entitlement */
|
813
|
+
getEntitlement(applicationID: snowflake, entitlementID: snowflake): Promise<Entitlement>;
|
789
814
|
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
790
815
|
getEntitlements(applicationID: snowflake, options?: {
|
791
816
|
userID?: snowflake;
|
@@ -795,6 +820,7 @@ export declare class Client extends EventEmitter {
|
|
795
820
|
limit?: number;
|
796
821
|
guildID?: snowflake;
|
797
822
|
excludeEnded?: boolean;
|
823
|
+
excludeDeleted?: boolean;
|
798
824
|
}): Promise<Array<Entitlement>>;
|
799
825
|
/** https://discord.com/developers/docs/topics/gateway#get-gateway */
|
800
826
|
getGateway(): Promise<{
|
@@ -886,6 +912,11 @@ export declare class Client extends EventEmitter {
|
|
886
912
|
getGuildSticker(guildID: snowflake, stickerID: snowflake): Promise<Sticker>;
|
887
913
|
/** https://discord.com/developers/docs/resources/sticker#list-guild-stickers */
|
888
914
|
getGuildStickers(guildID: snowflake): Promise<Array<Sticker>>;
|
915
|
+
/** https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound */
|
916
|
+
getGuildSoundboardSound(guildID: snowflake, soundID: snowflake): Promise<SoundboardSound>;
|
917
|
+
getGuildSoundboardSounds(guildID: snowflake): Promise<{
|
918
|
+
items: Array<SoundboardSound>;
|
919
|
+
}>;
|
889
920
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-template */
|
890
921
|
getGuildTemplate(guildID: snowflake, code: string): Promise<GuildTemplate>;
|
891
922
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-templates */
|
@@ -1034,6 +1065,11 @@ export declare class Client extends EventEmitter {
|
|
1034
1065
|
query: string;
|
1035
1066
|
limit?: number;
|
1036
1067
|
}): Promise<Array<GuildMember>>;
|
1068
|
+
/** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
|
1069
|
+
sendSoundboardSound(channelID: snowflake, options: {
|
1070
|
+
soundID: snowflake;
|
1071
|
+
sourceGuildID?: snowflake;
|
1072
|
+
}): void;
|
1037
1073
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
1038
1074
|
setPresence(options: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>): void;
|
1039
1075
|
/** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
|
@@ -1130,6 +1166,14 @@ export interface ClientEvents {
|
|
1130
1166
|
guildScheduledEventID: snowflake,
|
1131
1167
|
guildID: snowflake
|
1132
1168
|
];
|
1169
|
+
guildSoundboardSoundCreate: [sound: SoundboardSound];
|
1170
|
+
guildSoundboardSoundUpdate: [sound: SoundboardSound];
|
1171
|
+
guildSoundboardSoundDelete: [sound: GuildSoundboardSoundDeleteEventFields];
|
1172
|
+
guildSoundboardSoundsUpdate: [
|
1173
|
+
sounds: Array<SoundboardSound>,
|
1174
|
+
guildID: snowflake
|
1175
|
+
];
|
1176
|
+
soundboardSounds: [sounds: Array<SoundboardSound>, guildID: snowflake];
|
1133
1177
|
integrationCreate: [
|
1134
1178
|
integration: Integration & IntegrationCreateEventExtraFields
|
1135
1179
|
];
|
package/dist/lib/Client.js
CHANGED
@@ -418,6 +418,20 @@ class Client extends node_events_1.default {
|
|
418
418
|
});
|
419
419
|
return transformers_1.Stickers.stickerFromRaw(response);
|
420
420
|
}
|
421
|
+
/** https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound */
|
422
|
+
async createGuildSoundboardSound(guildID, options, reason) {
|
423
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSounds(guildID), {
|
424
|
+
json: {
|
425
|
+
name: options.name,
|
426
|
+
sound: options.sound,
|
427
|
+
volume: options.volume,
|
428
|
+
emoji_id: options.emojiID,
|
429
|
+
emoji_name: options.emojiName,
|
430
|
+
},
|
431
|
+
reason,
|
432
|
+
});
|
433
|
+
return transformers_1.Soundboards.soundboardSoundFromRaw(response);
|
434
|
+
}
|
421
435
|
/** https://discord.com/developers/docs/resources/guild-template#create-guild-template */
|
422
436
|
async createGuildTemplate(guildID, options) {
|
423
437
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildTemplates(guildID), {
|
@@ -469,106 +483,118 @@ class Client extends node_events_1.default {
|
|
469
483
|
return transformers_1.Messages.messageFromRaw(response);
|
470
484
|
}
|
471
485
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */
|
472
|
-
createInteractionResponse(interactionID, interactionToken, options) {
|
486
|
+
async createInteractionResponse(interactionID, interactionToken, options) {
|
487
|
+
let json;
|
488
|
+
let files;
|
473
489
|
switch (options.type) {
|
474
490
|
case constants_1.InteractionCallbackType.ChannelMessageWithSource:
|
475
491
|
case constants_1.InteractionCallbackType.UpdateMessage:
|
476
492
|
{
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
: undefined,
|
510
|
-
},
|
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,
|
511
525
|
},
|
512
|
-
|
513
|
-
|
526
|
+
};
|
527
|
+
files = options.data?.files;
|
514
528
|
}
|
515
529
|
break;
|
516
530
|
case constants_1.InteractionCallbackType.DeferredChannelMessageWithSource:
|
517
531
|
case constants_1.InteractionCallbackType.DeferredUpdateMessage:
|
518
532
|
{
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
flags: options.data?.flags,
|
524
|
-
},
|
533
|
+
json = {
|
534
|
+
type: options.type,
|
535
|
+
data: {
|
536
|
+
flags: options.data?.flags,
|
525
537
|
},
|
526
|
-
}
|
538
|
+
};
|
527
539
|
}
|
528
540
|
break;
|
529
541
|
case constants_1.InteractionCallbackType.ApplicationCommandAutocompleteResult:
|
530
542
|
{
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
})),
|
540
|
-
},
|
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
|
+
})),
|
541
551
|
},
|
542
|
-
}
|
552
|
+
};
|
543
553
|
}
|
544
554
|
break;
|
545
555
|
case constants_1.InteractionCallbackType.Modal:
|
546
556
|
{
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
title: options.data?.title,
|
556
|
-
},
|
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,
|
557
565
|
},
|
558
|
-
}
|
566
|
+
};
|
559
567
|
}
|
560
568
|
break;
|
561
569
|
case constants_1.InteractionCallbackType.PremiumRequired:
|
570
|
+
case constants_1.InteractionCallbackType.LaunchActivity:
|
562
571
|
{
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
},
|
568
|
-
});
|
572
|
+
json = {
|
573
|
+
type: options.type,
|
574
|
+
data: {},
|
575
|
+
};
|
569
576
|
}
|
570
577
|
break;
|
571
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
|
+
}
|
572
598
|
}
|
573
599
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
574
600
|
async createMessage(channelID, options) {
|
@@ -774,6 +800,12 @@ class Client extends node_events_1.default {
|
|
774
800
|
reason,
|
775
801
|
});
|
776
802
|
}
|
803
|
+
/** https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound */
|
804
|
+
deleteGuildSoundboardSound(guildID, soundID, reason) {
|
805
|
+
this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(guildID, soundID), {
|
806
|
+
reason,
|
807
|
+
});
|
808
|
+
}
|
777
809
|
/** https://discord.com/developers/docs/resources/guild-template#delete-guild-template */
|
778
810
|
async deleteGuildTemplate(guildID, code) {
|
779
811
|
const response = await this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildTemplate(guildID, code));
|
@@ -1180,6 +1212,19 @@ class Client extends node_events_1.default {
|
|
1180
1212
|
});
|
1181
1213
|
return transformers_1.Stickers.stickerFromRaw(response);
|
1182
1214
|
}
|
1215
|
+
/** https://discord.com/developers/docs/resources/soundboard#edit-guild-soundboard-sound */
|
1216
|
+
async editGuildSoundboardSound(guildID, soundID, options, reason) {
|
1217
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(guildID, soundID), {
|
1218
|
+
json: {
|
1219
|
+
name: options.name,
|
1220
|
+
volume: options.volume,
|
1221
|
+
emoji_id: options.emojiID,
|
1222
|
+
emoji_name: options.emojiName,
|
1223
|
+
},
|
1224
|
+
reason,
|
1225
|
+
});
|
1226
|
+
return transformers_1.Soundboards.soundboardSoundFromRaw(response);
|
1227
|
+
}
|
1183
1228
|
/** https://discord.com/developers/docs/resources/guild-template#modify-guild-template */
|
1184
1229
|
async editGuildTemplate(guildID, code, options) {
|
1185
1230
|
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildTemplate(guildID, code), {
|
@@ -1707,6 +1752,16 @@ class Client extends node_events_1.default {
|
|
1707
1752
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceState(guildID));
|
1708
1753
|
return transformers_1.Voice.voiceStateFromRaw(response);
|
1709
1754
|
}
|
1755
|
+
/** https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds */
|
1756
|
+
async getDefaultSoundboardSounds() {
|
1757
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.soundboardDefaultSounds());
|
1758
|
+
return response.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound));
|
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
|
+
}
|
1710
1765
|
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
1711
1766
|
async getEntitlements(applicationID, options) {
|
1712
1767
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(applicationID), {
|
@@ -1718,6 +1773,7 @@ class Client extends node_events_1.default {
|
|
1718
1773
|
limit: options?.limit,
|
1719
1774
|
guild_id: options?.guildID,
|
1720
1775
|
exclude_ended: options?.excludeEnded,
|
1776
|
+
exclude_deleted: options?.excludeDeleted,
|
1721
1777
|
},
|
1722
1778
|
});
|
1723
1779
|
return response.map((entitlement) => transformers_1.Entitlements.entitlementFromRaw(entitlement));
|
@@ -1960,6 +2016,17 @@ class Client extends node_events_1.default {
|
|
1960
2016
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildStickers(guildID));
|
1961
2017
|
return response.map((sticker) => transformers_1.Stickers.stickerFromRaw(sticker));
|
1962
2018
|
}
|
2019
|
+
/** https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound */
|
2020
|
+
async getGuildSoundboardSound(guildID, soundID) {
|
2021
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(guildID, soundID));
|
2022
|
+
return transformers_1.Soundboards.soundboardSoundFromRaw(response);
|
2023
|
+
}
|
2024
|
+
async getGuildSoundboardSounds(guildID) {
|
2025
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSounds(guildID));
|
2026
|
+
return {
|
2027
|
+
items: response.items.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound)),
|
2028
|
+
};
|
2029
|
+
}
|
1963
2030
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-template */
|
1964
2031
|
async getGuildTemplate(guildID, code) {
|
1965
2032
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplate(guildID, code));
|
@@ -2313,6 +2380,15 @@ class Client extends node_events_1.default {
|
|
2313
2380
|
});
|
2314
2381
|
return response.map((guildMember) => transformers_1.Guilds.guildMemberFromRaw(guildMember));
|
2315
2382
|
}
|
2383
|
+
/** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
|
2384
|
+
sendSoundboardSound(channelID, options) {
|
2385
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.sendSoundboardSound(channelID), {
|
2386
|
+
json: {
|
2387
|
+
sound_id: options.soundID,
|
2388
|
+
source_guild_id: options.sourceGuildID,
|
2389
|
+
},
|
2390
|
+
});
|
2391
|
+
}
|
2316
2392
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
2317
2393
|
setPresence(options) {
|
2318
2394
|
this.shards.forEach((shard) => shard.updatePresence(options));
|
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 {
|
@@ -219,6 +226,9 @@ export declare enum AuditLogEvents {
|
|
219
226
|
ThreadUpdate = 111,
|
220
227
|
ThreadDelete = 112,
|
221
228
|
ApplicationCommandPermissionUpdate = 121,
|
229
|
+
SoundboardSoundCreate = 130,
|
230
|
+
SoundboardSoundUpdate = 131,
|
231
|
+
SoundboardSoundDelete = 132,
|
222
232
|
AutoModerationRuleCreate = 140,
|
223
233
|
AutoModerationRuleUpdate = 141,
|
224
234
|
AutoModerationRuleDelete = 142,
|
@@ -362,6 +372,7 @@ export declare enum GuildFeatures {
|
|
362
372
|
InvitesDisabled = "INVITES_DISABLED",
|
363
373
|
InviteSplash = "INVITE_SPLASH",
|
364
374
|
MemberVerificationGateEnabled = "MEMBER_VERIFICATION_GATE_ENABLED",
|
375
|
+
MoreSoundboard = "MORE_SOUNDBOARD",
|
365
376
|
MoreStickers = "MORE_STICKERS",
|
366
377
|
News = "NEWS",
|
367
378
|
Partnered = "PARTNERED",
|
@@ -370,6 +381,7 @@ export declare enum GuildFeatures {
|
|
370
381
|
RoleIcons = "ROLE_ICONS",
|
371
382
|
RoleSubscriptionsAvailableForPurchase = "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE",
|
372
383
|
RoleSubscriptionsEnabled = "ROLE_SUBSCRIPTIONS_ENABLED",
|
384
|
+
Soundboard = "SOUNDBOARD",
|
373
385
|
TicketedEventsEnabled = "TICKETED_EVENTS_ENABLED",
|
374
386
|
VanityURL = "VANITY_URL",
|
375
387
|
Verified = "VERIFIED",
|
@@ -667,7 +679,7 @@ export declare enum GatewayIntents {
|
|
667
679
|
Guilds = 1,
|
668
680
|
GuildMembers = 2,
|
669
681
|
GuildModeration = 4,
|
670
|
-
|
682
|
+
GuildExpressions = 8,
|
671
683
|
GuildIntegrations = 16,
|
672
684
|
GuildWebhooks = 32,
|
673
685
|
GuildInvites = 64,
|
@@ -740,6 +752,11 @@ export declare enum GatewayEvents {
|
|
740
752
|
GuildScheduledEventDelete = "GUILD_SCHEDULED_EVENT_DELETE",
|
741
753
|
GuildScheduledEventUserAdd = "GUILD_SCHEDULED_EVENT_USER_ADD",
|
742
754
|
GuildScheduledEventUserRemove = "GUILD_SCHEDULED_EVENT_USER_REMOVE",
|
755
|
+
GuildSoundboardSoundCreate = "GUILD_SOUNDBOARD_SOUND_CREATE",
|
756
|
+
GuildSoundboardSoundUpdate = "GUILD_SOUNDBOARD_SOUND_UPDATE",
|
757
|
+
GuildSoundboardSoundDelete = "GUILD_SOUNDBOARD_SOUND_DELETE",
|
758
|
+
GuildSoundboardSoundsUpdate = "GUILD_SOUNDBOARD_SOUNDS_UPDATE",
|
759
|
+
SoundboardSounds = "SOUNDBOARD_SOUNDS",
|
743
760
|
IntegrationCreate = "INTEGRATION_CREATE",
|
744
761
|
IntegrationUpdate = "INTEGRATION_UPDATE",
|
745
762
|
IntegrationDelete = "INTEGRATION_DELETE",
|
@@ -839,7 +856,8 @@ export declare enum GatewayOPCodes {
|
|
839
856
|
RequestGuildMembers = 8,
|
840
857
|
InvalidSession = 9,
|
841
858
|
Hello = 10,
|
842
|
-
HeartbeatACK = 11
|
859
|
+
HeartbeatACK = 11,
|
860
|
+
RequestSoundboardSounds = 31
|
843
861
|
}
|
844
862
|
/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes */
|
845
863
|
export declare enum GatewayCloseEventCodes {
|
@@ -921,6 +939,7 @@ export declare enum JSONErrorCodes {
|
|
921
939
|
UnknownWebhook = 10015,
|
922
940
|
UnknownWebhookService = 10016,
|
923
941
|
UnknownSession = 10020,
|
942
|
+
UnknownAsset = 10021,
|
924
943
|
UnknownBan = 10026,
|
925
944
|
UnknownSKU = 10027,
|
926
945
|
UnknownStoreListing = 10028,
|
@@ -947,6 +966,7 @@ export declare enum JSONErrorCodes {
|
|
947
966
|
UnknownGuildScheduledEvent = 10070,
|
948
967
|
UnknownGuildScheduledEventUser = 10071,
|
949
968
|
UnknownTag = 10087,
|
969
|
+
UnknownSound = 10091,
|
950
970
|
BotsCannotUseThisEndpoint = 20001,
|
951
971
|
OnlyBotsCanUseThisEndpoint = 20002,
|
952
972
|
ExplicitContentCannotBeSentToTheDesiredRecipient = 20009,
|
@@ -985,6 +1005,7 @@ export declare enum JSONErrorCodes {
|
|
985
1005
|
MaximumNumberOfStickersReached = 30039,
|
986
1006
|
MaximumNumberOfPruneRequestsHasBeenReached = 30040,
|
987
1007
|
MaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached = 30042,
|
1008
|
+
MaximumNumberOfSoundboardSoundsReached = 30045,
|
988
1009
|
MaximumNumberOfEditsToMessagesOlderThanOneHourReached = 30046,
|
989
1010
|
MaximumNumberOfPinnedThreadsInForumHasBeenReached = 30047,
|
990
1011
|
MaximumNumberOfTagsInForumHasBeenReached = 30048,
|
@@ -1068,12 +1089,16 @@ export declare enum JSONErrorCodes {
|
|
1068
1089
|
ServerNeedsMonetizationEnabledToPerformThisAction = 50097,
|
1069
1090
|
ServerNeedsMoreBoostsToPerformThisAction = 50101,
|
1070
1091
|
RequestBodyContainsInvalidJSON = 50109,
|
1092
|
+
TheProvidedFileIsInvalid = 50110,
|
1093
|
+
TheProvidedFileTypeIsInvalid = 50123,
|
1094
|
+
TheProvidedFileDurationExceedsMaximumOf5Seconds = 50124,
|
1071
1095
|
OwnerCannotBePendingMember = 50131,
|
1072
1096
|
OwnershipCannotBeMovedToABotUser = 50132,
|
1073
1097
|
FailedToResizeAssetBelowTheMinimumSize = 50138,
|
1074
1098
|
CannotMixSubscriptionAndNonSubscriptionRolesForAnEmoji = 50144,
|
1075
1099
|
CannotConvertBetweenPremiumEmojiAndNormalEmoji = 50145,
|
1076
1100
|
UploadedFileNotFound = 50146,
|
1101
|
+
TheSpecifiedEmojiIsInvalid = 50151,
|
1077
1102
|
VoiceMessagesDoNotSupportAdditionalContent = 50159,
|
1078
1103
|
VoiceMessagesMustHaveASingleAudioAttachment = 50160,
|
1079
1104
|
VoiceMessagesMustHaveSupportingMetadata = 50161,
|
@@ -1081,6 +1106,7 @@ export declare enum JSONErrorCodes {
|
|
1081
1106
|
CannotDeleteGuildSubscriptionIntegration = 50163,
|
1082
1107
|
YouCannotSendVoiceMessagesInThisChannel = 50173,
|
1083
1108
|
TheUserAccountMustFirstBeVerified = 50178,
|
1109
|
+
TheProvidedFileDoesNotHaveAValidDuration = 50192,
|
1084
1110
|
YouDoNotHavePermissionToSendThisSticker = 50600,
|
1085
1111
|
TwoFactorAuthenticationIsRequired = 60003,
|
1086
1112
|
NoUsersWithDiscordTagExist = 80004,
|