disgroove 2.2.4-dev.e509559 → 2.2.5-dev.4e978d8
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/README.md +1 -0
- package/dist/lib/Client.d.ts +30 -7
- package/dist/lib/Client.js +100 -5
- package/dist/lib/constants.d.ts +48 -6
- package/dist/lib/constants.js +51 -5
- package/dist/lib/gateway/Shard.js +23 -0
- package/dist/lib/rest/Endpoints.d.ts +5 -1
- package/dist/lib/rest/Endpoints.js +14 -3
- package/dist/lib/transformers/Applications.js +2 -0
- package/dist/lib/transformers/Stickers.js +0 -2
- package/dist/lib/transformers/Subscriptions.d.ts +5 -0
- package/dist/lib/transformers/Subscriptions.js +32 -0
- package/dist/lib/transformers/index.d.ts +1 -0
- package/dist/lib/transformers/index.js +1 -0
- package/dist/lib/types/application.d.ts +31 -1
- package/dist/lib/types/entitlements.d.ts +1 -1
- package/dist/lib/types/gateway-events.d.ts +22 -1
- package/dist/lib/types/message.d.ts +26 -5
- package/dist/lib/types/sku.d.ts +1 -1
- package/dist/lib/types/sticker.d.ts +0 -2
- package/dist/lib/types/subscription.d.ts +25 -0
- package/dist/lib/types/subscription.js +2 -0
- package/dist/lib/utils/formatters.d.ts +2 -2
- package/dist/lib/utils/formatters.js +5 -2
- package/dist/package.json +4 -4
- package/package.json +35 -35
package/README.md
CHANGED
package/dist/lib/Client.d.ts
CHANGED
@@ -3,7 +3,7 @@ import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetSt
|
|
3
3
|
import { RequestManager, type File } from "./rest";
|
4
4
|
import EventEmitter from "node:events";
|
5
5
|
import { Shard } from "./gateway";
|
6
|
-
import type { Application, ApplicationIntegrationTypeConfiguration, InstallParams } from "./types/application";
|
6
|
+
import type { ActivityInstance, Application, ApplicationIntegrationTypeConfiguration, InstallParams } from "./types/application";
|
7
7
|
import type { ApplicationCommand, GuildApplicationCommandPermissions, ApplicationCommandOption, ApplicationCommandPermission } from "./types/application-command";
|
8
8
|
import type { ApplicationRoleConnectionMetadata } from "./types/application-role-connection-metadata";
|
9
9
|
import type { AuditLog, AuditLogEntry } from "./types/audit-log";
|
@@ -12,7 +12,7 @@ import type { Channel, FollowedChannel, ThreadMember, Overwrite, DefaultReaction
|
|
12
12
|
import type { LocaleMap, snowflake, timestamp } from "./types/common";
|
13
13
|
import type { Emoji } from "./types/emoji";
|
14
14
|
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 } from "./types/gateway-events";
|
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
16
|
import type { Guild, GuildMember, WelcomeScreen, GuildWidgetSettings, Ban, Integration, GuildOnboarding, GuildPreview, GuildWidget, UnavailableGuild, OnboardingPrompt, WelcomeScreenChannel } from "./types/guild";
|
17
17
|
import type { GuildScheduledEvent, GuildScheduledEventUser, GuildScheduledEventEntityMetadata, GuildScheduledEventRecurrenceRule } from "./types/guild-scheduled-event";
|
18
18
|
import type { GuildTemplate } from "./types/guild-template";
|
@@ -29,6 +29,7 @@ import type { VoiceRegion, VoiceState } from "./types/voice";
|
|
29
29
|
import type { Webhook } from "./types/webhook";
|
30
30
|
import type { ClientOptions as WebSocketOptions } from "ws";
|
31
31
|
import type { Embed, AllowedMentions, Attachment, Message, MessageReference } from "./types/message";
|
32
|
+
import { Subscription } from "./types/subscription";
|
32
33
|
export interface GatewayOptions {
|
33
34
|
properties?: IdentifyConnectionProperties;
|
34
35
|
compress?: boolean;
|
@@ -124,7 +125,7 @@ export declare class Client extends EventEmitter {
|
|
124
125
|
}>): Promise<Array<ApplicationCommand>>;
|
125
126
|
/** https://discord.com/developers/docs/topics/gateway#connections */
|
126
127
|
connect(): Promise<void>;
|
127
|
-
/** https://discord.com/developers/docs/
|
128
|
+
/** https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement */
|
128
129
|
consumeEntitlement(applicationID: snowflake, entitlementID: snowflake): void;
|
129
130
|
/** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
|
130
131
|
createAutoModerationRule(guildID: snowflake, options: {
|
@@ -331,7 +332,7 @@ export declare class Client extends EventEmitter {
|
|
331
332
|
sendStartNotifications?: boolean;
|
332
333
|
guildScheduledEventID?: snowflake;
|
333
334
|
}, reason?: string): Promise<StageInstance>;
|
334
|
-
/** https://discord.com/developers/docs/
|
335
|
+
/** https://discord.com/developers/docs/resources/entitlement#create-test-entitlement */
|
335
336
|
createTestEntitlement(applicationID: snowflake, options: {
|
336
337
|
skuID: snowflake;
|
337
338
|
ownerID: snowflake;
|
@@ -608,7 +609,7 @@ export declare class Client extends EventEmitter {
|
|
608
609
|
entityType?: GuildScheduledEventEntityTypes;
|
609
610
|
status?: GuildScheduledEventStatus;
|
610
611
|
image?: string;
|
611
|
-
recurrenceRule?: GuildScheduledEventRecurrenceRule;
|
612
|
+
recurrenceRule?: GuildScheduledEventRecurrenceRule | null;
|
612
613
|
}, reason?: string): Promise<GuildScheduledEvent>;
|
613
614
|
/** https://discord.com/developers/docs/resources/sticker#modify-guild-sticker */
|
614
615
|
editGuildSticker(guildID: snowflake, stickerID: snowflake, options: {
|
@@ -655,6 +656,7 @@ export declare class Client extends EventEmitter {
|
|
655
656
|
components?: Array<ActionRow> | null;
|
656
657
|
files?: Array<File> | null;
|
657
658
|
attachments?: Array<Partial<Attachment>> | null;
|
659
|
+
poll?: PollCreateParams | null;
|
658
660
|
threadID?: snowflake;
|
659
661
|
}): Promise<Message>;
|
660
662
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response */
|
@@ -665,6 +667,7 @@ export declare class Client extends EventEmitter {
|
|
665
667
|
components?: Array<ActionRow> | null;
|
666
668
|
files?: Array<File> | null;
|
667
669
|
attachments?: Array<Partial<Attachment>> | null;
|
670
|
+
poll?: PollCreateParams | null;
|
668
671
|
threadID?: snowflake;
|
669
672
|
}): Promise<Message>;
|
670
673
|
/** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
|
@@ -686,6 +689,7 @@ export declare class Client extends EventEmitter {
|
|
686
689
|
components?: Array<ActionRow> | null;
|
687
690
|
files?: Array<File> | null;
|
688
691
|
attachments?: Array<Partial<Attachment>> | null;
|
692
|
+
poll?: PollCreateParams | null;
|
689
693
|
threadID?: snowflake;
|
690
694
|
}): Promise<Message>;
|
691
695
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
|
@@ -752,6 +756,8 @@ export declare class Client extends EventEmitter {
|
|
752
756
|
getAutoModerationRule(guildID: snowflake, ruleID: snowflake): Promise<AutoModerationRule>;
|
753
757
|
/** https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild */
|
754
758
|
getAutoModerationRules(guildID: snowflake): Promise<Array<AutoModerationRule>>;
|
759
|
+
/** https://discord.com/developers/docs/interactions/application-commands#get-application-activity-instance */
|
760
|
+
getApplicationActivityInstance(applicationID: snowflake, instanceID: string): Promise<ActivityInstance>;
|
755
761
|
/** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
|
756
762
|
getApplicationCommandPermissions(applicationID: snowflake, guildID: snowflake, commandID: snowflake): Promise<GuildApplicationCommandPermissions>;
|
757
763
|
/** https://discord.com/developers/docs/resources/emoji#get-application-emoji */
|
@@ -780,7 +786,7 @@ export declare class Client extends EventEmitter {
|
|
780
786
|
getCurrentUserConnections(): Promise<Array<Connection>>;
|
781
787
|
/** https://discord.com/developers/docs/resources/voice#get-current-user-voice-state */
|
782
788
|
getCurrentUserVoiceState(guildID: snowflake): Promise<VoiceState>;
|
783
|
-
/** https://discord.com/developers/docs/
|
789
|
+
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
784
790
|
getEntitlements(applicationID: snowflake, options?: {
|
785
791
|
userID?: snowflake;
|
786
792
|
skuIDs?: Array<snowflake>;
|
@@ -861,6 +867,8 @@ export declare class Client extends EventEmitter {
|
|
861
867
|
}): Promise<{
|
862
868
|
pruned: number;
|
863
869
|
}>;
|
870
|
+
/** https://discord.com/developers/docs/resources/guild#get-guild-role */
|
871
|
+
getGuildRole(guildID: snowflake, roleID: snowflake): Promise<Role>;
|
864
872
|
/** https://discord.com/developers/docs/resources/guild#get-guild-roles */
|
865
873
|
getGuildRoles(guildID: snowflake): Promise<Array<Role>>;
|
866
874
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild */
|
@@ -955,10 +963,21 @@ export declare class Client extends EventEmitter {
|
|
955
963
|
}): Promise<{
|
956
964
|
users: Array<User>;
|
957
965
|
}>;
|
958
|
-
/** https://discord.com/developers/docs/
|
966
|
+
/** https://discord.com/developers/docs/resources/sku#list-skus */
|
959
967
|
getSKUs(applicationID: snowflake): Promise<Array<SKU>>;
|
968
|
+
/** https://discord.com/developers/docs/resources/subscription#get-sku-subscription */
|
969
|
+
getSKUSubscription(skuID: snowflake, subscriptionID: snowflake): Promise<Subscription>;
|
970
|
+
/** https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions */
|
971
|
+
getSKUSubscriptions(skuID: snowflake, options: {
|
972
|
+
before?: snowflake;
|
973
|
+
after?: snowflake;
|
974
|
+
limit?: number;
|
975
|
+
userID?: snowflake;
|
976
|
+
}): Promise<Array<Subscription>>;
|
960
977
|
/** https://discord.com/developers/docs/resources/stage-instance#get-stage-instance */
|
961
978
|
getStageInstance(channelID: snowflake): Promise<StageInstance>;
|
979
|
+
/** https://discord.com/developers/docs/resources/sticker#get-sticker-pack */
|
980
|
+
getStickerPack(packID: snowflake): Promise<StickerPack>;
|
962
981
|
/** https://discord.com/developers/docs/resources/sticker#list-sticker-packs */
|
963
982
|
getStickerPacks(): Promise<{
|
964
983
|
stickerPacks: Array<StickerPack>;
|
@@ -1133,8 +1152,12 @@ export interface ClientEvents {
|
|
1133
1152
|
stageInstanceCreate: [stageInstance: StageInstance];
|
1134
1153
|
stageInstanceUpdate: [stageInstance: StageInstance];
|
1135
1154
|
stageInstanceDelete: [stageInstance: StageInstance];
|
1155
|
+
subscriptionCreate: [subscription: Subscription];
|
1156
|
+
subscriptionUpdate: [subscription: Subscription];
|
1157
|
+
subscriptionDelete: [subscription: Subscription];
|
1136
1158
|
typingStart: [typing: TypingStartEventFields];
|
1137
1159
|
userUpdate: [user: User];
|
1160
|
+
voiceChannelEffectSend: [voiceEffect: VoiceChannelEffectSendEventFields];
|
1138
1161
|
voiceStateUpdate: [voiceState: VoiceState];
|
1139
1162
|
voiceServerUpdate: [voiceServer: VoiceServerUpdateEventFields];
|
1140
1163
|
webhooksUpdate: [channelID: snowflake, guildID: snowflake];
|
package/dist/lib/Client.js
CHANGED
@@ -160,7 +160,7 @@ class Client extends node_events_1.default {
|
|
160
160
|
this.shards.set(i, new gateway_1.Shard(i, this));
|
161
161
|
this.shards.forEach((shard) => shard.connect());
|
162
162
|
}
|
163
|
-
/** https://discord.com/developers/docs/
|
163
|
+
/** https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement */
|
164
164
|
consumeEntitlement(applicationID, entitlementID) {
|
165
165
|
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlementConsume(applicationID, entitlementID));
|
166
166
|
}
|
@@ -636,7 +636,7 @@ class Client extends node_events_1.default {
|
|
636
636
|
});
|
637
637
|
return transformers_1.StageInstances.stageInstanceFromRaw(response);
|
638
638
|
}
|
639
|
-
/** https://discord.com/developers/docs/
|
639
|
+
/** https://discord.com/developers/docs/resources/entitlement#create-test-entitlement */
|
640
640
|
async createTestEntitlement(applicationID, options) {
|
641
641
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlements(applicationID), {
|
642
642
|
json: {
|
@@ -1159,7 +1159,9 @@ class Client extends node_events_1.default {
|
|
1159
1159
|
status: options.status,
|
1160
1160
|
image: options.image,
|
1161
1161
|
recurrence_rule: options.recurrenceRule !== undefined
|
1162
|
-
?
|
1162
|
+
? options.recurrenceRule !== null
|
1163
|
+
? transformers_1.GuildScheduledEvents.guildScheduledEventRecurrenceRuleToRaw(options.recurrenceRule)
|
1164
|
+
: null
|
1163
1165
|
: undefined,
|
1164
1166
|
},
|
1165
1167
|
reason,
|
@@ -1307,6 +1309,20 @@ class Client extends node_events_1.default {
|
|
1307
1309
|
waveform: attachment.waveform,
|
1308
1310
|
flags: attachment.flags,
|
1309
1311
|
})),
|
1312
|
+
poll: options.poll !== undefined
|
1313
|
+
? options.poll !== null
|
1314
|
+
? {
|
1315
|
+
question: options.poll.question,
|
1316
|
+
answers: options.poll.answers.map((answer) => ({
|
1317
|
+
answer_id: answer.answerID,
|
1318
|
+
poll_media: answer.pollMedia,
|
1319
|
+
})),
|
1320
|
+
duration: options.poll.duration,
|
1321
|
+
allow_multiselect: options.poll.allowMultiselect,
|
1322
|
+
layout_type: options.poll.layoutType,
|
1323
|
+
}
|
1324
|
+
: null
|
1325
|
+
: undefined,
|
1310
1326
|
},
|
1311
1327
|
files: options.files,
|
1312
1328
|
query: {
|
@@ -1354,6 +1370,20 @@ class Client extends node_events_1.default {
|
|
1354
1370
|
waveform: attachment.waveform,
|
1355
1371
|
flags: attachment.flags,
|
1356
1372
|
})),
|
1373
|
+
poll: options.poll !== undefined
|
1374
|
+
? options.poll !== null
|
1375
|
+
? {
|
1376
|
+
question: options.poll.question,
|
1377
|
+
answers: options.poll.answers.map((answer) => ({
|
1378
|
+
answer_id: answer.answerID,
|
1379
|
+
poll_media: answer.pollMedia,
|
1380
|
+
})),
|
1381
|
+
duration: options.poll.duration,
|
1382
|
+
allow_multiselect: options.poll.allowMultiselect,
|
1383
|
+
layout_type: options.poll.layoutType,
|
1384
|
+
}
|
1385
|
+
: null
|
1386
|
+
: undefined,
|
1357
1387
|
},
|
1358
1388
|
files: options.files,
|
1359
1389
|
query: {
|
@@ -1422,6 +1452,20 @@ class Client extends node_events_1.default {
|
|
1422
1452
|
waveform: attachment.waveform,
|
1423
1453
|
flags: attachment.flags,
|
1424
1454
|
})),
|
1455
|
+
poll: options.poll !== undefined
|
1456
|
+
? options.poll !== null
|
1457
|
+
? {
|
1458
|
+
question: options.poll.question,
|
1459
|
+
answers: options.poll.answers.map((answer) => ({
|
1460
|
+
answer_id: answer.answerID,
|
1461
|
+
poll_media: answer.pollMedia,
|
1462
|
+
})),
|
1463
|
+
duration: options.poll.duration,
|
1464
|
+
allow_multiselect: options.poll.allowMultiselect,
|
1465
|
+
layout_type: options.poll.layoutType,
|
1466
|
+
}
|
1467
|
+
: null
|
1468
|
+
: undefined,
|
1425
1469
|
},
|
1426
1470
|
files: options.files,
|
1427
1471
|
query: {
|
@@ -1565,6 +1609,22 @@ class Client extends node_events_1.default {
|
|
1565
1609
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRules(guildID));
|
1566
1610
|
return response.map((autoModerationRule) => transformers_1.AutoModeration.autoModerationRuleFromRaw(autoModerationRule));
|
1567
1611
|
}
|
1612
|
+
/** https://discord.com/developers/docs/interactions/application-commands#get-application-activity-instance */
|
1613
|
+
async getApplicationActivityInstance(applicationID, instanceID) {
|
1614
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationActivityInstance(applicationID, instanceID));
|
1615
|
+
return {
|
1616
|
+
applicationID: response.application_id,
|
1617
|
+
instanceID: response.instance_id,
|
1618
|
+
launchID: response.launch_id,
|
1619
|
+
location: {
|
1620
|
+
id: response.location.id,
|
1621
|
+
kind: response.location.kind,
|
1622
|
+
channelID: response.location.channel_id,
|
1623
|
+
guildID: response.location.guild_id,
|
1624
|
+
},
|
1625
|
+
users: response.users,
|
1626
|
+
};
|
1627
|
+
}
|
1568
1628
|
/** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
|
1569
1629
|
async getApplicationCommandPermissions(applicationID, guildID, commandID) {
|
1570
1630
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommandPermissions(applicationID, guildID, commandID));
|
@@ -1647,7 +1707,7 @@ class Client extends node_events_1.default {
|
|
1647
1707
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceState(guildID));
|
1648
1708
|
return transformers_1.Voice.voiceStateFromRaw(response);
|
1649
1709
|
}
|
1650
|
-
/** https://discord.com/developers/docs/
|
1710
|
+
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
1651
1711
|
async getEntitlements(applicationID, options) {
|
1652
1712
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(applicationID), {
|
1653
1713
|
query: {
|
@@ -1853,6 +1913,11 @@ class Client extends node_events_1.default {
|
|
1853
1913
|
},
|
1854
1914
|
});
|
1855
1915
|
}
|
1916
|
+
/** https://discord.com/developers/docs/resources/guild#get-guild-role */
|
1917
|
+
async getGuildRole(guildID, roleID) {
|
1918
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildRole(guildID, roleID));
|
1919
|
+
return transformers_1.Roles.roleFromRaw(response);
|
1920
|
+
}
|
1856
1921
|
/** https://discord.com/developers/docs/resources/guild#get-guild-roles */
|
1857
1922
|
async getGuildRoles(guildID) {
|
1858
1923
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildRoles(guildID));
|
@@ -2066,16 +2131,46 @@ class Client extends node_events_1.default {
|
|
2066
2131
|
users: response.users.map((user) => transformers_1.Users.userFromRaw(user)),
|
2067
2132
|
};
|
2068
2133
|
}
|
2069
|
-
/** https://discord.com/developers/docs/
|
2134
|
+
/** https://discord.com/developers/docs/resources/sku#list-skus */
|
2070
2135
|
async getSKUs(applicationID) {
|
2071
2136
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationSKUs(applicationID));
|
2072
2137
|
return response.map((sku) => transformers_1.SKUs.skuFromRaw(sku));
|
2073
2138
|
}
|
2139
|
+
/** https://discord.com/developers/docs/resources/subscription#get-sku-subscription */
|
2140
|
+
async getSKUSubscription(skuID, subscriptionID) {
|
2141
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.skuSubscription(skuID, subscriptionID));
|
2142
|
+
return transformers_1.Subscriptions.subscriptionFromRaw(response);
|
2143
|
+
}
|
2144
|
+
/** https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions */
|
2145
|
+
async getSKUSubscriptions(skuID, options) {
|
2146
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.skuSubscriptions(skuID), {
|
2147
|
+
query: {
|
2148
|
+
before: options.before,
|
2149
|
+
after: options.after,
|
2150
|
+
limit: options.limit,
|
2151
|
+
user_id: options.userID,
|
2152
|
+
},
|
2153
|
+
});
|
2154
|
+
return response.map((subscription) => transformers_1.Subscriptions.subscriptionFromRaw(subscription));
|
2155
|
+
}
|
2074
2156
|
/** https://discord.com/developers/docs/resources/stage-instance#get-stage-instance */
|
2075
2157
|
async getStageInstance(channelID) {
|
2076
2158
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stageInstance(channelID));
|
2077
2159
|
return transformers_1.StageInstances.stageInstanceFromRaw(response);
|
2078
2160
|
}
|
2161
|
+
/** https://discord.com/developers/docs/resources/sticker#get-sticker-pack */
|
2162
|
+
async getStickerPack(packID) {
|
2163
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stickerPack(packID));
|
2164
|
+
return {
|
2165
|
+
id: response.id,
|
2166
|
+
stickers: response.stickers.map((sticker) => transformers_1.Stickers.stickerFromRaw(sticker)),
|
2167
|
+
name: response.name,
|
2168
|
+
skuID: response.sku_id,
|
2169
|
+
coverStickerID: response.cover_sticker_id,
|
2170
|
+
description: response.description,
|
2171
|
+
bannerAssetID: response.banner_asset_id,
|
2172
|
+
};
|
2173
|
+
}
|
2079
2174
|
/** https://discord.com/developers/docs/resources/sticker#list-sticker-packs */
|
2080
2175
|
async getStickerPacks() {
|
2081
2176
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stickerPacks());
|
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 {
|
@@ -152,6 +153,11 @@ export declare enum ApplicationFlags {
|
|
152
153
|
GatewayMessageContentLimited = 524288,
|
153
154
|
ApplicationCommandBadge = 8388608
|
154
155
|
}
|
156
|
+
/** https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-location-kind-enum */
|
157
|
+
export declare enum ActivityLocationKind {
|
158
|
+
GuildChannel = "gc",
|
159
|
+
PrivateChannel = "pc"
|
160
|
+
}
|
155
161
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type */
|
156
162
|
export declare enum ApplicationRoleConnectionMetadataType {
|
157
163
|
IntegerLessThanOrEqual = 1,
|
@@ -382,7 +388,12 @@ export declare enum GuildMemberFlags {
|
|
382
388
|
DidRejoin = 1,
|
383
389
|
CompletedOnboarding = 2,
|
384
390
|
BypassesVerification = 4,
|
385
|
-
StartedOnboarding = 8
|
391
|
+
StartedOnboarding = 8,
|
392
|
+
IsGuest = 16,
|
393
|
+
StartedHomeActions = 32,
|
394
|
+
CompletedHomeActions = 64,
|
395
|
+
AutomodQuarantinedUsername = 128,
|
396
|
+
DMSettingsUpsellAckownledge = 512
|
386
397
|
}
|
387
398
|
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors */
|
388
399
|
export declare enum IntegrationExpireBehaviors {
|
@@ -504,7 +515,8 @@ export declare enum MessageTypes {
|
|
504
515
|
GuildIncidentAlertModeDisabled = 37,
|
505
516
|
GuildIncidentReportRaid = 38,
|
506
517
|
GuildIncidentReportFalseAlarm = 39,
|
507
|
-
PurchaseNotification = 44
|
518
|
+
PurchaseNotification = 44,
|
519
|
+
PollResult = 46
|
508
520
|
}
|
509
521
|
/** https://discord.com/developers/docs/resources/message#message-object-message-activity-types */
|
510
522
|
export declare enum MessageActivityTypes {
|
@@ -532,6 +544,16 @@ export declare enum MessageReferenceTypes {
|
|
532
544
|
Default = 0,
|
533
545
|
Forward = 1
|
534
546
|
}
|
547
|
+
/** https://discord.com/developers/docs/resources/message#embed-object-embed-types */
|
548
|
+
export declare enum EmbedTypes {
|
549
|
+
Rich = "rich",
|
550
|
+
Image = "image",
|
551
|
+
Video = "video",
|
552
|
+
Gifv = "gifv",
|
553
|
+
Article = "article",
|
554
|
+
Link = "link",
|
555
|
+
PollResult = "poll_result"
|
556
|
+
}
|
535
557
|
/** https://discord.com/developers/docs/resources/message#attachment-object-attachment-flags */
|
536
558
|
export declare enum AttachmentFlags {
|
537
559
|
IsRemix = 4
|
@@ -595,6 +617,7 @@ export declare enum PremiumTypes {
|
|
595
617
|
}
|
596
618
|
/** https://discord.com/developers/docs/resources/user#connection-object-services */
|
597
619
|
export declare enum Services {
|
620
|
+
AmazonMusic = "amazon-music",
|
598
621
|
BattleNet = "battlenet",
|
599
622
|
Ebay = "ebay",
|
600
623
|
EpicGames = "epicgames",
|
@@ -621,6 +644,12 @@ export declare enum VisibilityTypes {
|
|
621
644
|
None = 0,
|
622
645
|
Everyone = 1
|
623
646
|
}
|
647
|
+
/** https://discord.com/developers/docs/resources/subscription#subscription-statuses */
|
648
|
+
export declare enum SubscriptionStatuses {
|
649
|
+
Active = 0,
|
650
|
+
Ending = 1,
|
651
|
+
Inactive = 2
|
652
|
+
}
|
624
653
|
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */
|
625
654
|
export declare enum WebhookTypes {
|
626
655
|
Incoming = 1,
|
@@ -729,8 +758,12 @@ export declare enum GatewayEvents {
|
|
729
758
|
StageInstanceCreate = "STAGE_INSTANCE_CREATE",
|
730
759
|
StageInstanceUpdate = "STAGE_INSTANCE_UPDATE",
|
731
760
|
StageInstanceDelete = "STAGE_INSTANCE_DELETE",
|
761
|
+
SubscriptionCreate = "SUBSCRIPTION_CREATE",
|
762
|
+
SubscriptionUpdate = "SUBSCRIPTION_UPDATE",
|
763
|
+
SubscriptionDelete = "SUBSCRIPTION_DELETE",
|
732
764
|
TypingStart = "TYPING_START",
|
733
765
|
UserUpdate = "USER_UPDATE",
|
766
|
+
VoiceChannelEffectSend = "VOICE_CHANNEL_EFFECT_SEND",
|
734
767
|
VoiceStateUpdate = "VOICE_STATE_UPDATE",
|
735
768
|
VoiceServerUpdate = "VOICE_SERVER_UPDATE",
|
736
769
|
WebhooksUpdate = "WEBHOOKS_UPDATE",
|
@@ -758,6 +791,11 @@ export declare enum ActivityFlags {
|
|
758
791
|
PartyPrivacyVoiceChannel = 128,
|
759
792
|
Embedded = 256
|
760
793
|
}
|
794
|
+
/** https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types */
|
795
|
+
export declare enum AnimationTypes {
|
796
|
+
Premium = 0,
|
797
|
+
Basic = 1
|
798
|
+
}
|
761
799
|
/** https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes */
|
762
800
|
export declare enum OAuth2Scopes {
|
763
801
|
ActivitiesRead = "activities.read",
|
@@ -898,6 +936,7 @@ export declare enum JSONErrorCodes {
|
|
898
936
|
UnknownGuildTemplate = 10057,
|
899
937
|
UnknownDiscoverableServerCategory = 10059,
|
900
938
|
UnknownSticker = 10060,
|
939
|
+
UnknownStickerPack = 10061,
|
901
940
|
UnknownInteraction = 10062,
|
902
941
|
UnknownApplicationCommand = 10063,
|
903
942
|
UnknownVoiceState = 10065,
|
@@ -962,6 +1001,8 @@ export declare enum JSONErrorCodes {
|
|
962
1001
|
FeatureTemporarilyDisabledServerSide = 40006,
|
963
1002
|
UserBannedFromThisGuild = 40007,
|
964
1003
|
ConnectionHasBeenRevoked = 40012,
|
1004
|
+
OnlyConsumableSKUsCanBeConsumed = 40018,
|
1005
|
+
YouCanOnlyDeleteSandboxEntitlements = 40019,
|
965
1006
|
TargetUserIsNotConnectedToVoice = 40032,
|
966
1007
|
ThisMessageWasAlreadyCrossposted = 40033,
|
967
1008
|
ApplicationCommandWithThatNameAlreadyExists = 40041,
|
@@ -973,6 +1014,7 @@ export declare enum JSONErrorCodes {
|
|
973
1014
|
ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066,
|
974
1015
|
TagRequiredToCreateAForumPostInThisChannel = 40067,
|
975
1016
|
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40074,
|
1017
|
+
ThisInteractionHasHitTheMaximumNumberOfFollowUpMessages = 40094,
|
976
1018
|
CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent = 40333,
|
977
1019
|
MissingAccess = 50001,
|
978
1020
|
InvalidAccountType = 50002,
|
@@ -1174,20 +1216,20 @@ export declare enum MembershipState {
|
|
1174
1216
|
Invited = 1,
|
1175
1217
|
Accepted = 2
|
1176
1218
|
}
|
1177
|
-
/** https://discord.com/developers/docs/
|
1219
|
+
/** https://discord.com/developers/docs/resources/sku#sku-object-sku-types */
|
1178
1220
|
export declare enum SKUTypes {
|
1179
1221
|
Durable = 2,
|
1180
1222
|
Consumable = 3,
|
1181
1223
|
Subscription = 5,
|
1182
1224
|
SubscriptionGroup = 6
|
1183
1225
|
}
|
1184
|
-
/** https://discord.com/developers/docs/
|
1226
|
+
/** https://discord.com/developers/docs/resources/sku#sku-object-sku-flags */
|
1185
1227
|
export declare enum SKUFlags {
|
1186
1228
|
Available = 4,
|
1187
1229
|
GuildSubscription = 128,
|
1188
1230
|
UserSubscription = 256
|
1189
1231
|
}
|
1190
|
-
/** https://discord.com/developers/docs/
|
1232
|
+
/** https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-types */
|
1191
1233
|
export declare enum EntitlementTypes {
|
1192
1234
|
Purchase = 1,
|
1193
1235
|
PremiumSubscription = 2,
|
package/dist/lib/constants.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
exports.EntitlementTypes = exports.SKUFlags = exports.SKUTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.ReactionTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.MessageReferenceTypes = exports.MessageFlags = void 0;
|
3
|
+
exports.MessageTypes = exports.InviteTargetTypes = exports.InviteTypes = exports.GuildScheduledEventRecurrenceRuleMonth = exports.GuildScheduledEventRecurrenceRuleWeekday = exports.GuildScheduledEventRecurrenceRuleFrequency = exports.GuildScheduledEventStatus = exports.GuildScheduledEventEntityTypes = exports.GuildScheduledEventPrivacyLevel = exports.ImageWidgetStyleOptions = exports.PromptTypes = exports.OnboardingMode = exports.IntegrationExpireBehaviors = exports.GuildMemberFlags = exports.MutableGuildFeatures = exports.GuildFeatures = exports.SystemChannelFlags = exports.PremiumTier = exports.GuildNSFWLevel = exports.VerificationLevel = exports.MFALevel = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ActivityLocationKind = exports.ApplicationFlags = exports.ApplicationIntegrationTypes = exports.TextInputStyles = exports.ButtonStyles = exports.InteractionCallbackType = exports.ComponentTypes = exports.InteractionContextTypes = exports.InteractionType = exports.ApplicationCommandPermissionType = exports.ApplicationCommandOptionType = exports.ApplicationCommandTypes = exports.Locales = exports.ImageFormats = exports.GuildNavigationTypes = exports.TimestampStyles = void 0;
|
4
|
+
exports.EntitlementTypes = exports.SKUFlags = exports.SKUTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.AnimationTypes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.SubscriptionStatuses = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.ReactionTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.EmbedTypes = exports.MessageReferenceTypes = exports.MessageFlags = exports.MessageActivityTypes = void 0;
|
5
5
|
/** https://discord.com/developers/docs/reference#message-formatting-timestamp-styles */
|
6
6
|
var TimestampStyles;
|
7
7
|
(function (TimestampStyles) {
|
@@ -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;
|
@@ -171,6 +172,12 @@ var ApplicationFlags;
|
|
171
172
|
ApplicationFlags[ApplicationFlags["GatewayMessageContentLimited"] = 524288] = "GatewayMessageContentLimited";
|
172
173
|
ApplicationFlags[ApplicationFlags["ApplicationCommandBadge"] = 8388608] = "ApplicationCommandBadge";
|
173
174
|
})(ApplicationFlags || (exports.ApplicationFlags = ApplicationFlags = {}));
|
175
|
+
/** https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-location-kind-enum */
|
176
|
+
var ActivityLocationKind;
|
177
|
+
(function (ActivityLocationKind) {
|
178
|
+
ActivityLocationKind["GuildChannel"] = "gc";
|
179
|
+
ActivityLocationKind["PrivateChannel"] = "pc";
|
180
|
+
})(ActivityLocationKind || (exports.ActivityLocationKind = ActivityLocationKind = {}));
|
174
181
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type */
|
175
182
|
var ApplicationRoleConnectionMetadataType;
|
176
183
|
(function (ApplicationRoleConnectionMetadataType) {
|
@@ -423,6 +430,11 @@ var GuildMemberFlags;
|
|
423
430
|
GuildMemberFlags[GuildMemberFlags["CompletedOnboarding"] = 2] = "CompletedOnboarding";
|
424
431
|
GuildMemberFlags[GuildMemberFlags["BypassesVerification"] = 4] = "BypassesVerification";
|
425
432
|
GuildMemberFlags[GuildMemberFlags["StartedOnboarding"] = 8] = "StartedOnboarding";
|
433
|
+
GuildMemberFlags[GuildMemberFlags["IsGuest"] = 16] = "IsGuest";
|
434
|
+
GuildMemberFlags[GuildMemberFlags["StartedHomeActions"] = 32] = "StartedHomeActions";
|
435
|
+
GuildMemberFlags[GuildMemberFlags["CompletedHomeActions"] = 64] = "CompletedHomeActions";
|
436
|
+
GuildMemberFlags[GuildMemberFlags["AutomodQuarantinedUsername"] = 128] = "AutomodQuarantinedUsername";
|
437
|
+
GuildMemberFlags[GuildMemberFlags["DMSettingsUpsellAckownledge"] = 512] = "DMSettingsUpsellAckownledge";
|
426
438
|
})(GuildMemberFlags || (exports.GuildMemberFlags = GuildMemberFlags = {}));
|
427
439
|
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors */
|
428
440
|
var IntegrationExpireBehaviors;
|
@@ -558,6 +570,7 @@ var MessageTypes;
|
|
558
570
|
MessageTypes[MessageTypes["GuildIncidentReportRaid"] = 38] = "GuildIncidentReportRaid";
|
559
571
|
MessageTypes[MessageTypes["GuildIncidentReportFalseAlarm"] = 39] = "GuildIncidentReportFalseAlarm";
|
560
572
|
MessageTypes[MessageTypes["PurchaseNotification"] = 44] = "PurchaseNotification";
|
573
|
+
MessageTypes[MessageTypes["PollResult"] = 46] = "PollResult";
|
561
574
|
})(MessageTypes || (exports.MessageTypes = MessageTypes = {}));
|
562
575
|
/** https://discord.com/developers/docs/resources/message#message-object-message-activity-types */
|
563
576
|
var MessageActivityTypes;
|
@@ -588,6 +601,17 @@ var MessageReferenceTypes;
|
|
588
601
|
MessageReferenceTypes[MessageReferenceTypes["Default"] = 0] = "Default";
|
589
602
|
MessageReferenceTypes[MessageReferenceTypes["Forward"] = 1] = "Forward";
|
590
603
|
})(MessageReferenceTypes || (exports.MessageReferenceTypes = MessageReferenceTypes = {}));
|
604
|
+
/** https://discord.com/developers/docs/resources/message#embed-object-embed-types */
|
605
|
+
var EmbedTypes;
|
606
|
+
(function (EmbedTypes) {
|
607
|
+
EmbedTypes["Rich"] = "rich";
|
608
|
+
EmbedTypes["Image"] = "image";
|
609
|
+
EmbedTypes["Video"] = "video";
|
610
|
+
EmbedTypes["Gifv"] = "gifv";
|
611
|
+
EmbedTypes["Article"] = "article";
|
612
|
+
EmbedTypes["Link"] = "link";
|
613
|
+
EmbedTypes["PollResult"] = "poll_result";
|
614
|
+
})(EmbedTypes || (exports.EmbedTypes = EmbedTypes = {}));
|
591
615
|
/** https://discord.com/developers/docs/resources/message#attachment-object-attachment-flags */
|
592
616
|
var AttachmentFlags;
|
593
617
|
(function (AttachmentFlags) {
|
@@ -661,6 +685,7 @@ var PremiumTypes;
|
|
661
685
|
/** https://discord.com/developers/docs/resources/user#connection-object-services */
|
662
686
|
var Services;
|
663
687
|
(function (Services) {
|
688
|
+
Services["AmazonMusic"] = "amazon-music";
|
664
689
|
Services["BattleNet"] = "battlenet";
|
665
690
|
Services["Ebay"] = "ebay";
|
666
691
|
Services["EpicGames"] = "epicgames";
|
@@ -688,6 +713,13 @@ var VisibilityTypes;
|
|
688
713
|
VisibilityTypes[VisibilityTypes["None"] = 0] = "None";
|
689
714
|
VisibilityTypes[VisibilityTypes["Everyone"] = 1] = "Everyone";
|
690
715
|
})(VisibilityTypes || (exports.VisibilityTypes = VisibilityTypes = {}));
|
716
|
+
/** https://discord.com/developers/docs/resources/subscription#subscription-statuses */
|
717
|
+
var SubscriptionStatuses;
|
718
|
+
(function (SubscriptionStatuses) {
|
719
|
+
SubscriptionStatuses[SubscriptionStatuses["Active"] = 0] = "Active";
|
720
|
+
SubscriptionStatuses[SubscriptionStatuses["Ending"] = 1] = "Ending";
|
721
|
+
SubscriptionStatuses[SubscriptionStatuses["Inactive"] = 2] = "Inactive";
|
722
|
+
})(SubscriptionStatuses || (exports.SubscriptionStatuses = SubscriptionStatuses = {}));
|
691
723
|
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */
|
692
724
|
var WebhookTypes;
|
693
725
|
(function (WebhookTypes) {
|
@@ -801,8 +833,12 @@ var GatewayEvents;
|
|
801
833
|
GatewayEvents["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE";
|
802
834
|
GatewayEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE";
|
803
835
|
GatewayEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE";
|
836
|
+
GatewayEvents["SubscriptionCreate"] = "SUBSCRIPTION_CREATE";
|
837
|
+
GatewayEvents["SubscriptionUpdate"] = "SUBSCRIPTION_UPDATE";
|
838
|
+
GatewayEvents["SubscriptionDelete"] = "SUBSCRIPTION_DELETE";
|
804
839
|
GatewayEvents["TypingStart"] = "TYPING_START";
|
805
840
|
GatewayEvents["UserUpdate"] = "USER_UPDATE";
|
841
|
+
GatewayEvents["VoiceChannelEffectSend"] = "VOICE_CHANNEL_EFFECT_SEND";
|
806
842
|
GatewayEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE";
|
807
843
|
GatewayEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE";
|
808
844
|
GatewayEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE";
|
@@ -832,6 +868,12 @@ var ActivityFlags;
|
|
832
868
|
ActivityFlags[ActivityFlags["PartyPrivacyVoiceChannel"] = 128] = "PartyPrivacyVoiceChannel";
|
833
869
|
ActivityFlags[ActivityFlags["Embedded"] = 256] = "Embedded";
|
834
870
|
})(ActivityFlags || (exports.ActivityFlags = ActivityFlags = {}));
|
871
|
+
/** https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types */
|
872
|
+
var AnimationTypes;
|
873
|
+
(function (AnimationTypes) {
|
874
|
+
AnimationTypes[AnimationTypes["Premium"] = 0] = "Premium";
|
875
|
+
AnimationTypes[AnimationTypes["Basic"] = 1] = "Basic";
|
876
|
+
})(AnimationTypes || (exports.AnimationTypes = AnimationTypes = {}));
|
835
877
|
/** https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes */
|
836
878
|
var OAuth2Scopes;
|
837
879
|
(function (OAuth2Scopes) {
|
@@ -979,6 +1021,7 @@ var JSONErrorCodes;
|
|
979
1021
|
JSONErrorCodes[JSONErrorCodes["UnknownGuildTemplate"] = 10057] = "UnknownGuildTemplate";
|
980
1022
|
JSONErrorCodes[JSONErrorCodes["UnknownDiscoverableServerCategory"] = 10059] = "UnknownDiscoverableServerCategory";
|
981
1023
|
JSONErrorCodes[JSONErrorCodes["UnknownSticker"] = 10060] = "UnknownSticker";
|
1024
|
+
JSONErrorCodes[JSONErrorCodes["UnknownStickerPack"] = 10061] = "UnknownStickerPack";
|
982
1025
|
JSONErrorCodes[JSONErrorCodes["UnknownInteraction"] = 10062] = "UnknownInteraction";
|
983
1026
|
JSONErrorCodes[JSONErrorCodes["UnknownApplicationCommand"] = 10063] = "UnknownApplicationCommand";
|
984
1027
|
JSONErrorCodes[JSONErrorCodes["UnknownVoiceState"] = 10065] = "UnknownVoiceState";
|
@@ -1043,6 +1086,8 @@ var JSONErrorCodes;
|
|
1043
1086
|
JSONErrorCodes[JSONErrorCodes["FeatureTemporarilyDisabledServerSide"] = 40006] = "FeatureTemporarilyDisabledServerSide";
|
1044
1087
|
JSONErrorCodes[JSONErrorCodes["UserBannedFromThisGuild"] = 40007] = "UserBannedFromThisGuild";
|
1045
1088
|
JSONErrorCodes[JSONErrorCodes["ConnectionHasBeenRevoked"] = 40012] = "ConnectionHasBeenRevoked";
|
1089
|
+
JSONErrorCodes[JSONErrorCodes["OnlyConsumableSKUsCanBeConsumed"] = 40018] = "OnlyConsumableSKUsCanBeConsumed";
|
1090
|
+
JSONErrorCodes[JSONErrorCodes["YouCanOnlyDeleteSandboxEntitlements"] = 40019] = "YouCanOnlyDeleteSandboxEntitlements";
|
1046
1091
|
JSONErrorCodes[JSONErrorCodes["TargetUserIsNotConnectedToVoice"] = 40032] = "TargetUserIsNotConnectedToVoice";
|
1047
1092
|
JSONErrorCodes[JSONErrorCodes["ThisMessageWasAlreadyCrossposted"] = 40033] = "ThisMessageWasAlreadyCrossposted";
|
1048
1093
|
JSONErrorCodes[JSONErrorCodes["ApplicationCommandWithThatNameAlreadyExists"] = 40041] = "ApplicationCommandWithThatNameAlreadyExists";
|
@@ -1054,6 +1099,7 @@ var JSONErrorCodes;
|
|
1054
1099
|
JSONErrorCodes[JSONErrorCodes["ThereAreNoTagsAvailableThatCanBeSetByNonModerators"] = 40066] = "ThereAreNoTagsAvailableThatCanBeSetByNonModerators";
|
1055
1100
|
JSONErrorCodes[JSONErrorCodes["TagRequiredToCreateAForumPostInThisChannel"] = 40067] = "TagRequiredToCreateAForumPostInThisChannel";
|
1056
1101
|
JSONErrorCodes[JSONErrorCodes["AnEntitlementHasAlreadyBeenGrantedForThisResource"] = 40074] = "AnEntitlementHasAlreadyBeenGrantedForThisResource";
|
1102
|
+
JSONErrorCodes[JSONErrorCodes["ThisInteractionHasHitTheMaximumNumberOfFollowUpMessages"] = 40094] = "ThisInteractionHasHitTheMaximumNumberOfFollowUpMessages";
|
1057
1103
|
JSONErrorCodes[JSONErrorCodes["CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent"] = 40333] = "CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent";
|
1058
1104
|
JSONErrorCodes[JSONErrorCodes["MissingAccess"] = 50001] = "MissingAccess";
|
1059
1105
|
JSONErrorCodes[JSONErrorCodes["InvalidAccountType"] = 50002] = "InvalidAccountType";
|
@@ -1260,7 +1306,7 @@ var MembershipState;
|
|
1260
1306
|
MembershipState[MembershipState["Invited"] = 1] = "Invited";
|
1261
1307
|
MembershipState[MembershipState["Accepted"] = 2] = "Accepted";
|
1262
1308
|
})(MembershipState || (exports.MembershipState = MembershipState = {}));
|
1263
|
-
/** https://discord.com/developers/docs/
|
1309
|
+
/** https://discord.com/developers/docs/resources/sku#sku-object-sku-types */
|
1264
1310
|
var SKUTypes;
|
1265
1311
|
(function (SKUTypes) {
|
1266
1312
|
SKUTypes[SKUTypes["Durable"] = 2] = "Durable";
|
@@ -1268,14 +1314,14 @@ var SKUTypes;
|
|
1268
1314
|
SKUTypes[SKUTypes["Subscription"] = 5] = "Subscription";
|
1269
1315
|
SKUTypes[SKUTypes["SubscriptionGroup"] = 6] = "SubscriptionGroup";
|
1270
1316
|
})(SKUTypes || (exports.SKUTypes = SKUTypes = {}));
|
1271
|
-
/** https://discord.com/developers/docs/
|
1317
|
+
/** https://discord.com/developers/docs/resources/sku#sku-object-sku-flags */
|
1272
1318
|
var SKUFlags;
|
1273
1319
|
(function (SKUFlags) {
|
1274
1320
|
SKUFlags[SKUFlags["Available"] = 4] = "Available";
|
1275
1321
|
SKUFlags[SKUFlags["GuildSubscription"] = 128] = "GuildSubscription";
|
1276
1322
|
SKUFlags[SKUFlags["UserSubscription"] = 256] = "UserSubscription";
|
1277
1323
|
})(SKUFlags || (exports.SKUFlags = SKUFlags = {}));
|
1278
|
-
/** https://discord.com/developers/docs/
|
1324
|
+
/** https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-types */
|
1279
1325
|
var EntitlementTypes;
|
1280
1326
|
(function (EntitlementTypes) {
|
1281
1327
|
EntitlementTypes[EntitlementTypes["Purchase"] = 1] = "Purchase";
|
@@ -464,6 +464,20 @@ class Shard {
|
|
464
464
|
case constants_1.GatewayEvents.UserUpdate:
|
465
465
|
this.client.emit("userUpdate", transformers_1.Users.userFromRaw(packet.d));
|
466
466
|
break;
|
467
|
+
case constants_1.GatewayEvents.VoiceChannelEffectSend:
|
468
|
+
this.client.emit("voiceChannelEffectSend", {
|
469
|
+
channelID: packet.d.channel_id,
|
470
|
+
guildID: packet.d.guild_id,
|
471
|
+
userID: packet.d.user_id,
|
472
|
+
emoji: packet.d.emoji !== null
|
473
|
+
? transformers_1.Emojis.emojiFromRaw(packet.d.emoji)
|
474
|
+
: null,
|
475
|
+
animationType: packet.d.animation_type,
|
476
|
+
animationID: packet.d.animation_id,
|
477
|
+
soundID: packet.d.sound_id,
|
478
|
+
soundVolume: packet.d.sound_volume,
|
479
|
+
});
|
480
|
+
break;
|
467
481
|
case constants_1.GatewayEvents.VoiceStateUpdate:
|
468
482
|
this.client.emit("voiceStateUpdate", transformers_1.Voice.voiceStateFromRaw(packet.d));
|
469
483
|
break;
|
@@ -479,6 +493,15 @@ class Shard {
|
|
479
493
|
case constants_1.GatewayEvents.WebhooksUpdate:
|
480
494
|
this.client.emit("webhooksUpdate", packet.d.channel_id, packet.d.guild_id);
|
481
495
|
break;
|
496
|
+
case constants_1.GatewayEvents.SubscriptionCreate:
|
497
|
+
this.client.emit("subscriptionCreate", transformers_1.Subscriptions.subscriptionFromRaw(packet.d));
|
498
|
+
break;
|
499
|
+
case constants_1.GatewayEvents.SubscriptionUpdate:
|
500
|
+
this.client.emit("subscriptionUpdate", transformers_1.Subscriptions.subscriptionFromRaw(packet.d));
|
501
|
+
break;
|
502
|
+
case constants_1.GatewayEvents.SubscriptionDelete:
|
503
|
+
this.client.emit("subscriptionDelete", transformers_1.Subscriptions.subscriptionFromRaw(packet.d));
|
504
|
+
break;
|
482
505
|
case constants_1.GatewayEvents.MessagePollVoteAdd:
|
483
506
|
this.client.emit("messagePollVoteAdd", {
|
484
507
|
userID: packet.d.user_id,
|
@@ -68,6 +68,7 @@ export declare const userChannels: () => "users/@me/channels";
|
|
68
68
|
export declare const userConnections: () => "users/@me/connections";
|
69
69
|
export declare const userGuild: (guildID: snowflake) => `users/@me/guilds/${string}`;
|
70
70
|
export declare const userGuilds: () => "users/@me/guilds";
|
71
|
+
export declare const applicationActivityInstance: (applicationID: snowflake, instanceID: string) => string;
|
71
72
|
export declare const applicationCommand: (applicationID: snowflake, commandID: snowflake) => `applications/${string}/commands/${string}`;
|
72
73
|
export declare const applicationCommands: (applicationID: snowflake) => `applications/${string}/commands`;
|
73
74
|
export declare const applicationCommandPermissions: (applicationID: snowflake, guildID: snowflake, commandID: snowflake) => `applications/${string}/guilds/${string}/commands/${string}/permissions`;
|
@@ -85,6 +86,10 @@ export declare const guildApplicationCommandsPermissions: (applicationID: snowfl
|
|
85
86
|
export declare const webhook: (webhookID: snowflake, webhookToken?: string) => `webhooks/${string}`;
|
86
87
|
export declare const webhookMessage: (webhookID: snowflake, webhookToken: string, messageID?: snowflake | "@original") => `webhooks/${string}/${string}/messages/${string}`;
|
87
88
|
export declare const webhookPlatform: (webhookID: snowflake, webhookToken: string, platform: "github" | "slack") => `webhooks/${string}/${string}/github` | `webhooks/${string}/${string}/slack`;
|
89
|
+
export declare const stickerPack: (packID: snowflake) => `sticker-packs/${string}`;
|
90
|
+
export declare const stickerPacks: () => "sticker-packs";
|
91
|
+
export declare const skuSubscription: (skuID: snowflake, subscriptionID: snowflake) => `skus/${string}/subscriptions/${string}`;
|
92
|
+
export declare const skuSubscriptions: (skuID: snowflake) => `skus/${string}/subscriptions`;
|
88
93
|
export declare const gateway: () => "gateway";
|
89
94
|
export declare const gatewayBot: () => "gateway/bot";
|
90
95
|
export declare const oauth2Authorize: () => "oauth2/authorize";
|
@@ -97,5 +102,4 @@ export declare const invite: (code: string) => `invites/${string}`;
|
|
97
102
|
export declare const stageInstance: (channelID: snowflake) => `stage-instances/${string}`;
|
98
103
|
export declare const stageInstances: () => "stage-instances";
|
99
104
|
export declare const sticker: (stickerID: snowflake) => `stickers/${string}`;
|
100
|
-
export declare const stickerPacks: () => "sticker-packs";
|
101
105
|
export declare const voiceRegions: () => "voice/regions";
|
@@ -1,7 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.channelMessageCrosspost = exports.channelMessageAllReactions = exports.channelMessage = exports.channelInvites = exports.channelFollowers = exports.channelBulkDelete = exports.channel = exports.template = exports.guildWidgetSettings = exports.guildWidgetJSON = exports.guildWidgetImage = exports.guildWelcomeScreen = exports.guildWebhooks = exports.guildVoiceState = exports.guildVoiceRegions = exports.guildVanityURL = exports.guildTemplates = exports.guildTemplate = exports.guildStickers = exports.guildSticker = exports.guildScheduledEventUsers = exports.guildScheduledEvents = exports.guildScheduledEvent = exports.guildRoles = exports.guildRole = exports.guildPrune = exports.guildPreview = exports.guildOnboarding = exports.guildMemberVerification = exports.guildMembersSearch = exports.guildMembers = exports.guildMemberRole = exports.guildMember = exports.guildMFA = exports.guildInvites = exports.guildIntegrations = exports.guildIntegration = exports.guildEmojis = exports.guildEmoji = exports.guildMemberNickname = exports.guildChannels = exports.guildBulkBan = exports.guildBans = exports.guildBan = exports.guildAutoModerationRules = exports.guildAutoModerationRule = exports.guildAuditLog = exports.guildActiveThreads = exports.guilds = exports.guild = void 0;
|
4
|
-
exports.
|
4
|
+
exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = exports.oauth2Application = exports.oauth2Authorize = exports.gatewayBot = exports.gateway = exports.skuSubscriptions = exports.skuSubscription = exports.stickerPacks = exports.stickerPack = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSKUs = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlementConsume = exports.applicationEntitlement = exports.applicationEmojis = exports.applicationEmoji = exports.applicationUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.applicationActivityInstance = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.pollExpire = exports.pollAnswerVoters = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = exports.channelMessageReaction = void 0;
|
5
|
+
exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = void 0;
|
5
6
|
// Guilds
|
6
7
|
const guild = (guildID) => `guilds/${guildID}`;
|
7
8
|
exports.guild = guild;
|
@@ -152,6 +153,8 @@ exports.userGuild = userGuild;
|
|
152
153
|
const userGuilds = () => "users/@me/guilds";
|
153
154
|
exports.userGuilds = userGuilds;
|
154
155
|
// Applications
|
156
|
+
const applicationActivityInstance = (applicationID, instanceID) => `applications/${applicationID}/activity-instances/${instanceID}`;
|
157
|
+
exports.applicationActivityInstance = applicationActivityInstance;
|
155
158
|
const applicationCommand = (applicationID, commandID) => `applications/${applicationID}/commands/${commandID}`;
|
156
159
|
exports.applicationCommand = applicationCommand;
|
157
160
|
const applicationCommands = (applicationID) => `applications/${applicationID}/commands`;
|
@@ -189,6 +192,16 @@ const webhookMessage = (webhookID, webhookToken, messageID = "@original") => `we
|
|
189
192
|
exports.webhookMessage = webhookMessage;
|
190
193
|
const webhookPlatform = (webhookID, webhookToken, platform) => `webhooks/${webhookID}/${webhookToken}/${platform}`;
|
191
194
|
exports.webhookPlatform = webhookPlatform;
|
195
|
+
// Sticker packs
|
196
|
+
const stickerPack = (packID) => `sticker-packs/${packID}`;
|
197
|
+
exports.stickerPack = stickerPack;
|
198
|
+
const stickerPacks = () => "sticker-packs";
|
199
|
+
exports.stickerPacks = stickerPacks;
|
200
|
+
// Subscriptions
|
201
|
+
const skuSubscription = (skuID, subscriptionID) => `skus/${skuID}/subscriptions/${subscriptionID}`;
|
202
|
+
exports.skuSubscription = skuSubscription;
|
203
|
+
const skuSubscriptions = (skuID) => `skus/${skuID}/subscriptions`;
|
204
|
+
exports.skuSubscriptions = skuSubscriptions;
|
192
205
|
// Gateway
|
193
206
|
const gateway = () => "gateway";
|
194
207
|
exports.gateway = gateway;
|
@@ -216,7 +229,5 @@ const stageInstances = () => "stage-instances";
|
|
216
229
|
exports.stageInstances = stageInstances;
|
217
230
|
const sticker = (stickerID) => `stickers/${stickerID}`;
|
218
231
|
exports.sticker = sticker;
|
219
|
-
const stickerPacks = () => "sticker-packs";
|
220
|
-
exports.stickerPacks = stickerPacks;
|
221
232
|
const voiceRegions = () => "voice/regions";
|
222
233
|
exports.voiceRegions = voiceRegions;
|
@@ -30,6 +30,7 @@ class Applications {
|
|
30
30
|
coverImage: application.cover_image,
|
31
31
|
flags: application.flags,
|
32
32
|
approximateGuildCount: application.approximate_guild_count,
|
33
|
+
approximateUserInstallCount: application.approximate_user_install_count,
|
33
34
|
redirectURIs: application.redirect_uris,
|
34
35
|
interactionsEndpointURL: application.interactions_endpoint_url,
|
35
36
|
roleConnectionsVerificationURL: application.role_connections_verification_url,
|
@@ -75,6 +76,7 @@ class Applications {
|
|
75
76
|
cover_image: application.coverImage,
|
76
77
|
flags: application.flags,
|
77
78
|
approximate_guild_count: application.approximateGuildCount,
|
79
|
+
approximate_user_install_count: application.approximateUserInstallCount,
|
78
80
|
redirect_uris: application.redirectURIs,
|
79
81
|
interactions_endpoint_url: application.interactionsEndpointURL,
|
80
82
|
role_connections_verification_url: application.roleConnectionsVerificationURL,
|
@@ -10,7 +10,6 @@ class Stickers {
|
|
10
10
|
name: sticker.name,
|
11
11
|
description: sticker.description,
|
12
12
|
tags: sticker.tags,
|
13
|
-
asset: sticker.asset,
|
14
13
|
type: sticker.type,
|
15
14
|
formatType: sticker.format_type,
|
16
15
|
available: sticker.available,
|
@@ -28,7 +27,6 @@ class Stickers {
|
|
28
27
|
name: sticker.name,
|
29
28
|
description: sticker.description,
|
30
29
|
tags: sticker.tags,
|
31
|
-
asset: sticker.asset,
|
32
30
|
type: sticker.type,
|
33
31
|
format_type: sticker.formatType,
|
34
32
|
available: sticker.available,
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Subscriptions = void 0;
|
4
|
+
class Subscriptions {
|
5
|
+
static subscriptionFromRaw(subscription) {
|
6
|
+
return {
|
7
|
+
id: subscription.id,
|
8
|
+
userID: subscription.user_id,
|
9
|
+
skuIDs: subscription.sku_ids,
|
10
|
+
entitlementIDs: subscription.entitlement_ids,
|
11
|
+
currentPeriodStart: subscription.current_period_start,
|
12
|
+
currentPeriodEnd: subscription.current_period_end,
|
13
|
+
status: subscription.status,
|
14
|
+
canceledAt: subscription.canceled_at,
|
15
|
+
country: subscription.country,
|
16
|
+
};
|
17
|
+
}
|
18
|
+
static subscriptionToRaw(subscription) {
|
19
|
+
return {
|
20
|
+
id: subscription.id,
|
21
|
+
user_id: subscription.userID,
|
22
|
+
sku_ids: subscription.skuIDs,
|
23
|
+
entitlement_ids: subscription.entitlementIDs,
|
24
|
+
current_period_start: subscription.currentPeriodStart,
|
25
|
+
current_period_end: subscription.currentPeriodEnd,
|
26
|
+
status: subscription.status,
|
27
|
+
canceled_at: subscription.canceledAt,
|
28
|
+
country: subscription.country,
|
29
|
+
};
|
30
|
+
}
|
31
|
+
}
|
32
|
+
exports.Subscriptions = Subscriptions;
|
@@ -34,6 +34,7 @@ __exportStar(require("./Roles"), exports);
|
|
34
34
|
__exportStar(require("./SKUs"), exports);
|
35
35
|
__exportStar(require("./StageInstances"), exports);
|
36
36
|
__exportStar(require("./Stickers"), exports);
|
37
|
+
__exportStar(require("./Subscriptions"), exports);
|
37
38
|
__exportStar(require("./Teams"), exports);
|
38
39
|
__exportStar(require("./Users"), exports);
|
39
40
|
__exportStar(require("./Voice"), exports);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { ApplicationFlags, ApplicationIntegrationTypes, OAuth2Scopes } from "../constants";
|
1
|
+
import type { ActivityLocationKind, ApplicationFlags, ApplicationIntegrationTypes, OAuth2Scopes } from "../constants";
|
2
2
|
import type { snowflake } from "./common";
|
3
3
|
import type { RawGuild, Guild } from "./guild";
|
4
4
|
import type { RawTeam, Team } from "./team";
|
@@ -24,6 +24,7 @@ export interface RawApplication {
|
|
24
24
|
cover_image?: string;
|
25
25
|
flags?: ApplicationFlags;
|
26
26
|
approximate_guild_count?: number;
|
27
|
+
approximate_user_install_count?: number;
|
27
28
|
redirect_uris?: Array<string>;
|
28
29
|
interactions_endpoint_url?: string;
|
29
30
|
role_connections_verification_url?: string;
|
@@ -41,6 +42,21 @@ export interface RawInstallParams {
|
|
41
42
|
scopes: Array<OAuth2Scopes>;
|
42
43
|
permissions: string;
|
43
44
|
}
|
45
|
+
/** https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-instance-object */
|
46
|
+
export interface RawActivityInstance {
|
47
|
+
application_id: snowflake;
|
48
|
+
instance_id: string;
|
49
|
+
launch_id: snowflake;
|
50
|
+
location: RawActivityLocation;
|
51
|
+
users: Array<snowflake>;
|
52
|
+
}
|
53
|
+
/** https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-location-object */
|
54
|
+
export interface RawActivityLocation {
|
55
|
+
id: string;
|
56
|
+
kind: ActivityLocationKind;
|
57
|
+
channel_id: snowflake;
|
58
|
+
guild_id?: snowflake | null;
|
59
|
+
}
|
44
60
|
export interface Application {
|
45
61
|
id: snowflake;
|
46
62
|
name: string;
|
@@ -61,6 +77,7 @@ export interface Application {
|
|
61
77
|
coverImage?: string;
|
62
78
|
flags?: ApplicationFlags;
|
63
79
|
approximateGuildCount?: number;
|
80
|
+
approximateUserInstallCount?: number;
|
64
81
|
redirectURIs?: Array<string>;
|
65
82
|
interactionsEndpointURL?: string;
|
66
83
|
roleConnectionsVerificationURL?: string;
|
@@ -76,3 +93,16 @@ export interface InstallParams {
|
|
76
93
|
scopes: Array<OAuth2Scopes>;
|
77
94
|
permissions: string;
|
78
95
|
}
|
96
|
+
export interface ActivityInstance {
|
97
|
+
applicationID: snowflake;
|
98
|
+
instanceID: string;
|
99
|
+
launchID: snowflake;
|
100
|
+
location: ActivityLocation;
|
101
|
+
users: Array<snowflake>;
|
102
|
+
}
|
103
|
+
export interface ActivityLocation {
|
104
|
+
id: string;
|
105
|
+
kind: ActivityLocationKind;
|
106
|
+
channelID: snowflake;
|
107
|
+
guildID?: snowflake | null;
|
108
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { EntitlementTypes } from "../constants";
|
2
2
|
import type { snowflake, timestamp } from "./common";
|
3
|
-
/** https://discord.com/developers/docs/
|
3
|
+
/** https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-structure */
|
4
4
|
export interface RawEntitlement {
|
5
5
|
id: snowflake;
|
6
6
|
sku_id: snowflake;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { ActivityFlags, ActivityType, GatewayEvents, GatewayIntents, GatewayOPCodes, GuildMemberFlags, InviteTargetTypes, ReactionTypes, StatusTypes, TriggerTypes } from "../constants";
|
1
|
+
import type { ActivityFlags, ActivityType, AnimationTypes, GatewayEvents, GatewayIntents, GatewayOPCodes, GuildMemberFlags, InviteTargetTypes, ReactionTypes, StatusTypes, TriggerTypes } from "../constants";
|
2
2
|
import type { RawApplication, Application } from "./application";
|
3
3
|
import type { RawAutoModerationAction, AutoModerationAction } from "./auto-moderation";
|
4
4
|
import type { RawChannel, RawThreadMember, Channel, ThreadMember } from "./channel";
|
@@ -330,6 +330,17 @@ export interface RawTypingStartEventFields {
|
|
330
330
|
timestamp: timestamp;
|
331
331
|
member?: RawGuildMember;
|
332
332
|
}
|
333
|
+
/** https://discord.com/developers/docs/topics/gateway-events#voice-channel-effetc-send-event-fields */
|
334
|
+
export interface RawVoiceChannelEffectSendEventFields {
|
335
|
+
channel_id: snowflake;
|
336
|
+
guild_id: snowflake;
|
337
|
+
user_id: snowflake;
|
338
|
+
emoji?: RawEmoji | null;
|
339
|
+
animation_type?: AnimationTypes | null;
|
340
|
+
animation_id?: number;
|
341
|
+
sound_id?: snowflake | number;
|
342
|
+
sound_volume?: number;
|
343
|
+
}
|
333
344
|
/** https://discord.com/developers/docs/topics/gateway-events#voice-server-update-voice-server-update-event-fields */
|
334
345
|
export interface RawVoiceServerUpdateEventFields {
|
335
346
|
token: string;
|
@@ -630,6 +641,16 @@ export interface TypingStartEventFields {
|
|
630
641
|
timestamp: timestamp;
|
631
642
|
member?: GuildMember;
|
632
643
|
}
|
644
|
+
export interface VoiceChannelEffectSendEventFields {
|
645
|
+
channelID: snowflake;
|
646
|
+
guildID: snowflake;
|
647
|
+
userID: snowflake;
|
648
|
+
emoji?: Emoji | null;
|
649
|
+
animationType?: AnimationTypes | null;
|
650
|
+
animationID?: number;
|
651
|
+
soundID?: snowflake | number;
|
652
|
+
soundVolume?: number;
|
653
|
+
}
|
633
654
|
export interface VoiceServerUpdateEventFields {
|
634
655
|
token: string;
|
635
656
|
guildID: snowflake;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { MessageTypes, MessageFlags, MessageActivityTypes, InteractionType, ApplicationIntegrationTypes, MessageReferenceTypes, AttachmentFlags, ChannelTypes, AllowedMentionTypes } from "../constants";
|
1
|
+
import type { MessageTypes, MessageFlags, MessageActivityTypes, InteractionType, ApplicationIntegrationTypes, MessageReferenceTypes, AttachmentFlags, ChannelTypes, AllowedMentionTypes, EmbedTypes } from "../constants";
|
2
2
|
import type { Application, RawApplication } from "./application";
|
3
3
|
import type { Channel, RawChannel, RawRoleSubscriptionData, RoleSubscriptionData } from "./channel";
|
4
4
|
import type { snowflake, timestamp } from "./common";
|
@@ -77,7 +77,7 @@ export interface RawMessageReference {
|
|
77
77
|
}
|
78
78
|
/** https://discord.com/developers/docs/resources/message#message-snapshot-object-message-snapshot-structure */
|
79
79
|
export interface RawMessageSnapshot {
|
80
|
-
message: Pick<RawMessage, "type" | "content" | "embeds" | "attachments" | "timestamp" | "edited_timestamp" | "flags" | "mentions" | "mention_roles">;
|
80
|
+
message: Pick<RawMessage, "type" | "content" | "embeds" | "attachments" | "timestamp" | "edited_timestamp" | "flags" | "mentions" | "mention_roles" | "stickers" | "sticker_items" | "components">;
|
81
81
|
}
|
82
82
|
/** https://discord.com/developers/docs/resources/message#reaction-object-reaction-structure */
|
83
83
|
export interface RawReaction {
|
@@ -96,7 +96,7 @@ export interface RawReactionCountDetails {
|
|
96
96
|
/** https://discord.com/developers/docs/resources/message#embed-object-embed-structure */
|
97
97
|
export interface RawEmbed {
|
98
98
|
title?: string;
|
99
|
-
type?:
|
99
|
+
type?: EmbedTypes;
|
100
100
|
description?: string;
|
101
101
|
url?: string;
|
102
102
|
timestamp?: timestamp;
|
@@ -154,6 +154,17 @@ export interface RawEmbedField {
|
|
154
154
|
value: string;
|
155
155
|
inline?: boolean;
|
156
156
|
}
|
157
|
+
/** https://discord.com/developers/docs/resources/message#embed-fields-by-embed-type-poll-result-embed-fields */
|
158
|
+
export interface RawPollResultEmbedFields {
|
159
|
+
poll_question_text: string;
|
160
|
+
victor_answer_votes: Array<number>;
|
161
|
+
total_votes: number;
|
162
|
+
victor_answer_id?: snowflake;
|
163
|
+
victor_answer_text?: string;
|
164
|
+
victor_answer_emoji_id?: snowflake;
|
165
|
+
victor_answer_emoji_name?: string;
|
166
|
+
victor_answer_emoji_animated?: boolean;
|
167
|
+
}
|
157
168
|
/** https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure */
|
158
169
|
export interface RawAttachment {
|
159
170
|
id: snowflake;
|
@@ -248,7 +259,7 @@ export interface MessageReference {
|
|
248
259
|
failIfNotExists?: boolean;
|
249
260
|
}
|
250
261
|
export interface MessageSnapshot {
|
251
|
-
message: Pick<Message, "type" | "content" | "embeds" | "attachments" | "timestamp" | "editedTimestamp" | "flags" | "mentions" | "mentionRoles">;
|
262
|
+
message: Pick<Message, "type" | "content" | "embeds" | "attachments" | "timestamp" | "editedTimestamp" | "flags" | "mentions" | "mentionRoles" | "stickers" | "stickerItems" | "components">;
|
252
263
|
}
|
253
264
|
export interface Reaction {
|
254
265
|
count: number;
|
@@ -264,7 +275,7 @@ export interface ReactionCountDetails {
|
|
264
275
|
}
|
265
276
|
export interface Embed {
|
266
277
|
title?: string;
|
267
|
-
type?:
|
278
|
+
type?: EmbedTypes;
|
268
279
|
description?: string;
|
269
280
|
url?: string;
|
270
281
|
timestamp?: timestamp;
|
@@ -315,6 +326,16 @@ export interface EmbedField {
|
|
315
326
|
value: string;
|
316
327
|
inline?: boolean;
|
317
328
|
}
|
329
|
+
export interface PollResultEmbedFields {
|
330
|
+
pollQuestionText: string;
|
331
|
+
victorAnswerVotes: Array<number>;
|
332
|
+
totalVotes: number;
|
333
|
+
victorAnswerID?: snowflake;
|
334
|
+
victorAnswerText?: string;
|
335
|
+
victorAnswerEmojiID?: snowflake;
|
336
|
+
victorAnswerEmojiName?: string;
|
337
|
+
victorAnswerEmojiAnimated?: boolean;
|
338
|
+
}
|
318
339
|
export interface Attachment {
|
319
340
|
id: snowflake;
|
320
341
|
filename: string;
|
package/dist/lib/types/sku.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { SKUFlags, SKUTypes } from "../constants";
|
2
2
|
import type { snowflake } from "./common";
|
3
|
-
/** https://discord.com/developers/docs/
|
3
|
+
/** https://discord.com/developers/docs/resources/sku#sku-object-sku-structure */
|
4
4
|
export interface RawSKU {
|
5
5
|
id: snowflake;
|
6
6
|
type: SKUTypes;
|
@@ -8,7 +8,6 @@ export interface RawSticker {
|
|
8
8
|
name: string;
|
9
9
|
description: string | null;
|
10
10
|
tags: string;
|
11
|
-
asset?: string;
|
12
11
|
type: StickerTypes;
|
13
12
|
format_type: StickerFormatTypes;
|
14
13
|
available?: boolean;
|
@@ -38,7 +37,6 @@ export interface Sticker {
|
|
38
37
|
name: string;
|
39
38
|
description: string | null;
|
40
39
|
tags: string;
|
41
|
-
asset?: string;
|
42
40
|
type: StickerTypes;
|
43
41
|
formatType: StickerFormatTypes;
|
44
42
|
available?: boolean;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { SubscriptionStatuses } from "../constants";
|
2
|
+
import type { snowflake, timestamp } from "./common";
|
3
|
+
/** https://discord.com/developers/docs/resources/subscription#subscription-object */
|
4
|
+
export interface RawSubscription {
|
5
|
+
id: snowflake;
|
6
|
+
user_id: snowflake;
|
7
|
+
sku_ids: Array<snowflake>;
|
8
|
+
entitlement_ids: Array<snowflake>;
|
9
|
+
current_period_start: timestamp;
|
10
|
+
current_period_end: timestamp;
|
11
|
+
status: SubscriptionStatuses;
|
12
|
+
canceled_at: timestamp | null;
|
13
|
+
country?: string;
|
14
|
+
}
|
15
|
+
export interface Subscription {
|
16
|
+
id: snowflake;
|
17
|
+
userID: snowflake;
|
18
|
+
skuIDs: Array<snowflake>;
|
19
|
+
entitlementIDs: Array<snowflake>;
|
20
|
+
currentPeriodStart: timestamp;
|
21
|
+
currentPeriodEnd: timestamp;
|
22
|
+
status: SubscriptionStatuses;
|
23
|
+
canceledAt: timestamp | null;
|
24
|
+
country?: string;
|
25
|
+
}
|
@@ -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
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "disgroove",
|
3
|
-
"version": "2.2.
|
3
|
+
"version": "2.2.5-dev.4e978d8",
|
4
4
|
"description": "A module to interface with Discord",
|
5
5
|
"main": "./dist/lib/index.js",
|
6
6
|
"types": "./dist/lib/index.d.ts",
|
@@ -25,9 +25,9 @@
|
|
25
25
|
},
|
26
26
|
"homepage": "https://github.com/XenKys/disgroove#readme",
|
27
27
|
"devDependencies": {
|
28
|
-
"@types/node": "^
|
29
|
-
"@types/ws": "^8.5.
|
30
|
-
"typescript": "^5.5.
|
28
|
+
"@types/node": "^22.5.3",
|
29
|
+
"@types/ws": "^8.5.12",
|
30
|
+
"typescript": "^5.5.4"
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
33
|
"ws": "^8.18.0"
|
package/package.json
CHANGED
@@ -1,35 +1,35 @@
|
|
1
|
-
{
|
2
|
-
"name": "disgroove",
|
3
|
-
"version": "2.2.
|
4
|
-
"description": "A module to interface with Discord",
|
5
|
-
"main": "./dist/lib/index.js",
|
6
|
-
"types": "./dist/lib/index.d.ts",
|
7
|
-
"repository": {
|
8
|
-
"type": "git",
|
9
|
-
"url": "git+https://github.com/XenKys/disgroove.git"
|
10
|
-
},
|
11
|
-
"keywords": [
|
12
|
-
"api",
|
13
|
-
"bot",
|
14
|
-
"discord",
|
15
|
-
"gateway",
|
16
|
-
"http",
|
17
|
-
"https",
|
18
|
-
"rest",
|
19
|
-
"wrapper"
|
20
|
-
],
|
21
|
-
"author": "XenKys",
|
22
|
-
"license": "MIT",
|
23
|
-
"bugs": {
|
24
|
-
"url": "https://github.com/XenKys/disgroove/issues"
|
25
|
-
},
|
26
|
-
"homepage": "https://github.com/XenKys/disgroove#readme",
|
27
|
-
"devDependencies": {
|
28
|
-
"@types/node": "^
|
29
|
-
"@types/ws": "^8.5.
|
30
|
-
"typescript": "^5.5.
|
31
|
-
},
|
32
|
-
"dependencies": {
|
33
|
-
"ws": "^8.18.0"
|
34
|
-
}
|
35
|
-
}
|
1
|
+
{
|
2
|
+
"name": "disgroove",
|
3
|
+
"version": "2.2.5-dev.4e978d8",
|
4
|
+
"description": "A module to interface with Discord",
|
5
|
+
"main": "./dist/lib/index.js",
|
6
|
+
"types": "./dist/lib/index.d.ts",
|
7
|
+
"repository": {
|
8
|
+
"type": "git",
|
9
|
+
"url": "git+https://github.com/XenKys/disgroove.git"
|
10
|
+
},
|
11
|
+
"keywords": [
|
12
|
+
"api",
|
13
|
+
"bot",
|
14
|
+
"discord",
|
15
|
+
"gateway",
|
16
|
+
"http",
|
17
|
+
"https",
|
18
|
+
"rest",
|
19
|
+
"wrapper"
|
20
|
+
],
|
21
|
+
"author": "XenKys",
|
22
|
+
"license": "MIT",
|
23
|
+
"bugs": {
|
24
|
+
"url": "https://github.com/XenKys/disgroove/issues"
|
25
|
+
},
|
26
|
+
"homepage": "https://github.com/XenKys/disgroove#readme",
|
27
|
+
"devDependencies": {
|
28
|
+
"@types/node": "^22.5.3",
|
29
|
+
"@types/ws": "^8.5.12",
|
30
|
+
"typescript": "^5.5.4"
|
31
|
+
},
|
32
|
+
"dependencies": {
|
33
|
+
"ws": "^8.18.0"
|
34
|
+
}
|
35
|
+
}
|