disgroove 2.2.7 → 3.0.0-dev.2cf2b90
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/LICENSE +9 -9
- package/README.md +48 -48
- package/dist/lib/Client.d.ts +295 -300
- package/dist/lib/Client.js +480 -473
- package/dist/lib/constants.d.ts +7 -4
- package/dist/lib/constants.js +6 -3
- package/dist/lib/gateway/Dispatcher.d.ts +104 -0
- package/dist/lib/gateway/Dispatcher.js +471 -0
- package/dist/lib/gateway/Shard.d.ts +12 -21
- package/dist/lib/gateway/Shard.js +120 -584
- package/dist/lib/gateway/Transmitter.d.ts +22 -0
- package/dist/lib/gateway/Transmitter.js +93 -0
- package/dist/lib/gateway/WebSocketManager.d.ts +22 -0
- package/dist/lib/gateway/WebSocketManager.js +93 -0
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.js +4 -0
- package/dist/lib/rest/Endpoints.d.ts +94 -94
- package/dist/lib/rest/Endpoints.js +104 -104
- package/dist/lib/rest/RequestManager.js +17 -7
- package/dist/lib/rest/index.js +17 -7
- package/dist/lib/transformers/ApplicationCommands.js +4 -4
- package/dist/lib/transformers/Applications.d.ts +2 -0
- package/dist/lib/transformers/Applications.js +110 -4
- package/dist/lib/transformers/AuditLogs.js +10 -10
- package/dist/lib/transformers/AutoModeration.js +6 -6
- package/dist/lib/transformers/Channels.js +16 -16
- package/dist/lib/transformers/Components.d.ts +3 -1
- package/dist/lib/transformers/Components.js +42 -16
- package/dist/lib/transformers/Entitlements.d.ts +2 -2
- package/dist/lib/transformers/Entitlements.js +16 -16
- package/dist/lib/transformers/GuildScheduledEvents.js +8 -8
- package/dist/lib/transformers/GuildTemplates.js +4 -4
- package/dist/lib/transformers/Guilds.js +28 -28
- package/dist/lib/transformers/Interactions.js +74 -44
- package/dist/lib/transformers/Lobbies.js +2 -2
- package/dist/lib/transformers/Messages.js +18 -18
- package/dist/lib/transformers/Polls.js +2 -2
- package/dist/lib/transformers/Presences.d.ts +3 -3
- package/dist/lib/transformers/Presences.js +6 -6
- package/dist/lib/transformers/Roles.js +6 -6
- package/dist/lib/transformers/SKUs.js +2 -2
- package/dist/lib/transformers/Soundboards.js +6 -6
- package/dist/lib/transformers/StageInstances.js +6 -6
- package/dist/lib/transformers/Stickers.js +3 -3
- package/dist/lib/transformers/Subscriptions.js +8 -8
- package/dist/lib/transformers/Teams.js +4 -4
- package/dist/lib/transformers/Users.js +6 -6
- package/dist/lib/transformers/Voice.js +8 -8
- package/dist/lib/transformers/Webhooks.js +6 -6
- package/dist/lib/types/application-command.d.ts +9 -4
- package/dist/lib/types/application-role-connection-metadata.d.ts +1 -0
- package/dist/lib/types/application.d.ts +12 -7
- package/dist/lib/types/audit-log.d.ts +9 -5
- package/dist/lib/types/auto-moderation.d.ts +7 -3
- package/dist/lib/types/channel.d.ts +17 -23
- package/dist/lib/types/common.d.ts +2 -0
- package/dist/lib/types/components.d.ts +79 -19
- package/dist/lib/types/emoji.d.ts +1 -0
- package/dist/lib/types/entitlements.d.ts +5 -4
- package/dist/lib/types/gateway-events.d.ts +387 -210
- package/dist/lib/types/guild-scheduled-event.d.ts +10 -5
- package/dist/lib/types/guild-template.d.ts +3 -2
- package/dist/lib/types/guild.d.ts +33 -17
- package/dist/lib/types/interaction.d.ts +26 -13
- package/dist/lib/types/invite.d.ts +3 -0
- package/dist/lib/types/lobby.d.ts +3 -1
- package/dist/lib/types/message.d.ts +29 -15
- package/dist/lib/types/poll.d.ts +7 -1
- package/dist/lib/types/role.d.ts +6 -3
- package/dist/lib/types/sku.d.ts +2 -1
- package/dist/lib/types/soundboard.d.ts +4 -3
- package/dist/lib/types/stage-instance.d.ts +4 -3
- package/dist/lib/types/sticker.d.ts +8 -5
- package/dist/lib/types/subscription.d.ts +6 -5
- package/dist/lib/types/team.d.ts +4 -2
- package/dist/lib/types/user.d.ts +10 -3
- package/dist/lib/types/voice.d.ts +6 -4
- package/dist/lib/types/webhook.d.ts +4 -3
- package/dist/lib/utils/CDN.d.ts +22 -22
- package/dist/lib/utils/CDN.js +22 -22
- package/dist/lib/utils/errors.d.ts +3 -1
- package/dist/lib/utils/errors.js +4 -0
- package/dist/lib/utils/formatters.d.ts +6 -6
- package/dist/lib/utils/formatters.js +27 -28
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.js +18 -7
- package/dist/lib/utils/permissions.d.ts +2 -0
- package/dist/lib/utils/permissions.js +7 -0
- package/dist/package.json +1 -1
- package/package.json +2 -2
- package/dist/lib/types/message-components.d.ts +0 -450
- package/dist/lib/types/message-components.js +0 -2
|
@@ -195,7 +195,7 @@ class Messages {
|
|
|
195
195
|
static messageFromRaw(message) {
|
|
196
196
|
return {
|
|
197
197
|
id: message.id,
|
|
198
|
-
|
|
198
|
+
channelId: message.channel_id,
|
|
199
199
|
author: Users_1.Users.userFromRaw(message.author),
|
|
200
200
|
content: message.content,
|
|
201
201
|
timestamp: message.timestamp,
|
|
@@ -206,7 +206,7 @@ class Messages {
|
|
|
206
206
|
mentionRoles: message.mention_roles,
|
|
207
207
|
mentionChannels: message.mention_channels?.map((channelMention) => ({
|
|
208
208
|
id: channelMention.id,
|
|
209
|
-
|
|
209
|
+
guildId: channelMention.guild_id,
|
|
210
210
|
type: channelMention.type,
|
|
211
211
|
name: channelMention.name,
|
|
212
212
|
})),
|
|
@@ -222,19 +222,19 @@ class Messages {
|
|
|
222
222
|
})),
|
|
223
223
|
nonce: message.nonce,
|
|
224
224
|
pinned: message.pinned,
|
|
225
|
-
|
|
225
|
+
webhookId: message.webhook_id,
|
|
226
226
|
type: message.type,
|
|
227
227
|
activity: message.activity,
|
|
228
228
|
application: message.application !== undefined
|
|
229
|
-
? Applications_1.Applications.
|
|
229
|
+
? Applications_1.Applications.partialApplicationFromRaw(message.application)
|
|
230
230
|
: undefined,
|
|
231
|
-
|
|
231
|
+
applicationId: message.application_id,
|
|
232
232
|
flags: message.flags,
|
|
233
233
|
messageReference: message.message_reference !== undefined
|
|
234
234
|
? {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
messageId: message.message_reference.message_id,
|
|
236
|
+
channelId: message.message_reference.channel_id,
|
|
237
|
+
guildId: message.message_reference.guild_id,
|
|
238
238
|
failIfNotExists: message.message_reference.fail_if_not_exists,
|
|
239
239
|
}
|
|
240
240
|
: undefined,
|
|
@@ -285,7 +285,7 @@ class Messages {
|
|
|
285
285
|
position: message.position,
|
|
286
286
|
roleSubscriptionData: message.role_subscription_data !== undefined
|
|
287
287
|
? {
|
|
288
|
-
|
|
288
|
+
roleSubscriptionListingId: message.role_subscription_data.role_subscription_listing_id,
|
|
289
289
|
tierName: message.role_subscription_data.tier_name,
|
|
290
290
|
totalMonthsSubscribed: message.role_subscription_data.total_months_subscribed,
|
|
291
291
|
isRenewal: message.role_subscription_data.is_renewal,
|
|
@@ -303,7 +303,7 @@ class Messages {
|
|
|
303
303
|
static messageToRaw(message) {
|
|
304
304
|
return {
|
|
305
305
|
id: message.id,
|
|
306
|
-
channel_id: message.
|
|
306
|
+
channel_id: message.channelId,
|
|
307
307
|
author: Users_1.Users.userToRaw(message.author),
|
|
308
308
|
content: message.content,
|
|
309
309
|
timestamp: message.timestamp,
|
|
@@ -314,7 +314,7 @@ class Messages {
|
|
|
314
314
|
mention_roles: message.mentionRoles,
|
|
315
315
|
mention_channels: message.mentionChannels?.map((channelMention) => ({
|
|
316
316
|
id: channelMention.id,
|
|
317
|
-
guild_id: channelMention.
|
|
317
|
+
guild_id: channelMention.guildId,
|
|
318
318
|
type: channelMention.type,
|
|
319
319
|
name: channelMention.name,
|
|
320
320
|
})),
|
|
@@ -330,19 +330,19 @@ class Messages {
|
|
|
330
330
|
})),
|
|
331
331
|
nonce: message.nonce,
|
|
332
332
|
pinned: message.pinned,
|
|
333
|
-
webhook_id: message.
|
|
333
|
+
webhook_id: message.webhookId,
|
|
334
334
|
type: message.type,
|
|
335
335
|
activity: message.activity,
|
|
336
336
|
application: message.application !== undefined
|
|
337
|
-
? Applications_1.Applications.
|
|
337
|
+
? Applications_1.Applications.partialApplicationToRaw(message.application)
|
|
338
338
|
: undefined,
|
|
339
|
-
application_id: message.
|
|
339
|
+
application_id: message.applicationId,
|
|
340
340
|
flags: message.flags,
|
|
341
341
|
message_reference: message.messageReference !== undefined
|
|
342
342
|
? {
|
|
343
|
-
message_id: message.messageReference.
|
|
344
|
-
channel_id: message.messageReference.
|
|
345
|
-
guild_id: message.messageReference.
|
|
343
|
+
message_id: message.messageReference.messageId,
|
|
344
|
+
channel_id: message.messageReference.channelId,
|
|
345
|
+
guild_id: message.messageReference.guildId,
|
|
346
346
|
fail_if_not_exists: message.messageReference.failIfNotExists,
|
|
347
347
|
}
|
|
348
348
|
: undefined,
|
|
@@ -393,7 +393,7 @@ class Messages {
|
|
|
393
393
|
position: message.position,
|
|
394
394
|
role_subscription_data: message.roleSubscriptionData !== undefined
|
|
395
395
|
? {
|
|
396
|
-
role_subscription_listing_id: message.roleSubscriptionData.
|
|
396
|
+
role_subscription_listing_id: message.roleSubscriptionData.roleSubscriptionListingId,
|
|
397
397
|
tier_name: message.roleSubscriptionData.tierName,
|
|
398
398
|
total_months_subscribed: message.roleSubscriptionData.totalMonthsSubscribed,
|
|
399
399
|
is_renewal: message.roleSubscriptionData.isRenewal,
|
|
@@ -6,7 +6,7 @@ class Polls {
|
|
|
6
6
|
return {
|
|
7
7
|
question: poll.question,
|
|
8
8
|
answers: poll.answers.map((answer) => ({
|
|
9
|
-
|
|
9
|
+
answerId: answer.answer_id,
|
|
10
10
|
pollMedia: answer.poll_media,
|
|
11
11
|
})),
|
|
12
12
|
expiry: poll.expiry,
|
|
@@ -28,7 +28,7 @@ class Polls {
|
|
|
28
28
|
return {
|
|
29
29
|
question: poll.question,
|
|
30
30
|
answers: poll.answers.map((answer) => ({
|
|
31
|
-
answer_id: answer.
|
|
31
|
+
answer_id: answer.answerId,
|
|
32
32
|
poll_media: answer.pollMedia,
|
|
33
33
|
})),
|
|
34
34
|
expiry: poll.expiry,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RawPresenceUpdateEvent, PresenceUpdateEvent } from "../types/gateway-events";
|
|
2
2
|
export declare class Presences {
|
|
3
|
-
static presenceFromRaw(presence:
|
|
4
|
-
static presenceToRaw(presence:
|
|
3
|
+
static presenceFromRaw(presence: RawPresenceUpdateEvent): PresenceUpdateEvent;
|
|
4
|
+
static presenceToRaw(presence: PresenceUpdateEvent): RawPresenceUpdateEvent;
|
|
5
5
|
}
|
|
@@ -25,12 +25,12 @@ class Presences {
|
|
|
25
25
|
? presence.user.avatar_decoration_data !== null
|
|
26
26
|
? {
|
|
27
27
|
asset: presence.user.avatar_decoration_data.asset,
|
|
28
|
-
|
|
28
|
+
skuId: presence.user.avatar_decoration_data.sku_id,
|
|
29
29
|
}
|
|
30
30
|
: null
|
|
31
31
|
: undefined,
|
|
32
32
|
},
|
|
33
|
-
|
|
33
|
+
guildId: presence.guild_id,
|
|
34
34
|
status: presence.status,
|
|
35
35
|
activities: presence.activities.map((activity) => ({
|
|
36
36
|
name: activity.name,
|
|
@@ -38,7 +38,7 @@ class Presences {
|
|
|
38
38
|
url: activity.url,
|
|
39
39
|
createdAt: activity.created_at,
|
|
40
40
|
timestamps: activity.timestamps,
|
|
41
|
-
|
|
41
|
+
applicationId: activity.application_id,
|
|
42
42
|
details: activity.details,
|
|
43
43
|
state: activity.state,
|
|
44
44
|
emoji: activity.emoji,
|
|
@@ -80,12 +80,12 @@ class Presences {
|
|
|
80
80
|
? presence.user.avatarDecorationData !== null
|
|
81
81
|
? {
|
|
82
82
|
asset: presence.user.avatarDecorationData.asset,
|
|
83
|
-
sku_id: presence.user.avatarDecorationData.
|
|
83
|
+
sku_id: presence.user.avatarDecorationData.skuId,
|
|
84
84
|
}
|
|
85
85
|
: null
|
|
86
86
|
: undefined,
|
|
87
87
|
},
|
|
88
|
-
guild_id: presence.
|
|
88
|
+
guild_id: presence.guildId,
|
|
89
89
|
status: presence.status,
|
|
90
90
|
activities: presence.activities.map((activity) => ({
|
|
91
91
|
name: activity.name,
|
|
@@ -93,7 +93,7 @@ class Presences {
|
|
|
93
93
|
url: activity.url,
|
|
94
94
|
created_at: activity.createdAt,
|
|
95
95
|
timestamps: activity.timestamps,
|
|
96
|
-
application_id: activity.
|
|
96
|
+
application_id: activity.applicationId,
|
|
97
97
|
details: activity.details,
|
|
98
98
|
state: activity.state,
|
|
99
99
|
emoji: activity.emoji,
|
|
@@ -21,10 +21,10 @@ class Roles {
|
|
|
21
21
|
mentionable: role.mentionable,
|
|
22
22
|
tags: role.tags !== undefined
|
|
23
23
|
? {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
botId: role.tags.bot_id,
|
|
25
|
+
integrationId: role.tags.integration_id,
|
|
26
26
|
premiumSubscriber: role.tags.premium_subscriber,
|
|
27
|
-
|
|
27
|
+
subscriptionListingId: role.tags.subscription_listing_id,
|
|
28
28
|
availableForPurchase: role.tags.available_for_purchase,
|
|
29
29
|
guildConnections: role.tags.guild_connections,
|
|
30
30
|
}
|
|
@@ -51,10 +51,10 @@ class Roles {
|
|
|
51
51
|
mentionable: role.mentionable,
|
|
52
52
|
tags: role.tags !== undefined
|
|
53
53
|
? {
|
|
54
|
-
bot_id: role.tags.
|
|
55
|
-
integration_id: role.tags.
|
|
54
|
+
bot_id: role.tags.botId,
|
|
55
|
+
integration_id: role.tags.integrationId,
|
|
56
56
|
premium_subscriber: role.tags.premiumSubscriber,
|
|
57
|
-
subscription_listing_id: role.tags.
|
|
57
|
+
subscription_listing_id: role.tags.subscriptionListingId,
|
|
58
58
|
available_for_purchase: role.tags.availableForPurchase,
|
|
59
59
|
guild_connections: role.tags.guildConnections,
|
|
60
60
|
}
|
|
@@ -6,7 +6,7 @@ class SKUs {
|
|
|
6
6
|
return {
|
|
7
7
|
id: sku.id,
|
|
8
8
|
type: sku.type,
|
|
9
|
-
|
|
9
|
+
applicationId: sku.application_id,
|
|
10
10
|
name: sku.name,
|
|
11
11
|
slug: sku.slug,
|
|
12
12
|
flags: sku.flags,
|
|
@@ -16,7 +16,7 @@ class SKUs {
|
|
|
16
16
|
return {
|
|
17
17
|
id: sku.id,
|
|
18
18
|
type: sku.type,
|
|
19
|
-
application_id: sku.
|
|
19
|
+
application_id: sku.applicationId,
|
|
20
20
|
name: sku.name,
|
|
21
21
|
slug: sku.slug,
|
|
22
22
|
flags: sku.flags,
|
|
@@ -6,11 +6,11 @@ class Soundboards {
|
|
|
6
6
|
static soundboardSoundFromRaw(sound) {
|
|
7
7
|
return {
|
|
8
8
|
name: sound.name,
|
|
9
|
-
|
|
9
|
+
soundId: sound.sound_id,
|
|
10
10
|
volume: sound.volume,
|
|
11
|
-
|
|
11
|
+
emojiId: sound.emoji_id,
|
|
12
12
|
emojiName: sound.emoji_name,
|
|
13
|
-
|
|
13
|
+
guildId: sound.guild_id,
|
|
14
14
|
available: sound.available,
|
|
15
15
|
user: sound.user !== undefined ? Users_1.Users.userFromRaw(sound.user) : undefined,
|
|
16
16
|
};
|
|
@@ -18,11 +18,11 @@ class Soundboards {
|
|
|
18
18
|
static soundboardSoundToRaw(sound) {
|
|
19
19
|
return {
|
|
20
20
|
name: sound.name,
|
|
21
|
-
sound_id: sound.
|
|
21
|
+
sound_id: sound.soundId,
|
|
22
22
|
volume: sound.volume,
|
|
23
|
-
emoji_id: sound.
|
|
23
|
+
emoji_id: sound.emojiId,
|
|
24
24
|
emoji_name: sound.emojiName,
|
|
25
|
-
guild_id: sound.
|
|
25
|
+
guild_id: sound.guildId,
|
|
26
26
|
available: sound.available,
|
|
27
27
|
user: sound.user !== undefined ? Users_1.Users.userToRaw(sound.user) : undefined,
|
|
28
28
|
};
|
|
@@ -5,23 +5,23 @@ class StageInstances {
|
|
|
5
5
|
static stageInstanceFromRaw(stageInstance) {
|
|
6
6
|
return {
|
|
7
7
|
id: stageInstance.id,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
guildId: stageInstance.guild_id,
|
|
9
|
+
channelId: stageInstance.channel_id,
|
|
10
10
|
topic: stageInstance.topic,
|
|
11
11
|
privacyLevel: stageInstance.privacy_level,
|
|
12
12
|
discoverableDisabled: stageInstance.discoverable_disabled,
|
|
13
|
-
|
|
13
|
+
guildScheduledEventId: stageInstance.guild_scheduled_event_id,
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
static stageInstanceToRaw(stageInstance) {
|
|
17
17
|
return {
|
|
18
18
|
id: stageInstance.id,
|
|
19
|
-
guild_id: stageInstance.
|
|
20
|
-
channel_id: stageInstance.
|
|
19
|
+
guild_id: stageInstance.guildId,
|
|
20
|
+
channel_id: stageInstance.channelId,
|
|
21
21
|
topic: stageInstance.topic,
|
|
22
22
|
privacy_level: stageInstance.privacyLevel,
|
|
23
23
|
discoverable_disabled: stageInstance.discoverableDisabled,
|
|
24
|
-
guild_scheduled_event_id: stageInstance.
|
|
24
|
+
guild_scheduled_event_id: stageInstance.guildScheduledEventId,
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -6,14 +6,14 @@ class Stickers {
|
|
|
6
6
|
static stickerFromRaw(sticker) {
|
|
7
7
|
return {
|
|
8
8
|
id: sticker.id,
|
|
9
|
-
|
|
9
|
+
packId: sticker.pack_id,
|
|
10
10
|
name: sticker.name,
|
|
11
11
|
description: sticker.description,
|
|
12
12
|
tags: sticker.tags,
|
|
13
13
|
type: sticker.type,
|
|
14
14
|
formatType: sticker.format_type,
|
|
15
15
|
available: sticker.available,
|
|
16
|
-
|
|
16
|
+
guildId: sticker.id,
|
|
17
17
|
user: sticker.user !== undefined
|
|
18
18
|
? Users_1.Users.userFromRaw(sticker.user)
|
|
19
19
|
: undefined,
|
|
@@ -23,7 +23,7 @@ class Stickers {
|
|
|
23
23
|
static stickerToRaw(sticker) {
|
|
24
24
|
return {
|
|
25
25
|
id: sticker.id,
|
|
26
|
-
pack_id: sticker.
|
|
26
|
+
pack_id: sticker.packId,
|
|
27
27
|
name: sticker.name,
|
|
28
28
|
description: sticker.description,
|
|
29
29
|
tags: sticker.tags,
|
|
@@ -5,10 +5,10 @@ class Subscriptions {
|
|
|
5
5
|
static subscriptionFromRaw(subscription) {
|
|
6
6
|
return {
|
|
7
7
|
id: subscription.id,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
userId: subscription.user_id,
|
|
9
|
+
skuIds: subscription.sku_ids,
|
|
10
|
+
entitlementIds: subscription.entitlement_ids,
|
|
11
|
+
renewalSKUIds: subscription.renewal_sku_ids,
|
|
12
12
|
currentPeriodStart: subscription.current_period_start,
|
|
13
13
|
currentPeriodEnd: subscription.current_period_end,
|
|
14
14
|
status: subscription.status,
|
|
@@ -19,10 +19,10 @@ class Subscriptions {
|
|
|
19
19
|
static subscriptionToRaw(subscription) {
|
|
20
20
|
return {
|
|
21
21
|
id: subscription.id,
|
|
22
|
-
user_id: subscription.
|
|
23
|
-
sku_ids: subscription.
|
|
24
|
-
entitlement_ids: subscription.
|
|
25
|
-
renewal_sku_ids: subscription.
|
|
22
|
+
user_id: subscription.userId,
|
|
23
|
+
sku_ids: subscription.skuIds,
|
|
24
|
+
entitlement_ids: subscription.entitlementIds,
|
|
25
|
+
renewal_sku_ids: subscription.renewalSKUIds,
|
|
26
26
|
current_period_start: subscription.currentPeriodStart,
|
|
27
27
|
current_period_end: subscription.currentPeriodEnd,
|
|
28
28
|
status: subscription.status,
|
|
@@ -9,12 +9,12 @@ class Teams {
|
|
|
9
9
|
id: team.id,
|
|
10
10
|
members: team.members.map((teamMember) => ({
|
|
11
11
|
membershipState: teamMember.membership_state,
|
|
12
|
-
|
|
12
|
+
teamId: teamMember.team_id,
|
|
13
13
|
user: Users_1.Users.userFromRaw(teamMember.user),
|
|
14
14
|
role: teamMember.role,
|
|
15
15
|
})),
|
|
16
16
|
name: team.name,
|
|
17
|
-
|
|
17
|
+
ownerUserId: team.owner_user_id,
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
static teamToRaw(team) {
|
|
@@ -23,12 +23,12 @@ class Teams {
|
|
|
23
23
|
id: team.id,
|
|
24
24
|
members: team.members.map((teamMember) => ({
|
|
25
25
|
membership_state: teamMember.membershipState,
|
|
26
|
-
team_id: teamMember.
|
|
26
|
+
team_id: teamMember.teamId,
|
|
27
27
|
user: Users_1.Users.userToRaw(teamMember.user),
|
|
28
28
|
role: teamMember.role,
|
|
29
29
|
})),
|
|
30
30
|
name: team.name,
|
|
31
|
-
owner_user_id: team.
|
|
31
|
+
owner_user_id: team.ownerUserId,
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -4,7 +4,7 @@ exports.Users = void 0;
|
|
|
4
4
|
class Users {
|
|
5
5
|
static nameplateFromRaw(nameplate) {
|
|
6
6
|
return {
|
|
7
|
-
|
|
7
|
+
skuId: nameplate.sku_id,
|
|
8
8
|
asset: nameplate.asset,
|
|
9
9
|
label: nameplate.label,
|
|
10
10
|
palette: nameplate.palette,
|
|
@@ -12,7 +12,7 @@ class Users {
|
|
|
12
12
|
}
|
|
13
13
|
static nameplateToRaw(nameplate) {
|
|
14
14
|
return {
|
|
15
|
-
sku_id: nameplate.
|
|
15
|
+
sku_id: nameplate.skuId,
|
|
16
16
|
asset: nameplate.asset,
|
|
17
17
|
label: nameplate.label,
|
|
18
18
|
palette: nameplate.palette,
|
|
@@ -40,7 +40,7 @@ class Users {
|
|
|
40
40
|
? user.avatar_decoration_data !== null
|
|
41
41
|
? {
|
|
42
42
|
asset: user.avatar_decoration_data.asset,
|
|
43
|
-
|
|
43
|
+
skuId: user.avatar_decoration_data.sku_id,
|
|
44
44
|
}
|
|
45
45
|
: null
|
|
46
46
|
: undefined,
|
|
@@ -56,7 +56,7 @@ class Users {
|
|
|
56
56
|
primaryGuild: user.primary_guild !== undefined
|
|
57
57
|
? user.primary_guild !== null
|
|
58
58
|
? {
|
|
59
|
-
|
|
59
|
+
identityGuildId: user.primary_guild.identity_guild_id,
|
|
60
60
|
identityEnabled: user.primary_guild.identity_enabled,
|
|
61
61
|
tag: user.primary_guild.tag,
|
|
62
62
|
badge: user.primary_guild.badge,
|
|
@@ -87,7 +87,7 @@ class Users {
|
|
|
87
87
|
? user.avatarDecorationData !== null
|
|
88
88
|
? {
|
|
89
89
|
asset: user.avatarDecorationData.asset,
|
|
90
|
-
sku_id: user.avatarDecorationData.
|
|
90
|
+
sku_id: user.avatarDecorationData.skuId,
|
|
91
91
|
}
|
|
92
92
|
: null
|
|
93
93
|
: undefined,
|
|
@@ -103,7 +103,7 @@ class Users {
|
|
|
103
103
|
primary_guild: user.primaryGuild !== undefined
|
|
104
104
|
? user.primaryGuild !== null
|
|
105
105
|
? {
|
|
106
|
-
identity_guild_id: user.primaryGuild.
|
|
106
|
+
identity_guild_id: user.primaryGuild.identityGuildId,
|
|
107
107
|
identity_enabled: user.primaryGuild.identityEnabled,
|
|
108
108
|
tag: user.primaryGuild.tag,
|
|
109
109
|
badge: user.primaryGuild.badge,
|
|
@@ -5,13 +5,13 @@ const Guilds_1 = require("./Guilds");
|
|
|
5
5
|
class Voice {
|
|
6
6
|
static voiceStateFromRaw(voiceState) {
|
|
7
7
|
return {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
guildId: voiceState.guild_id,
|
|
9
|
+
channelId: voiceState.channel_id,
|
|
10
|
+
userId: voiceState.user_id,
|
|
11
11
|
member: voiceState.member !== undefined
|
|
12
12
|
? Guilds_1.Guilds.guildMemberFromRaw(voiceState.member)
|
|
13
13
|
: undefined,
|
|
14
|
-
|
|
14
|
+
sessionId: voiceState.session_id,
|
|
15
15
|
deaf: voiceState.deaf,
|
|
16
16
|
mute: voiceState.mute,
|
|
17
17
|
selfDeaf: voiceState.self_deaf,
|
|
@@ -24,13 +24,13 @@ class Voice {
|
|
|
24
24
|
}
|
|
25
25
|
static voiceStateToRaw(voiceState) {
|
|
26
26
|
return {
|
|
27
|
-
guild_id: voiceState.
|
|
28
|
-
channel_id: voiceState.
|
|
29
|
-
user_id: voiceState.
|
|
27
|
+
guild_id: voiceState.guildId,
|
|
28
|
+
channel_id: voiceState.channelId,
|
|
29
|
+
user_id: voiceState.userId,
|
|
30
30
|
member: voiceState.member !== undefined
|
|
31
31
|
? Guilds_1.Guilds.guildMemberToRaw(voiceState.member)
|
|
32
32
|
: undefined,
|
|
33
|
-
session_id: voiceState.
|
|
33
|
+
session_id: voiceState.sessionId,
|
|
34
34
|
deaf: voiceState.deaf,
|
|
35
35
|
mute: voiceState.mute,
|
|
36
36
|
self_deaf: voiceState.selfDeaf,
|
|
@@ -9,15 +9,15 @@ class Webhooks {
|
|
|
9
9
|
return {
|
|
10
10
|
id: webhook.id,
|
|
11
11
|
type: webhook.type,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
guildId: webhook.guild_id,
|
|
13
|
+
channelId: webhook.channel_id,
|
|
14
14
|
user: webhook.user !== undefined
|
|
15
15
|
? Users_1.Users.userFromRaw(webhook.user)
|
|
16
16
|
: undefined,
|
|
17
17
|
name: webhook.name,
|
|
18
18
|
avatar: webhook.avatar,
|
|
19
19
|
token: webhook.token,
|
|
20
|
-
|
|
20
|
+
applicationId: webhook.application_id,
|
|
21
21
|
sourceGuild: webhook.source_guild !== undefined
|
|
22
22
|
? Guilds_1.Guilds.guildFromRaw(webhook.source_guild)
|
|
23
23
|
: undefined,
|
|
@@ -31,13 +31,13 @@ class Webhooks {
|
|
|
31
31
|
return {
|
|
32
32
|
id: webhook.id,
|
|
33
33
|
type: webhook.type,
|
|
34
|
-
guild_id: webhook.
|
|
35
|
-
channel_id: webhook.
|
|
34
|
+
guild_id: webhook.guildId,
|
|
35
|
+
channel_id: webhook.channelId,
|
|
36
36
|
user: webhook.user !== undefined ? Users_1.Users.userToRaw(webhook.user) : undefined,
|
|
37
37
|
name: webhook.name,
|
|
38
38
|
avatar: webhook.avatar,
|
|
39
39
|
token: webhook.token,
|
|
40
|
-
application_id: webhook.
|
|
40
|
+
application_id: webhook.applicationId,
|
|
41
41
|
source_guild: webhook.sourceGuild !== undefined
|
|
42
42
|
? Guilds_1.Guilds.guildToRaw(webhook.sourceGuild)
|
|
43
43
|
: undefined,
|
|
@@ -56,11 +56,12 @@ export interface RawApplicationCommandPermission {
|
|
|
56
56
|
type: ApplicationCommandPermissionType;
|
|
57
57
|
permission: boolean;
|
|
58
58
|
}
|
|
59
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */
|
|
59
60
|
export interface ApplicationCommand {
|
|
60
61
|
id: snowflake;
|
|
61
62
|
type?: ApplicationCommandTypes;
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
applicationId: snowflake;
|
|
64
|
+
guildId?: snowflake;
|
|
64
65
|
name: string;
|
|
65
66
|
nameLocalizations?: LocaleMap | null;
|
|
66
67
|
description: string;
|
|
@@ -75,6 +76,7 @@ export interface ApplicationCommand {
|
|
|
75
76
|
version: string;
|
|
76
77
|
handler?: EntryPointCommandHandlerTypes;
|
|
77
78
|
}
|
|
79
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */
|
|
78
80
|
export interface ApplicationCommandOption {
|
|
79
81
|
type: ApplicationCommandOptionType;
|
|
80
82
|
name: string;
|
|
@@ -91,17 +93,20 @@ export interface ApplicationCommandOption {
|
|
|
91
93
|
maxLength?: number;
|
|
92
94
|
autocomplete?: boolean;
|
|
93
95
|
}
|
|
96
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */
|
|
94
97
|
export interface ApplicationCommandOptionChoice {
|
|
95
98
|
name: string;
|
|
96
99
|
nameLocalizations?: LocaleMap | null;
|
|
97
100
|
value: string;
|
|
98
101
|
}
|
|
102
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */
|
|
99
103
|
export interface GuildApplicationCommandPermissions {
|
|
100
104
|
id: snowflake;
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
applicationId: snowflake;
|
|
106
|
+
guildId: snowflake;
|
|
103
107
|
permissions: Array<ApplicationCommandPermission>;
|
|
104
108
|
}
|
|
109
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure */
|
|
105
110
|
export interface ApplicationCommandPermission {
|
|
106
111
|
id: snowflake;
|
|
107
112
|
type: ApplicationCommandPermissionType;
|
|
@@ -9,6 +9,7 @@ export interface RawApplicationRoleConnectionMetadata {
|
|
|
9
9
|
description: string;
|
|
10
10
|
description_localizations?: LocaleMap | null;
|
|
11
11
|
}
|
|
12
|
+
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure */
|
|
12
13
|
export interface ApplicationRoleConnectionMetadata {
|
|
13
14
|
type: ApplicationRoleConnectionMetadataType;
|
|
14
15
|
key: string;
|
|
@@ -61,6 +61,7 @@ export interface RawActivityLocation {
|
|
|
61
61
|
channel_id: snowflake;
|
|
62
62
|
guild_id?: snowflake | null;
|
|
63
63
|
}
|
|
64
|
+
/** https://discord.com/developers/docs/resources/application#application-object-application-structure */
|
|
64
65
|
export interface Application {
|
|
65
66
|
id: snowflake;
|
|
66
67
|
name: string;
|
|
@@ -74,9 +75,9 @@ export interface Application {
|
|
|
74
75
|
owner?: User;
|
|
75
76
|
verifyKey: string;
|
|
76
77
|
team: Team | null;
|
|
77
|
-
|
|
78
|
+
guildId?: snowflake;
|
|
78
79
|
guild?: Guild;
|
|
79
|
-
|
|
80
|
+
primarySKUId?: snowflake;
|
|
80
81
|
slug?: string;
|
|
81
82
|
coverImage?: string;
|
|
82
83
|
flags?: ApplicationFlags;
|
|
@@ -94,23 +95,27 @@ export interface Application {
|
|
|
94
95
|
integrationTypesConfig?: Record<ApplicationIntegrationTypes, ApplicationIntegrationTypeConfiguration>;
|
|
95
96
|
customInstallURL?: string;
|
|
96
97
|
}
|
|
98
|
+
/** https://discord.com/developers/docs/resources/application#application-object-application-integration-type-configuration-object */
|
|
97
99
|
export interface ApplicationIntegrationTypeConfiguration {
|
|
98
100
|
oauth2InstallParams: InstallParams;
|
|
99
101
|
}
|
|
102
|
+
/** https://discord.com/developers/docs/resources/application#install-params-object-install-params-structure */
|
|
100
103
|
export interface InstallParams {
|
|
101
104
|
scopes: Array<OAuth2Scopes>;
|
|
102
105
|
permissions: string;
|
|
103
106
|
}
|
|
107
|
+
/** https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-instance-object */
|
|
104
108
|
export interface ActivityInstance {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
109
|
+
applicationId: snowflake;
|
|
110
|
+
instanceId: string;
|
|
111
|
+
launchId: snowflake;
|
|
108
112
|
location: ActivityLocation;
|
|
109
113
|
users: Array<snowflake>;
|
|
110
114
|
}
|
|
115
|
+
/** https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-location-object */
|
|
111
116
|
export interface ActivityLocation {
|
|
112
117
|
id: string;
|
|
113
118
|
kind: ActivityLocationKind;
|
|
114
|
-
|
|
115
|
-
|
|
119
|
+
channelId: snowflake;
|
|
120
|
+
guildId?: snowflake | null;
|
|
116
121
|
}
|
|
@@ -49,6 +49,7 @@ export interface RawAuditLogChange {
|
|
|
49
49
|
old_value?: any;
|
|
50
50
|
key: string;
|
|
51
51
|
}
|
|
52
|
+
/** https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure */
|
|
52
53
|
export interface AuditLog {
|
|
53
54
|
applicationCommands: Array<ApplicationCommand>;
|
|
54
55
|
auditLogEntries: Array<AuditLogEntry>;
|
|
@@ -59,29 +60,32 @@ export interface AuditLog {
|
|
|
59
60
|
users: Array<User>;
|
|
60
61
|
webhooks: Array<Webhook>;
|
|
61
62
|
}
|
|
63
|
+
/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure */
|
|
62
64
|
export interface AuditLogEntry {
|
|
63
|
-
|
|
65
|
+
targetId: snowflake | null;
|
|
64
66
|
changes?: Array<AuditLogChange>;
|
|
65
|
-
|
|
67
|
+
userId: snowflake | null;
|
|
66
68
|
id: snowflake;
|
|
67
69
|
actionType: AuditLogEvents;
|
|
68
70
|
options?: OptionalAuditLogEntryInfo;
|
|
69
71
|
reason?: string;
|
|
70
72
|
}
|
|
73
|
+
/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info */
|
|
71
74
|
export interface OptionalAuditLogEntryInfo {
|
|
72
|
-
|
|
75
|
+
applicationId: snowflake;
|
|
73
76
|
autoModerationRuleName: string;
|
|
74
77
|
autoModerationRuleTriggerType: string;
|
|
75
|
-
|
|
78
|
+
channelId: snowflake;
|
|
76
79
|
count: string;
|
|
77
80
|
deleteMemberDays: string;
|
|
78
81
|
id: snowflake;
|
|
79
82
|
membersRemoved: string;
|
|
80
|
-
|
|
83
|
+
messageId: snowflake;
|
|
81
84
|
roleName: string;
|
|
82
85
|
type: string;
|
|
83
86
|
integrationType: string;
|
|
84
87
|
}
|
|
88
|
+
/** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */
|
|
85
89
|
export interface AuditLogChange {
|
|
86
90
|
newValue?: any;
|
|
87
91
|
oldValue?: any;
|