disgroove 2.2.4 → 2.2.5-dev.aee496f
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 +41 -2
- package/dist/lib/Client.js +100 -0
- package/dist/lib/constants.d.ts +27 -3
- package/dist/lib/constants.js +25 -1
- package/dist/lib/gateway/Shard.d.ts +3 -1
- package/dist/lib/gateway/Shard.js +27 -0
- package/dist/lib/rest/Endpoints.d.ts +4 -0
- package/dist/lib/rest/Endpoints.js +12 -3
- 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/gateway-events.d.ts +19 -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/lib/utils/formatters.d.ts +2 -2
- package/dist/lib/utils/formatters.js +5 -2
- 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,7 +13,7 @@ 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";
|
@@ -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;
|
@@ -397,6 +407,8 @@ export declare class Client extends EventEmitter {
|
|
397
407
|
deleteGuildScheduledEvent(guildID: snowflake, guildScheduledEventID: snowflake): void;
|
398
408
|
/** https://discord.com/developers/docs/resources/sticker#delete-guild-sticker */
|
399
409
|
deleteGuildSticker(guildID: snowflake, stickerID: snowflake, reason?: string): void;
|
410
|
+
/** https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound */
|
411
|
+
deleteGuildSoundboardSound(guildID: snowflake, soundID: snowflake, reason?: string): void;
|
400
412
|
/** https://discord.com/developers/docs/resources/guild-template#delete-guild-template */
|
401
413
|
deleteGuildTemplate(guildID: snowflake, code: string): Promise<GuildTemplate>;
|
402
414
|
/** https://discord.com/developers/docs/resources/invite#delete-invite */
|
@@ -617,6 +629,13 @@ export declare class Client extends EventEmitter {
|
|
617
629
|
description?: string | null;
|
618
630
|
tags?: string;
|
619
631
|
}, reason?: string): Promise<Sticker>;
|
632
|
+
/** https://discord.com/developers/docs/resources/soundboard#edit-guild-soundboard-sound */
|
633
|
+
editGuildSoundboardSound(guildID: snowflake, soundID: snowflake, options: {
|
634
|
+
name?: string;
|
635
|
+
volume?: number | null;
|
636
|
+
emojiID?: snowflake | null;
|
637
|
+
emojiName?: snowflake | null;
|
638
|
+
}, reason?: string): Promise<SoundboardSound>;
|
620
639
|
/** https://discord.com/developers/docs/resources/guild-template#modify-guild-template */
|
621
640
|
editGuildTemplate(guildID: snowflake, code: string, options: {
|
622
641
|
name?: string;
|
@@ -656,6 +675,7 @@ export declare class Client extends EventEmitter {
|
|
656
675
|
components?: Array<ActionRow> | null;
|
657
676
|
files?: Array<File> | null;
|
658
677
|
attachments?: Array<Partial<Attachment>> | null;
|
678
|
+
poll?: PollCreateParams | null;
|
659
679
|
threadID?: snowflake;
|
660
680
|
}): Promise<Message>;
|
661
681
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response */
|
@@ -666,6 +686,7 @@ export declare class Client extends EventEmitter {
|
|
666
686
|
components?: Array<ActionRow> | null;
|
667
687
|
files?: Array<File> | null;
|
668
688
|
attachments?: Array<Partial<Attachment>> | null;
|
689
|
+
poll?: PollCreateParams | null;
|
669
690
|
threadID?: snowflake;
|
670
691
|
}): Promise<Message>;
|
671
692
|
/** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
|
@@ -687,6 +708,7 @@ export declare class Client extends EventEmitter {
|
|
687
708
|
components?: Array<ActionRow> | null;
|
688
709
|
files?: Array<File> | null;
|
689
710
|
attachments?: Array<Partial<Attachment>> | null;
|
711
|
+
poll?: PollCreateParams | null;
|
690
712
|
threadID?: snowflake;
|
691
713
|
}): Promise<Message>;
|
692
714
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
|
@@ -783,6 +805,8 @@ export declare class Client extends EventEmitter {
|
|
783
805
|
getCurrentUserConnections(): Promise<Array<Connection>>;
|
784
806
|
/** https://discord.com/developers/docs/resources/voice#get-current-user-voice-state */
|
785
807
|
getCurrentUserVoiceState(guildID: snowflake): Promise<VoiceState>;
|
808
|
+
/** https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds */
|
809
|
+
getDefaultSoundboardSounds(): Promise<Array<SoundboardSound>>;
|
786
810
|
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
787
811
|
getEntitlements(applicationID: snowflake, options?: {
|
788
812
|
userID?: snowflake;
|
@@ -883,6 +907,11 @@ export declare class Client extends EventEmitter {
|
|
883
907
|
getGuildSticker(guildID: snowflake, stickerID: snowflake): Promise<Sticker>;
|
884
908
|
/** https://discord.com/developers/docs/resources/sticker#list-guild-stickers */
|
885
909
|
getGuildStickers(guildID: snowflake): Promise<Array<Sticker>>;
|
910
|
+
/** https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound */
|
911
|
+
getGuildSoundboardSound(guildID: snowflake, soundID: snowflake): Promise<SoundboardSound>;
|
912
|
+
getGuildSoundboardSounds(guildID: snowflake): Promise<{
|
913
|
+
items: Array<SoundboardSound>;
|
914
|
+
}>;
|
886
915
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-template */
|
887
916
|
getGuildTemplate(guildID: snowflake, code: string): Promise<GuildTemplate>;
|
888
917
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-templates */
|
@@ -1031,6 +1060,11 @@ export declare class Client extends EventEmitter {
|
|
1031
1060
|
query: string;
|
1032
1061
|
limit?: number;
|
1033
1062
|
}): Promise<Array<GuildMember>>;
|
1063
|
+
/** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
|
1064
|
+
sendSoundboardSound(channelID: snowflake, options: {
|
1065
|
+
soundID: snowflake;
|
1066
|
+
sourceGuildID?: snowflake;
|
1067
|
+
}): void;
|
1034
1068
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
1035
1069
|
setPresence(options: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>): void;
|
1036
1070
|
/** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
|
@@ -1127,6 +1161,11 @@ export interface ClientEvents {
|
|
1127
1161
|
guildScheduledEventID: snowflake,
|
1128
1162
|
guildID: snowflake
|
1129
1163
|
];
|
1164
|
+
guildSoundboardSoundCreate: [sound: SoundboardSound];
|
1165
|
+
guildSoundboardSoundUpdate: [sound: SoundboardSound];
|
1166
|
+
guildSoundboardSoundDelete: [sound: GuildSoundboardSoundDeleteEventFields];
|
1167
|
+
guildSoundboardSoundsUpdate: [sounds: Array<SoundboardSound>];
|
1168
|
+
soundboardSounds: [sounds: Array<SoundboardSound>, guildID: snowflake];
|
1130
1169
|
integrationCreate: [
|
1131
1170
|
integration: Integration & IntegrationCreateEventExtraFields
|
1132
1171
|
];
|
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), {
|
@@ -774,6 +788,12 @@ class Client extends node_events_1.default {
|
|
774
788
|
reason,
|
775
789
|
});
|
776
790
|
}
|
791
|
+
/** https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound */
|
792
|
+
deleteGuildSoundboardSound(guildID, soundID, reason) {
|
793
|
+
this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(guildID, soundID), {
|
794
|
+
reason,
|
795
|
+
});
|
796
|
+
}
|
777
797
|
/** https://discord.com/developers/docs/resources/guild-template#delete-guild-template */
|
778
798
|
async deleteGuildTemplate(guildID, code) {
|
779
799
|
const response = await this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildTemplate(guildID, code));
|
@@ -1180,6 +1200,19 @@ class Client extends node_events_1.default {
|
|
1180
1200
|
});
|
1181
1201
|
return transformers_1.Stickers.stickerFromRaw(response);
|
1182
1202
|
}
|
1203
|
+
/** https://discord.com/developers/docs/resources/soundboard#edit-guild-soundboard-sound */
|
1204
|
+
async editGuildSoundboardSound(guildID, soundID, options, reason) {
|
1205
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(guildID, soundID), {
|
1206
|
+
json: {
|
1207
|
+
name: options.name,
|
1208
|
+
volume: options.volume,
|
1209
|
+
emoji_id: options.emojiID,
|
1210
|
+
emoji_name: options.emojiName,
|
1211
|
+
},
|
1212
|
+
reason,
|
1213
|
+
});
|
1214
|
+
return transformers_1.Soundboards.soundboardSoundFromRaw(response);
|
1215
|
+
}
|
1183
1216
|
/** https://discord.com/developers/docs/resources/guild-template#modify-guild-template */
|
1184
1217
|
async editGuildTemplate(guildID, code, options) {
|
1185
1218
|
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildTemplate(guildID, code), {
|
@@ -1309,6 +1342,20 @@ class Client extends node_events_1.default {
|
|
1309
1342
|
waveform: attachment.waveform,
|
1310
1343
|
flags: attachment.flags,
|
1311
1344
|
})),
|
1345
|
+
poll: options.poll !== undefined
|
1346
|
+
? options.poll !== null
|
1347
|
+
? {
|
1348
|
+
question: options.poll.question,
|
1349
|
+
answers: options.poll.answers.map((answer) => ({
|
1350
|
+
answer_id: answer.answerID,
|
1351
|
+
poll_media: answer.pollMedia,
|
1352
|
+
})),
|
1353
|
+
duration: options.poll.duration,
|
1354
|
+
allow_multiselect: options.poll.allowMultiselect,
|
1355
|
+
layout_type: options.poll.layoutType,
|
1356
|
+
}
|
1357
|
+
: null
|
1358
|
+
: undefined,
|
1312
1359
|
},
|
1313
1360
|
files: options.files,
|
1314
1361
|
query: {
|
@@ -1356,6 +1403,20 @@ class Client extends node_events_1.default {
|
|
1356
1403
|
waveform: attachment.waveform,
|
1357
1404
|
flags: attachment.flags,
|
1358
1405
|
})),
|
1406
|
+
poll: options.poll !== undefined
|
1407
|
+
? options.poll !== null
|
1408
|
+
? {
|
1409
|
+
question: options.poll.question,
|
1410
|
+
answers: options.poll.answers.map((answer) => ({
|
1411
|
+
answer_id: answer.answerID,
|
1412
|
+
poll_media: answer.pollMedia,
|
1413
|
+
})),
|
1414
|
+
duration: options.poll.duration,
|
1415
|
+
allow_multiselect: options.poll.allowMultiselect,
|
1416
|
+
layout_type: options.poll.layoutType,
|
1417
|
+
}
|
1418
|
+
: null
|
1419
|
+
: undefined,
|
1359
1420
|
},
|
1360
1421
|
files: options.files,
|
1361
1422
|
query: {
|
@@ -1424,6 +1485,20 @@ class Client extends node_events_1.default {
|
|
1424
1485
|
waveform: attachment.waveform,
|
1425
1486
|
flags: attachment.flags,
|
1426
1487
|
})),
|
1488
|
+
poll: options.poll !== undefined
|
1489
|
+
? options.poll !== null
|
1490
|
+
? {
|
1491
|
+
question: options.poll.question,
|
1492
|
+
answers: options.poll.answers.map((answer) => ({
|
1493
|
+
answer_id: answer.answerID,
|
1494
|
+
poll_media: answer.pollMedia,
|
1495
|
+
})),
|
1496
|
+
duration: options.poll.duration,
|
1497
|
+
allow_multiselect: options.poll.allowMultiselect,
|
1498
|
+
layout_type: options.poll.layoutType,
|
1499
|
+
}
|
1500
|
+
: null
|
1501
|
+
: undefined,
|
1427
1502
|
},
|
1428
1503
|
files: options.files,
|
1429
1504
|
query: {
|
@@ -1665,6 +1740,11 @@ class Client extends node_events_1.default {
|
|
1665
1740
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceState(guildID));
|
1666
1741
|
return transformers_1.Voice.voiceStateFromRaw(response);
|
1667
1742
|
}
|
1743
|
+
/** https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds */
|
1744
|
+
async getDefaultSoundboardSounds() {
|
1745
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.soundboardDefaultSounds());
|
1746
|
+
return response.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound));
|
1747
|
+
}
|
1668
1748
|
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
1669
1749
|
async getEntitlements(applicationID, options) {
|
1670
1750
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(applicationID), {
|
@@ -1918,6 +1998,17 @@ class Client extends node_events_1.default {
|
|
1918
1998
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildStickers(guildID));
|
1919
1999
|
return response.map((sticker) => transformers_1.Stickers.stickerFromRaw(sticker));
|
1920
2000
|
}
|
2001
|
+
/** https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound */
|
2002
|
+
async getGuildSoundboardSound(guildID, soundID) {
|
2003
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(guildID, soundID));
|
2004
|
+
return transformers_1.Soundboards.soundboardSoundFromRaw(response);
|
2005
|
+
}
|
2006
|
+
async getGuildSoundboardSounds(guildID) {
|
2007
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSounds(guildID));
|
2008
|
+
return {
|
2009
|
+
items: response.items.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound)),
|
2010
|
+
};
|
2011
|
+
}
|
1921
2012
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-template */
|
1922
2013
|
async getGuildTemplate(guildID, code) {
|
1923
2014
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplate(guildID, code));
|
@@ -2271,6 +2362,15 @@ class Client extends node_events_1.default {
|
|
2271
2362
|
});
|
2272
2363
|
return response.map((guildMember) => transformers_1.Guilds.guildMemberFromRaw(guildMember));
|
2273
2364
|
}
|
2365
|
+
/** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
|
2366
|
+
sendSoundboardSound(channelID, options) {
|
2367
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.sendSoundboardSound(channelID), {
|
2368
|
+
json: {
|
2369
|
+
sound_id: options.soundID,
|
2370
|
+
source_guild_id: options.sourceGuildID,
|
2371
|
+
},
|
2372
|
+
});
|
2373
|
+
}
|
2274
2374
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
2275
2375
|
setPresence(options) {
|
2276
2376
|
this.shards.forEach((shard) => shard.updatePresence(options));
|
package/dist/lib/constants.d.ts
CHANGED
@@ -12,7 +12,8 @@ export declare enum TimestampStyles {
|
|
12
12
|
export declare enum GuildNavigationTypes {
|
13
13
|
Customize = "customize",
|
14
14
|
BrowseChannels = "browse",
|
15
|
-
ServerGuide = "guide"
|
15
|
+
ServerGuide = "guide",
|
16
|
+
LinkedRoles = "linked-roles"
|
16
17
|
}
|
17
18
|
/** https://discord.com/developers/docs/reference#image-formatting-image-formats */
|
18
19
|
export declare enum ImageFormats {
|
@@ -218,6 +219,9 @@ export declare enum AuditLogEvents {
|
|
218
219
|
ThreadUpdate = 111,
|
219
220
|
ThreadDelete = 112,
|
220
221
|
ApplicationCommandPermissionUpdate = 121,
|
222
|
+
SoundboardSoundCreate = 130,
|
223
|
+
SoundboardSoundUpdate = 131,
|
224
|
+
SoundboardSoundDelete = 132,
|
221
225
|
AutoModerationRuleCreate = 140,
|
222
226
|
AutoModerationRuleUpdate = 141,
|
223
227
|
AutoModerationRuleDelete = 142,
|
@@ -361,6 +365,7 @@ export declare enum GuildFeatures {
|
|
361
365
|
InvitesDisabled = "INVITES_DISABLED",
|
362
366
|
InviteSplash = "INVITE_SPLASH",
|
363
367
|
MemberVerificationGateEnabled = "MEMBER_VERIFICATION_GATE_ENABLED",
|
368
|
+
MoreSoundboard = "MORE_SOUNDBOARD",
|
364
369
|
MoreStickers = "MORE_STICKERS",
|
365
370
|
News = "NEWS",
|
366
371
|
Partnered = "PARTNERED",
|
@@ -369,6 +374,7 @@ export declare enum GuildFeatures {
|
|
369
374
|
RoleIcons = "ROLE_ICONS",
|
370
375
|
RoleSubscriptionsAvailableForPurchase = "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE",
|
371
376
|
RoleSubscriptionsEnabled = "ROLE_SUBSCRIPTIONS_ENABLED",
|
377
|
+
Soundboard = "SOUNDBOARD",
|
372
378
|
TicketedEventsEnabled = "TICKETED_EVENTS_ENABLED",
|
373
379
|
VanityURL = "VANITY_URL",
|
374
380
|
Verified = "VERIFIED",
|
@@ -616,6 +622,7 @@ export declare enum PremiumTypes {
|
|
616
622
|
}
|
617
623
|
/** https://discord.com/developers/docs/resources/user#connection-object-services */
|
618
624
|
export declare enum Services {
|
625
|
+
AmazonMusic = "amazon-music",
|
619
626
|
BattleNet = "battlenet",
|
620
627
|
Ebay = "ebay",
|
621
628
|
EpicGames = "epicgames",
|
@@ -665,7 +672,7 @@ export declare enum GatewayIntents {
|
|
665
672
|
Guilds = 1,
|
666
673
|
GuildMembers = 2,
|
667
674
|
GuildModeration = 4,
|
668
|
-
|
675
|
+
GuildExpressions = 8,
|
669
676
|
GuildIntegrations = 16,
|
670
677
|
GuildWebhooks = 32,
|
671
678
|
GuildInvites = 64,
|
@@ -738,6 +745,11 @@ export declare enum GatewayEvents {
|
|
738
745
|
GuildScheduledEventDelete = "GUILD_SCHEDULED_EVENT_DELETE",
|
739
746
|
GuildScheduledEventUserAdd = "GUILD_SCHEDULED_EVENT_USER_ADD",
|
740
747
|
GuildScheduledEventUserRemove = "GUILD_SCHEDULED_EVENT_USER_REMOVE",
|
748
|
+
GuildSoundboardSoundCreate = "GUILD_SOUNDBOARD_SOUND_CREATE",
|
749
|
+
GuildSoundboardSoundUpdate = "GUILD_SOUNDBOARD_SOUND_UPDATE",
|
750
|
+
GuildSoundboardSoundDelete = "GUILD_SOUNDBOARD_SOUND_DELETE",
|
751
|
+
GuildSoundboardSoundsUpdate = "GUILD_SOUNDBOARD_SOUNDS_UPDATE",
|
752
|
+
SoundboardSounds = "SOUNDBOARD_SOUNDS",
|
741
753
|
IntegrationCreate = "INTEGRATION_CREATE",
|
742
754
|
IntegrationUpdate = "INTEGRATION_UPDATE",
|
743
755
|
IntegrationDelete = "INTEGRATION_DELETE",
|
@@ -837,7 +849,8 @@ export declare enum GatewayOPCodes {
|
|
837
849
|
RequestGuildMembers = 8,
|
838
850
|
InvalidSession = 9,
|
839
851
|
Hello = 10,
|
840
|
-
HeartbeatACK = 11
|
852
|
+
HeartbeatACK = 11,
|
853
|
+
RequestSoundboardSounds = 31
|
841
854
|
}
|
842
855
|
/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes */
|
843
856
|
export declare enum GatewayCloseEventCodes {
|
@@ -919,6 +932,7 @@ export declare enum JSONErrorCodes {
|
|
919
932
|
UnknownWebhook = 10015,
|
920
933
|
UnknownWebhookService = 10016,
|
921
934
|
UnknownSession = 10020,
|
935
|
+
UnknownAsset = 10021,
|
922
936
|
UnknownBan = 10026,
|
923
937
|
UnknownSKU = 10027,
|
924
938
|
UnknownStoreListing = 10028,
|
@@ -945,6 +959,7 @@ export declare enum JSONErrorCodes {
|
|
945
959
|
UnknownGuildScheduledEvent = 10070,
|
946
960
|
UnknownGuildScheduledEventUser = 10071,
|
947
961
|
UnknownTag = 10087,
|
962
|
+
UnknownSound = 10091,
|
948
963
|
BotsCannotUseThisEndpoint = 20001,
|
949
964
|
OnlyBotsCanUseThisEndpoint = 20002,
|
950
965
|
ExplicitContentCannotBeSentToTheDesiredRecipient = 20009,
|
@@ -983,6 +998,7 @@ export declare enum JSONErrorCodes {
|
|
983
998
|
MaximumNumberOfStickersReached = 30039,
|
984
999
|
MaximumNumberOfPruneRequestsHasBeenReached = 30040,
|
985
1000
|
MaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached = 30042,
|
1001
|
+
MaximumNumberOfSoundboardSoundsReached = 30045,
|
986
1002
|
MaximumNumberOfEditsToMessagesOlderThanOneHourReached = 30046,
|
987
1003
|
MaximumNumberOfPinnedThreadsInForumHasBeenReached = 30047,
|
988
1004
|
MaximumNumberOfTagsInForumHasBeenReached = 30048,
|
@@ -999,6 +1015,8 @@ export declare enum JSONErrorCodes {
|
|
999
1015
|
FeatureTemporarilyDisabledServerSide = 40006,
|
1000
1016
|
UserBannedFromThisGuild = 40007,
|
1001
1017
|
ConnectionHasBeenRevoked = 40012,
|
1018
|
+
OnlyConsumableSKUsCanBeConsumed = 40018,
|
1019
|
+
YouCanOnlyDeleteSandboxEntitlements = 40019,
|
1002
1020
|
TargetUserIsNotConnectedToVoice = 40032,
|
1003
1021
|
ThisMessageWasAlreadyCrossposted = 40033,
|
1004
1022
|
ApplicationCommandWithThatNameAlreadyExists = 40041,
|
@@ -1010,6 +1028,7 @@ export declare enum JSONErrorCodes {
|
|
1010
1028
|
ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066,
|
1011
1029
|
TagRequiredToCreateAForumPostInThisChannel = 40067,
|
1012
1030
|
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40074,
|
1031
|
+
ThisInteractionHasHitTheMaximumNumberOfFollowUpMessages = 40094,
|
1013
1032
|
CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent = 40333,
|
1014
1033
|
MissingAccess = 50001,
|
1015
1034
|
InvalidAccountType = 50002,
|
@@ -1063,12 +1082,16 @@ export declare enum JSONErrorCodes {
|
|
1063
1082
|
ServerNeedsMonetizationEnabledToPerformThisAction = 50097,
|
1064
1083
|
ServerNeedsMoreBoostsToPerformThisAction = 50101,
|
1065
1084
|
RequestBodyContainsInvalidJSON = 50109,
|
1085
|
+
TheProvidedFileIsInvalid = 50110,
|
1086
|
+
TheProvidedFileTypeIsInvalid = 50123,
|
1087
|
+
TheProvidedFileDurationExceedsMaximumOf5Seconds = 50124,
|
1066
1088
|
OwnerCannotBePendingMember = 50131,
|
1067
1089
|
OwnershipCannotBeMovedToABotUser = 50132,
|
1068
1090
|
FailedToResizeAssetBelowTheMinimumSize = 50138,
|
1069
1091
|
CannotMixSubscriptionAndNonSubscriptionRolesForAnEmoji = 50144,
|
1070
1092
|
CannotConvertBetweenPremiumEmojiAndNormalEmoji = 50145,
|
1071
1093
|
UploadedFileNotFound = 50146,
|
1094
|
+
TheSpecifiedEmojiIsInvalid = 50151,
|
1072
1095
|
VoiceMessagesDoNotSupportAdditionalContent = 50159,
|
1073
1096
|
VoiceMessagesMustHaveASingleAudioAttachment = 50160,
|
1074
1097
|
VoiceMessagesMustHaveSupportingMetadata = 50161,
|
@@ -1076,6 +1099,7 @@ export declare enum JSONErrorCodes {
|
|
1076
1099
|
CannotDeleteGuildSubscriptionIntegration = 50163,
|
1077
1100
|
YouCannotSendVoiceMessagesInThisChannel = 50173,
|
1078
1101
|
TheUserAccountMustFirstBeVerified = 50178,
|
1102
|
+
TheProvidedFileDoesNotHaveAValidDuration = 50192,
|
1079
1103
|
YouDoNotHavePermissionToSendThisSticker = 50600,
|
1080
1104
|
TwoFactorAuthenticationIsRequired = 60003,
|
1081
1105
|
NoUsersWithDiscordTagExist = 80004,
|
package/dist/lib/constants.js
CHANGED
@@ -19,6 +19,7 @@ var GuildNavigationTypes;
|
|
19
19
|
GuildNavigationTypes["Customize"] = "customize";
|
20
20
|
GuildNavigationTypes["BrowseChannels"] = "browse";
|
21
21
|
GuildNavigationTypes["ServerGuide"] = "guide";
|
22
|
+
GuildNavigationTypes["LinkedRoles"] = "linked-roles";
|
22
23
|
})(GuildNavigationTypes || (exports.GuildNavigationTypes = GuildNavigationTypes = {}));
|
23
24
|
/** https://discord.com/developers/docs/reference#image-formatting-image-formats */
|
24
25
|
var ImageFormats;
|
@@ -240,6 +241,9 @@ var AuditLogEvents;
|
|
240
241
|
AuditLogEvents[AuditLogEvents["ThreadUpdate"] = 111] = "ThreadUpdate";
|
241
242
|
AuditLogEvents[AuditLogEvents["ThreadDelete"] = 112] = "ThreadDelete";
|
242
243
|
AuditLogEvents[AuditLogEvents["ApplicationCommandPermissionUpdate"] = 121] = "ApplicationCommandPermissionUpdate";
|
244
|
+
AuditLogEvents[AuditLogEvents["SoundboardSoundCreate"] = 130] = "SoundboardSoundCreate";
|
245
|
+
AuditLogEvents[AuditLogEvents["SoundboardSoundUpdate"] = 131] = "SoundboardSoundUpdate";
|
246
|
+
AuditLogEvents[AuditLogEvents["SoundboardSoundDelete"] = 132] = "SoundboardSoundDelete";
|
243
247
|
AuditLogEvents[AuditLogEvents["AutoModerationRuleCreate"] = 140] = "AutoModerationRuleCreate";
|
244
248
|
AuditLogEvents[AuditLogEvents["AutoModerationRuleUpdate"] = 141] = "AutoModerationRuleUpdate";
|
245
249
|
AuditLogEvents[AuditLogEvents["AutoModerationRuleDelete"] = 142] = "AutoModerationRuleDelete";
|
@@ -400,6 +404,7 @@ var GuildFeatures;
|
|
400
404
|
GuildFeatures["InvitesDisabled"] = "INVITES_DISABLED";
|
401
405
|
GuildFeatures["InviteSplash"] = "INVITE_SPLASH";
|
402
406
|
GuildFeatures["MemberVerificationGateEnabled"] = "MEMBER_VERIFICATION_GATE_ENABLED";
|
407
|
+
GuildFeatures["MoreSoundboard"] = "MORE_SOUNDBOARD";
|
403
408
|
GuildFeatures["MoreStickers"] = "MORE_STICKERS";
|
404
409
|
GuildFeatures["News"] = "NEWS";
|
405
410
|
GuildFeatures["Partnered"] = "PARTNERED";
|
@@ -408,6 +413,7 @@ var GuildFeatures;
|
|
408
413
|
GuildFeatures["RoleIcons"] = "ROLE_ICONS";
|
409
414
|
GuildFeatures["RoleSubscriptionsAvailableForPurchase"] = "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE";
|
410
415
|
GuildFeatures["RoleSubscriptionsEnabled"] = "ROLE_SUBSCRIPTIONS_ENABLED";
|
416
|
+
GuildFeatures["Soundboard"] = "SOUNDBOARD";
|
411
417
|
GuildFeatures["TicketedEventsEnabled"] = "TICKETED_EVENTS_ENABLED";
|
412
418
|
GuildFeatures["VanityURL"] = "VANITY_URL";
|
413
419
|
GuildFeatures["Verified"] = "VERIFIED";
|
@@ -684,6 +690,7 @@ var PremiumTypes;
|
|
684
690
|
/** https://discord.com/developers/docs/resources/user#connection-object-services */
|
685
691
|
var Services;
|
686
692
|
(function (Services) {
|
693
|
+
Services["AmazonMusic"] = "amazon-music";
|
687
694
|
Services["BattleNet"] = "battlenet";
|
688
695
|
Services["Ebay"] = "ebay";
|
689
696
|
Services["EpicGames"] = "epicgames";
|
@@ -738,7 +745,7 @@ var GatewayIntents;
|
|
738
745
|
GatewayIntents[GatewayIntents["Guilds"] = 1] = "Guilds";
|
739
746
|
GatewayIntents[GatewayIntents["GuildMembers"] = 2] = "GuildMembers";
|
740
747
|
GatewayIntents[GatewayIntents["GuildModeration"] = 4] = "GuildModeration";
|
741
|
-
GatewayIntents[GatewayIntents["
|
748
|
+
GatewayIntents[GatewayIntents["GuildExpressions"] = 8] = "GuildExpressions";
|
742
749
|
GatewayIntents[GatewayIntents["GuildIntegrations"] = 16] = "GuildIntegrations";
|
743
750
|
GatewayIntents[GatewayIntents["GuildWebhooks"] = 32] = "GuildWebhooks";
|
744
751
|
GatewayIntents[GatewayIntents["GuildInvites"] = 64] = "GuildInvites";
|
@@ -813,6 +820,11 @@ var GatewayEvents;
|
|
813
820
|
GatewayEvents["GuildScheduledEventDelete"] = "GUILD_SCHEDULED_EVENT_DELETE";
|
814
821
|
GatewayEvents["GuildScheduledEventUserAdd"] = "GUILD_SCHEDULED_EVENT_USER_ADD";
|
815
822
|
GatewayEvents["GuildScheduledEventUserRemove"] = "GUILD_SCHEDULED_EVENT_USER_REMOVE";
|
823
|
+
GatewayEvents["GuildSoundboardSoundCreate"] = "GUILD_SOUNDBOARD_SOUND_CREATE";
|
824
|
+
GatewayEvents["GuildSoundboardSoundUpdate"] = "GUILD_SOUNDBOARD_SOUND_UPDATE";
|
825
|
+
GatewayEvents["GuildSoundboardSoundDelete"] = "GUILD_SOUNDBOARD_SOUND_DELETE";
|
826
|
+
GatewayEvents["GuildSoundboardSoundsUpdate"] = "GUILD_SOUNDBOARD_SOUNDS_UPDATE";
|
827
|
+
GatewayEvents["SoundboardSounds"] = "SOUNDBOARD_SOUNDS";
|
816
828
|
GatewayEvents["IntegrationCreate"] = "INTEGRATION_CREATE";
|
817
829
|
GatewayEvents["IntegrationUpdate"] = "INTEGRATION_UPDATE";
|
818
830
|
GatewayEvents["IntegrationDelete"] = "INTEGRATION_DELETE";
|
@@ -918,6 +930,7 @@ var GatewayOPCodes;
|
|
918
930
|
GatewayOPCodes[GatewayOPCodes["InvalidSession"] = 9] = "InvalidSession";
|
919
931
|
GatewayOPCodes[GatewayOPCodes["Hello"] = 10] = "Hello";
|
920
932
|
GatewayOPCodes[GatewayOPCodes["HeartbeatACK"] = 11] = "HeartbeatACK";
|
933
|
+
GatewayOPCodes[GatewayOPCodes["RequestSoundboardSounds"] = 31] = "RequestSoundboardSounds";
|
921
934
|
})(GatewayOPCodes || (exports.GatewayOPCodes = GatewayOPCodes = {}));
|
922
935
|
/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes */
|
923
936
|
var GatewayCloseEventCodes;
|
@@ -1004,6 +1017,7 @@ var JSONErrorCodes;
|
|
1004
1017
|
JSONErrorCodes[JSONErrorCodes["UnknownWebhook"] = 10015] = "UnknownWebhook";
|
1005
1018
|
JSONErrorCodes[JSONErrorCodes["UnknownWebhookService"] = 10016] = "UnknownWebhookService";
|
1006
1019
|
JSONErrorCodes[JSONErrorCodes["UnknownSession"] = 10020] = "UnknownSession";
|
1020
|
+
JSONErrorCodes[JSONErrorCodes["UnknownAsset"] = 10021] = "UnknownAsset";
|
1007
1021
|
JSONErrorCodes[JSONErrorCodes["UnknownBan"] = 10026] = "UnknownBan";
|
1008
1022
|
JSONErrorCodes[JSONErrorCodes["UnknownSKU"] = 10027] = "UnknownSKU";
|
1009
1023
|
JSONErrorCodes[JSONErrorCodes["UnknownStoreListing"] = 10028] = "UnknownStoreListing";
|
@@ -1030,6 +1044,7 @@ var JSONErrorCodes;
|
|
1030
1044
|
JSONErrorCodes[JSONErrorCodes["UnknownGuildScheduledEvent"] = 10070] = "UnknownGuildScheduledEvent";
|
1031
1045
|
JSONErrorCodes[JSONErrorCodes["UnknownGuildScheduledEventUser"] = 10071] = "UnknownGuildScheduledEventUser";
|
1032
1046
|
JSONErrorCodes[JSONErrorCodes["UnknownTag"] = 10087] = "UnknownTag";
|
1047
|
+
JSONErrorCodes[JSONErrorCodes["UnknownSound"] = 10091] = "UnknownSound";
|
1033
1048
|
JSONErrorCodes[JSONErrorCodes["BotsCannotUseThisEndpoint"] = 20001] = "BotsCannotUseThisEndpoint";
|
1034
1049
|
JSONErrorCodes[JSONErrorCodes["OnlyBotsCanUseThisEndpoint"] = 20002] = "OnlyBotsCanUseThisEndpoint";
|
1035
1050
|
JSONErrorCodes[JSONErrorCodes["ExplicitContentCannotBeSentToTheDesiredRecipient"] = 20009] = "ExplicitContentCannotBeSentToTheDesiredRecipient";
|
@@ -1068,6 +1083,7 @@ var JSONErrorCodes;
|
|
1068
1083
|
JSONErrorCodes[JSONErrorCodes["MaximumNumberOfStickersReached"] = 30039] = "MaximumNumberOfStickersReached";
|
1069
1084
|
JSONErrorCodes[JSONErrorCodes["MaximumNumberOfPruneRequestsHasBeenReached"] = 30040] = "MaximumNumberOfPruneRequestsHasBeenReached";
|
1070
1085
|
JSONErrorCodes[JSONErrorCodes["MaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached"] = 30042] = "MaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached";
|
1086
|
+
JSONErrorCodes[JSONErrorCodes["MaximumNumberOfSoundboardSoundsReached"] = 30045] = "MaximumNumberOfSoundboardSoundsReached";
|
1071
1087
|
JSONErrorCodes[JSONErrorCodes["MaximumNumberOfEditsToMessagesOlderThanOneHourReached"] = 30046] = "MaximumNumberOfEditsToMessagesOlderThanOneHourReached";
|
1072
1088
|
JSONErrorCodes[JSONErrorCodes["MaximumNumberOfPinnedThreadsInForumHasBeenReached"] = 30047] = "MaximumNumberOfPinnedThreadsInForumHasBeenReached";
|
1073
1089
|
JSONErrorCodes[JSONErrorCodes["MaximumNumberOfTagsInForumHasBeenReached"] = 30048] = "MaximumNumberOfTagsInForumHasBeenReached";
|
@@ -1084,6 +1100,8 @@ var JSONErrorCodes;
|
|
1084
1100
|
JSONErrorCodes[JSONErrorCodes["FeatureTemporarilyDisabledServerSide"] = 40006] = "FeatureTemporarilyDisabledServerSide";
|
1085
1101
|
JSONErrorCodes[JSONErrorCodes["UserBannedFromThisGuild"] = 40007] = "UserBannedFromThisGuild";
|
1086
1102
|
JSONErrorCodes[JSONErrorCodes["ConnectionHasBeenRevoked"] = 40012] = "ConnectionHasBeenRevoked";
|
1103
|
+
JSONErrorCodes[JSONErrorCodes["OnlyConsumableSKUsCanBeConsumed"] = 40018] = "OnlyConsumableSKUsCanBeConsumed";
|
1104
|
+
JSONErrorCodes[JSONErrorCodes["YouCanOnlyDeleteSandboxEntitlements"] = 40019] = "YouCanOnlyDeleteSandboxEntitlements";
|
1087
1105
|
JSONErrorCodes[JSONErrorCodes["TargetUserIsNotConnectedToVoice"] = 40032] = "TargetUserIsNotConnectedToVoice";
|
1088
1106
|
JSONErrorCodes[JSONErrorCodes["ThisMessageWasAlreadyCrossposted"] = 40033] = "ThisMessageWasAlreadyCrossposted";
|
1089
1107
|
JSONErrorCodes[JSONErrorCodes["ApplicationCommandWithThatNameAlreadyExists"] = 40041] = "ApplicationCommandWithThatNameAlreadyExists";
|
@@ -1095,6 +1113,7 @@ var JSONErrorCodes;
|
|
1095
1113
|
JSONErrorCodes[JSONErrorCodes["ThereAreNoTagsAvailableThatCanBeSetByNonModerators"] = 40066] = "ThereAreNoTagsAvailableThatCanBeSetByNonModerators";
|
1096
1114
|
JSONErrorCodes[JSONErrorCodes["TagRequiredToCreateAForumPostInThisChannel"] = 40067] = "TagRequiredToCreateAForumPostInThisChannel";
|
1097
1115
|
JSONErrorCodes[JSONErrorCodes["AnEntitlementHasAlreadyBeenGrantedForThisResource"] = 40074] = "AnEntitlementHasAlreadyBeenGrantedForThisResource";
|
1116
|
+
JSONErrorCodes[JSONErrorCodes["ThisInteractionHasHitTheMaximumNumberOfFollowUpMessages"] = 40094] = "ThisInteractionHasHitTheMaximumNumberOfFollowUpMessages";
|
1098
1117
|
JSONErrorCodes[JSONErrorCodes["CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent"] = 40333] = "CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent";
|
1099
1118
|
JSONErrorCodes[JSONErrorCodes["MissingAccess"] = 50001] = "MissingAccess";
|
1100
1119
|
JSONErrorCodes[JSONErrorCodes["InvalidAccountType"] = 50002] = "InvalidAccountType";
|
@@ -1148,12 +1167,16 @@ var JSONErrorCodes;
|
|
1148
1167
|
JSONErrorCodes[JSONErrorCodes["ServerNeedsMonetizationEnabledToPerformThisAction"] = 50097] = "ServerNeedsMonetizationEnabledToPerformThisAction";
|
1149
1168
|
JSONErrorCodes[JSONErrorCodes["ServerNeedsMoreBoostsToPerformThisAction"] = 50101] = "ServerNeedsMoreBoostsToPerformThisAction";
|
1150
1169
|
JSONErrorCodes[JSONErrorCodes["RequestBodyContainsInvalidJSON"] = 50109] = "RequestBodyContainsInvalidJSON";
|
1170
|
+
JSONErrorCodes[JSONErrorCodes["TheProvidedFileIsInvalid"] = 50110] = "TheProvidedFileIsInvalid";
|
1171
|
+
JSONErrorCodes[JSONErrorCodes["TheProvidedFileTypeIsInvalid"] = 50123] = "TheProvidedFileTypeIsInvalid";
|
1172
|
+
JSONErrorCodes[JSONErrorCodes["TheProvidedFileDurationExceedsMaximumOf5Seconds"] = 50124] = "TheProvidedFileDurationExceedsMaximumOf5Seconds";
|
1151
1173
|
JSONErrorCodes[JSONErrorCodes["OwnerCannotBePendingMember"] = 50131] = "OwnerCannotBePendingMember";
|
1152
1174
|
JSONErrorCodes[JSONErrorCodes["OwnershipCannotBeMovedToABotUser"] = 50132] = "OwnershipCannotBeMovedToABotUser";
|
1153
1175
|
JSONErrorCodes[JSONErrorCodes["FailedToResizeAssetBelowTheMinimumSize"] = 50138] = "FailedToResizeAssetBelowTheMinimumSize";
|
1154
1176
|
JSONErrorCodes[JSONErrorCodes["CannotMixSubscriptionAndNonSubscriptionRolesForAnEmoji"] = 50144] = "CannotMixSubscriptionAndNonSubscriptionRolesForAnEmoji";
|
1155
1177
|
JSONErrorCodes[JSONErrorCodes["CannotConvertBetweenPremiumEmojiAndNormalEmoji"] = 50145] = "CannotConvertBetweenPremiumEmojiAndNormalEmoji";
|
1156
1178
|
JSONErrorCodes[JSONErrorCodes["UploadedFileNotFound"] = 50146] = "UploadedFileNotFound";
|
1179
|
+
JSONErrorCodes[JSONErrorCodes["TheSpecifiedEmojiIsInvalid"] = 50151] = "TheSpecifiedEmojiIsInvalid";
|
1157
1180
|
JSONErrorCodes[JSONErrorCodes["VoiceMessagesDoNotSupportAdditionalContent"] = 50159] = "VoiceMessagesDoNotSupportAdditionalContent";
|
1158
1181
|
JSONErrorCodes[JSONErrorCodes["VoiceMessagesMustHaveASingleAudioAttachment"] = 50160] = "VoiceMessagesMustHaveASingleAudioAttachment";
|
1159
1182
|
JSONErrorCodes[JSONErrorCodes["VoiceMessagesMustHaveSupportingMetadata"] = 50161] = "VoiceMessagesMustHaveSupportingMetadata";
|
@@ -1161,6 +1184,7 @@ var JSONErrorCodes;
|
|
1161
1184
|
JSONErrorCodes[JSONErrorCodes["CannotDeleteGuildSubscriptionIntegration"] = 50163] = "CannotDeleteGuildSubscriptionIntegration";
|
1162
1185
|
JSONErrorCodes[JSONErrorCodes["YouCannotSendVoiceMessagesInThisChannel"] = 50173] = "YouCannotSendVoiceMessagesInThisChannel";
|
1163
1186
|
JSONErrorCodes[JSONErrorCodes["TheUserAccountMustFirstBeVerified"] = 50178] = "TheUserAccountMustFirstBeVerified";
|
1187
|
+
JSONErrorCodes[JSONErrorCodes["TheProvidedFileDoesNotHaveAValidDuration"] = 50192] = "TheProvidedFileDoesNotHaveAValidDuration";
|
1164
1188
|
JSONErrorCodes[JSONErrorCodes["YouDoNotHavePermissionToSendThisSticker"] = 50600] = "YouDoNotHavePermissionToSendThisSticker";
|
1165
1189
|
JSONErrorCodes[JSONErrorCodes["TwoFactorAuthenticationIsRequired"] = 60003] = "TwoFactorAuthenticationIsRequired";
|
1166
1190
|
JSONErrorCodes[JSONErrorCodes["NoUsersWithDiscordTagExist"] = 80004] = "NoUsersWithDiscordTagExist";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import WebSocket from "ws";
|
2
2
|
import { Client } from "../Client";
|
3
|
-
import type { GatewayPresenceUpdate, GatewayVoiceStateUpdate, Identify, RequestGuildMembers, Resume } from "../types/gateway-events";
|
3
|
+
import type { GatewayPresenceUpdate, GatewayVoiceStateUpdate, Identify, RequestGuildMembers, RequestSoundboardSounds, Resume } from "../types/gateway-events";
|
4
4
|
export declare class Shard {
|
5
5
|
id: number;
|
6
6
|
private heartbeatInterval;
|
@@ -24,6 +24,8 @@ export declare class Shard {
|
|
24
24
|
private onWebSocketClose;
|
25
25
|
/** https://discord.com/developers/docs/topics/gateway-events#request-guild-members */
|
26
26
|
requestGuildMembers(options: RequestGuildMembers): void;
|
27
|
+
/** https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds */
|
28
|
+
requestSoundboardSounds(options: RequestSoundboardSounds): void;
|
27
29
|
/** https://discord.com/developers/docs/topics/gateway-events#resume */
|
28
30
|
resume(options: Resume): void;
|
29
31
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
@@ -318,6 +318,24 @@ class Shard {
|
|
318
318
|
case constants_1.GatewayEvents.GuildScheduledEventUserRemove:
|
319
319
|
this.client.emit("guildScheduledEventUserRemove", packet.d.user_id, packet.d.guild_scheduled_event_id, packet.d.guild_id);
|
320
320
|
break;
|
321
|
+
case constants_1.GatewayEvents.GuildSoundboardSoundCreate:
|
322
|
+
this.client.emit("guildSoundboardSoundCreate", transformers_1.Soundboards.soundboardSoundFromRaw(packet.d));
|
323
|
+
break;
|
324
|
+
case constants_1.GatewayEvents.GuildSoundboardSoundUpdate:
|
325
|
+
this.client.emit("guildSoundboardSoundUpdate", transformers_1.Soundboards.soundboardSoundFromRaw(packet.d));
|
326
|
+
break;
|
327
|
+
case constants_1.GatewayEvents.GuildSoundboardSoundDelete:
|
328
|
+
this.client.emit("guildSoundboardSoundDelete", {
|
329
|
+
soundID: packet.d.sound_id,
|
330
|
+
guildID: packet.d.guild_id,
|
331
|
+
});
|
332
|
+
break;
|
333
|
+
case constants_1.GatewayEvents.GuildSoundboardSoundsUpdate:
|
334
|
+
this.client.emit("guildSoundboardSoundsUpdate", packet.d.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound)));
|
335
|
+
break;
|
336
|
+
case constants_1.GatewayEvents.SoundboardSounds:
|
337
|
+
this.client.emit("soundboardSounds", packet.d.soundboard_sounds.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound)), packet.d.guild_id);
|
338
|
+
break;
|
321
339
|
case constants_1.GatewayEvents.IntegrationCreate:
|
322
340
|
this.client.emit("integrationCreate", {
|
323
341
|
...transformers_1.Guilds.integrationFromRaw(packet.d),
|
@@ -598,6 +616,15 @@ class Shard {
|
|
598
616
|
},
|
599
617
|
}));
|
600
618
|
}
|
619
|
+
/** https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds */
|
620
|
+
requestSoundboardSounds(options) {
|
621
|
+
this.ws.send(JSON.stringify({
|
622
|
+
op: constants_1.GatewayOPCodes.RequestSoundboardSounds,
|
623
|
+
d: {
|
624
|
+
guild_ids: options.guildIDs,
|
625
|
+
},
|
626
|
+
}));
|
627
|
+
}
|
601
628
|
/** https://discord.com/developers/docs/topics/gateway-events#resume */
|
602
629
|
resume(options) {
|
603
630
|
this.ws.send(JSON.stringify({
|
@@ -29,6 +29,8 @@ export declare const guildRoles: (guildID: snowflake) => `guilds/${string}/roles
|
|
29
29
|
export declare const guildScheduledEvent: (guildID: snowflake, guildScheduledEventID: snowflake) => `guilds/${string}/scheduled-events/${string}`;
|
30
30
|
export declare const guildScheduledEvents: (guildID: snowflake) => `guilds/${string}/scheduled-events`;
|
31
31
|
export declare const guildScheduledEventUsers: (guildID: snowflake, guildScheduledEventID: snowflake) => `guilds/${string}/scheduled-events/${string}/users`;
|
32
|
+
export declare const guildSoundboardSound: (guildID: snowflake, soundID: snowflake) => `guilds/${string}/soundboard-sounds/${string}`;
|
33
|
+
export declare const guildSoundboardSounds: (guildID: snowflake) => `guilds/${string}/soundboard-sounds`;
|
32
34
|
export declare const guildSticker: (guildID: snowflake, stickerID: snowflake) => `guilds/${string}/stickers/${string}`;
|
33
35
|
export declare const guildStickers: (guildID: snowflake) => `guilds/${string}/stickers`;
|
34
36
|
export declare const guildTemplate: (guildID: snowflake, code: string) => `guilds/${string}/templates/${string}`;
|
@@ -90,6 +92,8 @@ export declare const stickerPack: (packID: snowflake) => `sticker-packs/${string
|
|
90
92
|
export declare const stickerPacks: () => "sticker-packs";
|
91
93
|
export declare const skuSubscription: (skuID: snowflake, subscriptionID: snowflake) => `skus/${string}/subscriptions/${string}`;
|
92
94
|
export declare const skuSubscriptions: (skuID: snowflake) => `skus/${string}/subscriptions`;
|
95
|
+
export declare const sendSoundboardSound: (channelID: snowflake) => `channels/${string}/send-soundboard-sound`;
|
96
|
+
export declare const soundboardDefaultSounds: () => "soundboard-default-sounds";
|
93
97
|
export declare const gateway: () => "gateway";
|
94
98
|
export declare const gatewayBot: () => "gateway/bot";
|
95
99
|
export declare const oauth2Authorize: () => "oauth2/authorize";
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
exports.
|
5
|
-
exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = void 0;
|
3
|
+
exports.channelMessage = exports.channelInvites = exports.channelFollowers = exports.channelBulkDelete = exports.channel = exports.template = exports.guildWidgetSettings = exports.guildWidgetJSON = exports.guildWidgetImage = exports.guildWelcomeScreen = exports.guildWebhooks = exports.guildVoiceState = exports.guildVoiceRegions = exports.guildVanityURL = exports.guildTemplates = exports.guildTemplate = exports.guildStickers = exports.guildSticker = exports.guildSoundboardSounds = exports.guildSoundboardSound = exports.guildScheduledEventUsers = exports.guildScheduledEvents = exports.guildScheduledEvent = exports.guildRoles = exports.guildRole = exports.guildPrune = exports.guildPreview = exports.guildOnboarding = exports.guildMemberVerification = exports.guildMembersSearch = exports.guildMembers = exports.guildMemberRole = exports.guildMember = exports.guildMFA = exports.guildInvites = exports.guildIntegrations = exports.guildIntegration = exports.guildEmojis = exports.guildEmoji = exports.guildMemberNickname = exports.guildChannels = exports.guildBulkBan = exports.guildBans = exports.guildBan = exports.guildAutoModerationRules = exports.guildAutoModerationRule = exports.guildAuditLog = exports.guildActiveThreads = exports.guilds = exports.guild = void 0;
|
4
|
+
exports.oauth2Authorization = exports.oauth2Application = exports.oauth2Authorize = exports.gatewayBot = exports.gateway = exports.soundboardDefaultSounds = exports.sendSoundboardSound = exports.skuSubscriptions = exports.skuSubscription = exports.stickerPacks = exports.stickerPack = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSKUs = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlementConsume = exports.applicationEntitlement = exports.applicationEmojis = exports.applicationEmoji = exports.applicationUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.applicationActivityInstance = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.pollExpire = exports.pollAnswerVoters = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = exports.channelMessageReaction = exports.channelMessageCrosspost = exports.channelMessageAllReactions = void 0;
|
5
|
+
exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = void 0;
|
6
6
|
// Guilds
|
7
7
|
const guild = (guildID) => `guilds/${guildID}`;
|
8
8
|
exports.guild = guild;
|
@@ -64,6 +64,10 @@ const guildScheduledEvents = (guildID) => `guilds/${guildID}/scheduled-events`;
|
|
64
64
|
exports.guildScheduledEvents = guildScheduledEvents;
|
65
65
|
const guildScheduledEventUsers = (guildID, guildScheduledEventID) => `guilds/${guildID}/scheduled-events/${guildScheduledEventID}/users`;
|
66
66
|
exports.guildScheduledEventUsers = guildScheduledEventUsers;
|
67
|
+
const guildSoundboardSound = (guildID, soundID) => `guilds/${guildID}/soundboard-sounds/${soundID}`;
|
68
|
+
exports.guildSoundboardSound = guildSoundboardSound;
|
69
|
+
const guildSoundboardSounds = (guildID) => `guilds/${guildID}/soundboard-sounds`;
|
70
|
+
exports.guildSoundboardSounds = guildSoundboardSounds;
|
67
71
|
const guildSticker = (guildID, stickerID) => `guilds/${guildID}/stickers/${stickerID}`;
|
68
72
|
exports.guildSticker = guildSticker;
|
69
73
|
const guildStickers = (guildID) => `guilds/${guildID}/stickers`;
|
@@ -202,6 +206,11 @@ const skuSubscription = (skuID, subscriptionID) => `skus/${skuID}/subscriptions/
|
|
202
206
|
exports.skuSubscription = skuSubscription;
|
203
207
|
const skuSubscriptions = (skuID) => `skus/${skuID}/subscriptions`;
|
204
208
|
exports.skuSubscriptions = skuSubscriptions;
|
209
|
+
// Soundboards
|
210
|
+
const sendSoundboardSound = (channelID) => `channels/${channelID}/send-soundboard-sound`;
|
211
|
+
exports.sendSoundboardSound = sendSoundboardSound;
|
212
|
+
const soundboardDefaultSounds = () => `soundboard-default-sounds`;
|
213
|
+
exports.soundboardDefaultSounds = soundboardDefaultSounds;
|
205
214
|
// Gateway
|
206
215
|
const gateway = () => "gateway";
|
207
216
|
exports.gateway = gateway;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { RawSoundboardSound, SoundboardSound } from "../types/soundboard";
|
2
|
+
export declare class Soundboards {
|
3
|
+
static soundboardSoundFromRaw(sound: RawSoundboardSound): SoundboardSound;
|
4
|
+
static soundboardSoundToRaw(sound: SoundboardSound): RawSoundboardSound;
|
5
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Soundboards = void 0;
|
4
|
+
const Users_1 = require("./Users");
|
5
|
+
class Soundboards {
|
6
|
+
static soundboardSoundFromRaw(sound) {
|
7
|
+
return {
|
8
|
+
name: sound.name,
|
9
|
+
soundID: sound.sound_id,
|
10
|
+
volume: sound.volume,
|
11
|
+
emojiID: sound.emoji_id,
|
12
|
+
emojiName: sound.emoji_name,
|
13
|
+
guildID: sound.guild_id,
|
14
|
+
available: sound.available,
|
15
|
+
user: sound.user !== undefined ? Users_1.Users.userFromRaw(sound.user) : undefined,
|
16
|
+
};
|
17
|
+
}
|
18
|
+
static soundboardSoundToRaw(sound) {
|
19
|
+
return {
|
20
|
+
name: sound.name,
|
21
|
+
sound_id: sound.soundID,
|
22
|
+
volume: sound.volume,
|
23
|
+
emoji_id: sound.emojiID,
|
24
|
+
emoji_name: sound.emojiName,
|
25
|
+
guild_id: sound.guildID,
|
26
|
+
available: sound.available,
|
27
|
+
user: sound.user !== undefined ? Users_1.Users.userToRaw(sound.user) : undefined,
|
28
|
+
};
|
29
|
+
}
|
30
|
+
}
|
31
|
+
exports.Soundboards = Soundboards;
|
@@ -32,6 +32,7 @@ __exportStar(require("./Polls"), exports);
|
|
32
32
|
__exportStar(require("./Presences"), exports);
|
33
33
|
__exportStar(require("./Roles"), exports);
|
34
34
|
__exportStar(require("./SKUs"), exports);
|
35
|
+
__exportStar(require("./Soundboards"), exports);
|
35
36
|
__exportStar(require("./StageInstances"), exports);
|
36
37
|
__exportStar(require("./Stickers"), exports);
|
37
38
|
__exportStar(require("./Subscriptions"), exports);
|
@@ -6,6 +6,7 @@ import type { snowflake, timestamp } from "./common";
|
|
6
6
|
import type { RawEmoji, Emoji } from "./emoji";
|
7
7
|
import type { RawGuildMember, GuildMember } from "./guild";
|
8
8
|
import type { RawGuildScheduledEvent, GuildScheduledEvent } from "./guild-scheduled-event";
|
9
|
+
import type { RawSoundboardSound, SoundboardSound } from "./soundboard";
|
9
10
|
import type { RawStageInstance, StageInstance } from "./stage-instance";
|
10
11
|
import type { RawUser, RawAvatarDecorationData, User, AvatarDecorationData } from "./user";
|
11
12
|
import type { RawVoiceState, VoiceState } from "./voice";
|
@@ -47,6 +48,10 @@ export interface RawRequestGuildMembers {
|
|
47
48
|
user_ids?: snowflake | Array<snowflake>;
|
48
49
|
nonce?: string;
|
49
50
|
}
|
51
|
+
/** https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds-request-soundboard-sounds-structure */
|
52
|
+
export interface RequestSoundboardSounds {
|
53
|
+
guild_ids: Array<snowflake>;
|
54
|
+
}
|
50
55
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure */
|
51
56
|
export interface RawGatewayPresenceUpdate {
|
52
57
|
since: number | null;
|
@@ -113,6 +118,7 @@ export interface RawGuildCreateEventExtraFields {
|
|
113
118
|
presences?: Array<RawPresenceUpdateEventFields>;
|
114
119
|
stage_instances?: Array<RawStageInstance>;
|
115
120
|
guild_scheduled_events?: Array<RawGuildScheduledEvent>;
|
121
|
+
soundboard_sounds?: Array<RawSoundboardSound>;
|
116
122
|
}
|
117
123
|
/** https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create-guild-audit-log-entry-create-extra-fields */
|
118
124
|
export interface RawGuildAuditLogEntryCreateExtraFields {
|
@@ -167,6 +173,11 @@ export interface RawGuildMembersChunkEventFields {
|
|
167
173
|
presences?: Array<RawPresenceUpdateEventFields>;
|
168
174
|
nonce?: string;
|
169
175
|
}
|
176
|
+
/** https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete-guild-soundboard-sound-delete-event-fields */
|
177
|
+
export interface RawGuildSoundboardSoundDeleteEventFields {
|
178
|
+
soundID: snowflake;
|
179
|
+
guildID: snowflake;
|
180
|
+
}
|
170
181
|
/** https://discord.com/developers/docs/topics/gateway-events#integration-create-integration-create-event-additional-fields */
|
171
182
|
export interface RawIntegrationCreateEventExtraFields {
|
172
183
|
guild_id: snowflake;
|
@@ -396,6 +407,9 @@ export interface RequestGuildMembers {
|
|
396
407
|
userIDs?: snowflake | Array<snowflake>;
|
397
408
|
nonce?: string;
|
398
409
|
}
|
410
|
+
export interface RequestSoundboardSounds {
|
411
|
+
guildIDs: Array<snowflake>;
|
412
|
+
}
|
399
413
|
export interface GatewayPresenceUpdate {
|
400
414
|
since: number | null;
|
401
415
|
activities: Array<Partial<Pick<Activity, "name" | "type" | "url" | "state">>>;
|
@@ -454,6 +468,7 @@ export interface GuildCreateEventExtraFields {
|
|
454
468
|
presences?: Array<PresenceUpdateEventFields>;
|
455
469
|
stageInstances?: Array<StageInstance>;
|
456
470
|
guildScheduledEvents?: Array<GuildScheduledEvent>;
|
471
|
+
soundboardSounds?: Array<SoundboardSound>;
|
457
472
|
}
|
458
473
|
export interface GuildAuditLogEntryCreateExtraFields {
|
459
474
|
guildID: snowflake;
|
@@ -500,6 +515,10 @@ export interface GuildMembersChunkEventFields {
|
|
500
515
|
presences?: Array<PresenceUpdateEventFields>;
|
501
516
|
nonce?: string;
|
502
517
|
}
|
518
|
+
export interface GuildSoundboardSoundDeleteEventFields {
|
519
|
+
soundID: snowflake;
|
520
|
+
guildID: snowflake;
|
521
|
+
}
|
503
522
|
export interface IntegrationCreateEventExtraFields {
|
504
523
|
guildID: snowflake;
|
505
524
|
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import type { snowflake } from "./common";
|
2
|
+
import type { RawUser, User } from "./user";
|
3
|
+
/** https://discord.com/developers/docs/resources/soundboard#soundboard-sound-structure */
|
4
|
+
export interface RawSoundboardSound {
|
5
|
+
name: string;
|
6
|
+
sound_id: snowflake;
|
7
|
+
volume: number;
|
8
|
+
emoji_id: snowflake | null;
|
9
|
+
emoji_name: string | null;
|
10
|
+
guild_id?: snowflake;
|
11
|
+
available: boolean;
|
12
|
+
user?: RawUser;
|
13
|
+
}
|
14
|
+
export interface SoundboardSound {
|
15
|
+
name: string;
|
16
|
+
soundID: snowflake;
|
17
|
+
volume: number;
|
18
|
+
emojiID: snowflake | null;
|
19
|
+
emojiName: string | null;
|
20
|
+
guildID?: snowflake;
|
21
|
+
available: boolean;
|
22
|
+
user?: User;
|
23
|
+
}
|
package/dist/lib/utils/CDN.d.ts
CHANGED
@@ -18,6 +18,7 @@ export declare const roleIcon: (roleID: snowflake, icon: string, imageFormat?: I
|
|
18
18
|
export declare const stickerPackBanner: (assetID: snowflake, imageFormat?: ImageFormats.PNG | ImageFormats.JPEG | ImageFormats.JPG | ImageFormats.WebP) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
19
19
|
export declare const sticker: (stickerID: snowflake, imageFormat?: ImageFormats.PNG | ImageFormats.Lottie | ImageFormats.GIF) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
20
20
|
export declare const storePageAsset: (applicationID: snowflake, assetID: snowflake, imageFormat?: ImageFormats.PNG | ImageFormats.JPEG | ImageFormats.JPG | ImageFormats.WebP) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
21
|
+
export declare const soundboardSound: (soundID: snowflake) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
21
22
|
export declare const teamIcon: (teamID: snowflake, icon: string, imageFormat?: ImageFormats.PNG | ImageFormats.JPEG | ImageFormats.JPG | ImageFormats.WebP) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
22
23
|
export declare const userAvatar: (userID: snowflake, avatar: string, imageFormat?: ImageFormats.PNG | ImageFormats.JPEG | ImageFormats.JPG | ImageFormats.WebP | ImageFormats.GIF) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
23
24
|
export declare const userAvatarDecoration: (userID: snowflake, avatarDecoration: string) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
package/dist/lib/utils/CDN.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
/* https://discord.com/developers/docs/reference#image-formatting */
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.userBanner = exports.userAvatarDecoration = exports.userAvatar = exports.teamIcon = exports.storePageAsset = exports.sticker = exports.stickerPackBanner = exports.roleIcon = exports.guildSplash = exports.guildScheduledEventCover = exports.guildMemberBanner = exports.guildMemberAvatar = exports.guildIcon = exports.guildDiscoverySplash = exports.guildBanner = exports.defaultUserAvatar = exports.customEmoji = exports.applicationIcon = exports.applicationCover = exports.applicationAsset = exports.achievementIcon = exports.cdnURL = void 0;
|
4
|
+
exports.userBanner = exports.userAvatarDecoration = exports.userAvatar = exports.teamIcon = exports.soundboardSound = exports.storePageAsset = exports.sticker = exports.stickerPackBanner = exports.roleIcon = exports.guildSplash = exports.guildScheduledEventCover = exports.guildMemberBanner = exports.guildMemberAvatar = exports.guildIcon = exports.guildDiscoverySplash = exports.guildBanner = exports.defaultUserAvatar = exports.customEmoji = exports.applicationIcon = exports.applicationCover = exports.applicationAsset = exports.achievementIcon = exports.cdnURL = void 0;
|
5
5
|
const constants_1 = require("../constants");
|
6
6
|
const cdnURL = (cdnEndpoint, imageFormat = constants_1.ImageFormats.PNG) => `https://cdn.discordapp.com/${cdnEndpoint}.${imageFormat}`;
|
7
7
|
exports.cdnURL = cdnURL;
|
@@ -39,6 +39,8 @@ const sticker = (stickerID, imageFormat = constants_1.ImageFormats.PNG) => (0, e
|
|
39
39
|
exports.sticker = sticker;
|
40
40
|
const storePageAsset = (applicationID, assetID, imageFormat = constants_1.ImageFormats.PNG) => (0, exports.cdnURL)(`app-assets/${applicationID}/store/${assetID}`, imageFormat);
|
41
41
|
exports.storePageAsset = storePageAsset;
|
42
|
+
const soundboardSound = (soundID) => (0, exports.cdnURL)(`soundboard-sounds/${soundID}`);
|
43
|
+
exports.soundboardSound = soundboardSound;
|
42
44
|
const teamIcon = (teamID, icon, imageFormat = constants_1.ImageFormats.PNG) => (0, exports.cdnURL)(`team-icons/${teamID}/${icon}`, imageFormat);
|
43
45
|
exports.teamIcon = teamIcon;
|
44
46
|
const userAvatar = (userID, avatar, imageFormat = constants_1.ImageFormats.PNG) => (0, exports.cdnURL)(`avatars/${userID}/${avatar}`, imageFormat);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { GuildNavigationTypes, TimestampStyles } from "../constants";
|
2
2
|
import type { snowflake } from "../types/common";
|
3
3
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
4
4
|
export declare function userMention(userID: snowflake): string;
|
@@ -13,4 +13,4 @@ export declare function customEmoji(emojiName: string, emojiID: snowflake, anima
|
|
13
13
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
14
14
|
export declare function unixTimestamp(time: number, style?: TimestampStyles): string;
|
15
15
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
16
|
-
export declare function guildNavigation(guildID: snowflake, type: GuildNavigationTypes): string;
|
16
|
+
export declare function guildNavigation(guildID: snowflake, type: GuildNavigationTypes, roleID?: snowflake): string;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.guildNavigation = exports.unixTimestamp = exports.customEmoji = exports.slashCommandMention = exports.roleMention = exports.channelMention = exports.userMention = void 0;
|
4
|
+
const constants_1 = require("../constants");
|
4
5
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
5
6
|
function userMention(userID) {
|
6
7
|
return `<@${userID}>`;
|
@@ -38,7 +39,9 @@ function unixTimestamp(time, style) {
|
|
38
39
|
}
|
39
40
|
exports.unixTimestamp = unixTimestamp;
|
40
41
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
41
|
-
function guildNavigation(guildID, type) {
|
42
|
-
return
|
42
|
+
function guildNavigation(guildID, type, roleID) {
|
43
|
+
return roleID && type === constants_1.GuildNavigationTypes.LinkedRoles
|
44
|
+
? `<${guildID}:${type}:${roleID}>`
|
45
|
+
: `<${guildID}:${type}>`;
|
43
46
|
}
|
44
47
|
exports.guildNavigation = guildNavigation;
|
package/dist/package.json
CHANGED