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
|
@@ -11,26 +11,26 @@ const Webhooks_1 = require("./Webhooks");
|
|
|
11
11
|
class AuditLogs {
|
|
12
12
|
static auditLogEntryFromRaw(auditLogEntry) {
|
|
13
13
|
return {
|
|
14
|
-
|
|
14
|
+
targetId: auditLogEntry.target_id,
|
|
15
15
|
changes: auditLogEntry.changes?.map((auditLogChange) => ({
|
|
16
16
|
newValue: auditLogChange.new_value,
|
|
17
17
|
oldValue: auditLogChange.old_value,
|
|
18
18
|
key: auditLogChange.key,
|
|
19
19
|
})),
|
|
20
|
-
|
|
20
|
+
userId: auditLogEntry.user_id,
|
|
21
21
|
id: auditLogEntry.id,
|
|
22
22
|
actionType: auditLogEntry.action_type,
|
|
23
23
|
options: auditLogEntry.options !== undefined
|
|
24
24
|
? {
|
|
25
|
-
|
|
25
|
+
applicationId: auditLogEntry.options.application_id,
|
|
26
26
|
autoModerationRuleName: auditLogEntry.options.auto_moderation_rule_name,
|
|
27
27
|
autoModerationRuleTriggerType: auditLogEntry.options.auto_moderation_rule_trigger_type,
|
|
28
|
-
|
|
28
|
+
channelId: auditLogEntry.options.channel_id,
|
|
29
29
|
count: auditLogEntry.options.count,
|
|
30
30
|
deleteMemberDays: auditLogEntry.options.delete_member_days,
|
|
31
31
|
id: auditLogEntry.options.id,
|
|
32
32
|
membersRemoved: auditLogEntry.options.members_removed,
|
|
33
|
-
|
|
33
|
+
messageId: auditLogEntry.options.message_id,
|
|
34
34
|
roleName: auditLogEntry.options.role_name,
|
|
35
35
|
type: auditLogEntry.options.type,
|
|
36
36
|
integrationType: auditLogEntry.options.integration_type,
|
|
@@ -41,26 +41,26 @@ class AuditLogs {
|
|
|
41
41
|
}
|
|
42
42
|
static auditLogEntryToRaw(auditLogEntry) {
|
|
43
43
|
return {
|
|
44
|
-
target_id: auditLogEntry.
|
|
44
|
+
target_id: auditLogEntry.targetId,
|
|
45
45
|
changes: auditLogEntry.changes?.map((auditLogChange) => ({
|
|
46
46
|
new_value: auditLogChange.newValue,
|
|
47
47
|
old_value: auditLogChange.oldValue,
|
|
48
48
|
key: auditLogChange.key,
|
|
49
49
|
})),
|
|
50
|
-
user_id: auditLogEntry.
|
|
50
|
+
user_id: auditLogEntry.userId,
|
|
51
51
|
id: auditLogEntry.id,
|
|
52
52
|
action_type: auditLogEntry.actionType,
|
|
53
53
|
options: auditLogEntry.options !== undefined
|
|
54
54
|
? {
|
|
55
|
-
application_id: auditLogEntry.options.
|
|
55
|
+
application_id: auditLogEntry.options.applicationId,
|
|
56
56
|
auto_moderation_rule_name: auditLogEntry.options.autoModerationRuleName,
|
|
57
57
|
auto_moderation_rule_trigger_type: auditLogEntry.options.autoModerationRuleTriggerType,
|
|
58
|
-
channel_id: auditLogEntry.options.
|
|
58
|
+
channel_id: auditLogEntry.options.channelId,
|
|
59
59
|
count: auditLogEntry.options.count,
|
|
60
60
|
delete_member_days: auditLogEntry.options.deleteMemberDays,
|
|
61
61
|
id: auditLogEntry.options.id,
|
|
62
62
|
members_removed: auditLogEntry.options.membersRemoved,
|
|
63
|
-
message_id: auditLogEntry.options.
|
|
63
|
+
message_id: auditLogEntry.options.messageId,
|
|
64
64
|
role_name: auditLogEntry.options.roleName,
|
|
65
65
|
type: auditLogEntry.options.type,
|
|
66
66
|
integration_type: auditLogEntry.options.integrationType,
|
|
@@ -6,7 +6,7 @@ class AutoModeration {
|
|
|
6
6
|
return {
|
|
7
7
|
type: action.type,
|
|
8
8
|
metadata: {
|
|
9
|
-
|
|
9
|
+
channelId: action.metadata.channel_id,
|
|
10
10
|
durationSeconds: action.metadata.duration_seconds,
|
|
11
11
|
customMessage: action.metadata.custom_message,
|
|
12
12
|
},
|
|
@@ -16,7 +16,7 @@ class AutoModeration {
|
|
|
16
16
|
return {
|
|
17
17
|
type: action.type,
|
|
18
18
|
metadata: {
|
|
19
|
-
channel_id: action.metadata.
|
|
19
|
+
channel_id: action.metadata.channelId,
|
|
20
20
|
duration_seconds: action.metadata.durationSeconds,
|
|
21
21
|
custom_message: action.metadata.customMessage,
|
|
22
22
|
},
|
|
@@ -25,9 +25,9 @@ class AutoModeration {
|
|
|
25
25
|
static autoModerationRuleFromRaw(autoModerationRule) {
|
|
26
26
|
return {
|
|
27
27
|
id: autoModerationRule.id,
|
|
28
|
-
|
|
28
|
+
guildId: autoModerationRule.guild_id,
|
|
29
29
|
name: autoModerationRule.name,
|
|
30
|
-
|
|
30
|
+
creatorId: autoModerationRule.creator_id,
|
|
31
31
|
eventType: autoModerationRule.event_type,
|
|
32
32
|
triggerType: autoModerationRule.trigger_type,
|
|
33
33
|
triggerMetadata: this.triggerMetadataFromRaw(autoModerationRule.trigger_metadata),
|
|
@@ -40,9 +40,9 @@ class AutoModeration {
|
|
|
40
40
|
static autoModerationRuleToRaw(autoModerationRule) {
|
|
41
41
|
return {
|
|
42
42
|
id: autoModerationRule.id,
|
|
43
|
-
guild_id: autoModerationRule.
|
|
43
|
+
guild_id: autoModerationRule.guildId,
|
|
44
44
|
name: autoModerationRule.name,
|
|
45
|
-
creator_id: autoModerationRule.
|
|
45
|
+
creator_id: autoModerationRule.creatorId,
|
|
46
46
|
event_type: autoModerationRule.eventType,
|
|
47
47
|
trigger_type: autoModerationRule.triggerType,
|
|
48
48
|
trigger_metadata: this.triggerMetadataToRaw(autoModerationRule.triggerMetadata),
|
|
@@ -8,7 +8,7 @@ class Channels {
|
|
|
8
8
|
return {
|
|
9
9
|
id: channel.id,
|
|
10
10
|
type: channel.type,
|
|
11
|
-
|
|
11
|
+
guildId: channel.guild_id,
|
|
12
12
|
position: channel.position,
|
|
13
13
|
permissionOverwrites: channel.permission_overwrites?.map((overwrite) => ({
|
|
14
14
|
id: overwrite.id,
|
|
@@ -19,16 +19,16 @@ class Channels {
|
|
|
19
19
|
name: channel.name,
|
|
20
20
|
topic: channel.topic,
|
|
21
21
|
nsfw: channel.nsfw,
|
|
22
|
-
|
|
22
|
+
lastMessageId: channel.last_message_id,
|
|
23
23
|
bitrate: channel.bitrate,
|
|
24
24
|
userLimit: channel.user_limit,
|
|
25
25
|
rateLimitPerUser: channel.rate_limit_per_user,
|
|
26
26
|
recipients: channel.recipients?.map((recipient) => Users_1.Users.userFromRaw(recipient)),
|
|
27
27
|
icon: channel.icon,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
ownerId: channel.owner_id,
|
|
29
|
+
applicationId: channel.application_id,
|
|
30
30
|
managed: channel.managed,
|
|
31
|
-
|
|
31
|
+
parentId: channel.parent_id,
|
|
32
32
|
lastPinTimestamp: channel.last_pin_timestamp,
|
|
33
33
|
rtcRegion: channel.rtc_region,
|
|
34
34
|
videoQualityMode: channel.video_quality_mode,
|
|
@@ -55,14 +55,14 @@ class Channels {
|
|
|
55
55
|
id: availableTag.id,
|
|
56
56
|
name: availableTag.name,
|
|
57
57
|
moderated: availableTag.moderated,
|
|
58
|
-
|
|
58
|
+
emojiId: availableTag.emoji_id,
|
|
59
59
|
emojiName: availableTag.emoji_name,
|
|
60
60
|
})),
|
|
61
61
|
appliedTags: channel.applied_tags,
|
|
62
62
|
defaultReactionEmoji: channel.default_reaction_emoji !== undefined
|
|
63
63
|
? channel.default_reaction_emoji !== null
|
|
64
64
|
? {
|
|
65
|
-
|
|
65
|
+
emojiId: channel.default_reaction_emoji.emoji_id,
|
|
66
66
|
emojiName: channel.default_reaction_emoji.emoji_name,
|
|
67
67
|
}
|
|
68
68
|
: null
|
|
@@ -76,7 +76,7 @@ class Channels {
|
|
|
76
76
|
return {
|
|
77
77
|
id: channel.id,
|
|
78
78
|
type: channel.type,
|
|
79
|
-
guild_id: channel.
|
|
79
|
+
guild_id: channel.guildId,
|
|
80
80
|
position: channel.position,
|
|
81
81
|
permission_overwrites: channel.permissionOverwrites?.map((overwrite) => ({
|
|
82
82
|
id: overwrite.id,
|
|
@@ -87,16 +87,16 @@ class Channels {
|
|
|
87
87
|
name: channel.name,
|
|
88
88
|
topic: channel.topic,
|
|
89
89
|
nsfw: channel.nsfw,
|
|
90
|
-
last_message_id: channel.
|
|
90
|
+
last_message_id: channel.lastMessageId,
|
|
91
91
|
bitrate: channel.bitrate,
|
|
92
92
|
user_limit: channel.userLimit,
|
|
93
93
|
rate_limit_per_user: channel.rateLimitPerUser,
|
|
94
94
|
recipients: channel.recipients?.map((recipient) => Users_1.Users.userToRaw(recipient)),
|
|
95
95
|
icon: channel.icon,
|
|
96
|
-
owner_id: channel.
|
|
97
|
-
application_id: channel.
|
|
96
|
+
owner_id: channel.ownerId,
|
|
97
|
+
application_id: channel.applicationId,
|
|
98
98
|
managed: channel.managed,
|
|
99
|
-
parent_id: channel.
|
|
99
|
+
parent_id: channel.parentId,
|
|
100
100
|
last_pin_timestamp: channel.lastPinTimestamp,
|
|
101
101
|
rtc_region: channel.rtcRegion,
|
|
102
102
|
video_quality_mode: channel.videoQualityMode,
|
|
@@ -123,14 +123,14 @@ class Channels {
|
|
|
123
123
|
id: availableTag.id,
|
|
124
124
|
name: availableTag.name,
|
|
125
125
|
moderated: availableTag.moderated,
|
|
126
|
-
emoji_id: availableTag.
|
|
126
|
+
emoji_id: availableTag.emojiId,
|
|
127
127
|
emoji_name: availableTag.emojiName,
|
|
128
128
|
})),
|
|
129
129
|
applied_tags: channel.appliedTags,
|
|
130
130
|
default_reaction_emoji: channel.defaultReactionEmoji !== undefined
|
|
131
131
|
? channel.defaultReactionEmoji !== null
|
|
132
132
|
? {
|
|
133
|
-
emoji_id: channel.defaultReactionEmoji.
|
|
133
|
+
emoji_id: channel.defaultReactionEmoji.emojiId,
|
|
134
134
|
emoji_name: channel.defaultReactionEmoji.emojiName,
|
|
135
135
|
}
|
|
136
136
|
: null
|
|
@@ -143,7 +143,7 @@ class Channels {
|
|
|
143
143
|
static threadMemberFromRaw(threadMember) {
|
|
144
144
|
return {
|
|
145
145
|
id: threadMember.id,
|
|
146
|
-
|
|
146
|
+
userId: threadMember.user_id,
|
|
147
147
|
joinTimestamp: threadMember.join_timestamp,
|
|
148
148
|
flags: threadMember.flags,
|
|
149
149
|
member: threadMember.member !== undefined
|
|
@@ -154,7 +154,7 @@ class Channels {
|
|
|
154
154
|
static threadMemberToRaw(threadMember) {
|
|
155
155
|
return {
|
|
156
156
|
id: threadMember.id,
|
|
157
|
-
user_id: threadMember.
|
|
157
|
+
user_id: threadMember.userId,
|
|
158
158
|
join_timestamp: threadMember.joinTimestamp,
|
|
159
159
|
flags: threadMember.flags,
|
|
160
160
|
member: threadMember.member !== undefined
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionRow, Button, Container, RawActionRow, RawButton, RawContainer, RawFile, File, RawUnfurledMediaItem, UnfurledMediaItem, RawTextDisplay, TextDisplay, RawSeparator, Separator, RawSection, Section, Thumbnail, RawThumbnail, TextInput, RawTextInput, MediaGallery, RawMediaGallery, RawStringSelect, StringSelect, RawUserSelect, UserSelect, RawRoleSelect, RoleSelect, RawMentionableSelect, MentionableSelect, RawChannelSelect, ChannelSelect, RawLabel, Label } from "../types/components";
|
|
1
|
+
import { ActionRow, Button, Container, RawActionRow, RawButton, RawContainer, RawFile, File, RawUnfurledMediaItem, UnfurledMediaItem, RawTextDisplay, TextDisplay, RawSeparator, Separator, RawSection, Section, Thumbnail, RawThumbnail, TextInput, RawTextInput, MediaGallery, RawMediaGallery, RawStringSelect, StringSelect, RawUserSelect, UserSelect, RawRoleSelect, RoleSelect, RawMentionableSelect, MentionableSelect, RawChannelSelect, ChannelSelect, RawLabel, Label, RawFileUpload, FileUpload } from "../types/components";
|
|
2
2
|
export declare class Components {
|
|
3
3
|
static actionRowFromRaw(actionRow: RawActionRow): ActionRow;
|
|
4
4
|
static actionRowToRaw(actionRow: ActionRow): RawActionRow;
|
|
@@ -10,6 +10,8 @@ export declare class Components {
|
|
|
10
10
|
static containerToRaw(container: Container): RawContainer;
|
|
11
11
|
static fileFromRaw(file: RawFile): File;
|
|
12
12
|
static fileToRaw(file: File): RawFile;
|
|
13
|
+
static fileUploadFromRaw(fileUpload: RawFileUpload): FileUpload;
|
|
14
|
+
static fileUploadToRaw(fileUpload: FileUpload): RawFileUpload;
|
|
13
15
|
static labelFromRaw(label: RawLabel): Label;
|
|
14
16
|
static labelToRaw(label: Label): RawLabel;
|
|
15
17
|
static mediaGalleryFromRaw(mediaGallery: RawMediaGallery): MediaGallery;
|
|
@@ -57,8 +57,8 @@ class Components {
|
|
|
57
57
|
style: button.style,
|
|
58
58
|
label: button.label,
|
|
59
59
|
emoji: button.emoji,
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
customId: button.custom_id,
|
|
61
|
+
skuId: button.sku_id,
|
|
62
62
|
url: button.url,
|
|
63
63
|
disabled: button.disabled,
|
|
64
64
|
id: button.id,
|
|
@@ -70,8 +70,8 @@ class Components {
|
|
|
70
70
|
style: button.style,
|
|
71
71
|
label: button.label,
|
|
72
72
|
emoji: button.emoji,
|
|
73
|
-
custom_id: button.
|
|
74
|
-
sku_id: button.
|
|
73
|
+
custom_id: button.customId,
|
|
74
|
+
sku_id: button.skuId,
|
|
75
75
|
url: button.url,
|
|
76
76
|
disabled: button.disabled,
|
|
77
77
|
id: button.id,
|
|
@@ -81,7 +81,7 @@ class Components {
|
|
|
81
81
|
return {
|
|
82
82
|
type: channelSelect.type,
|
|
83
83
|
id: channelSelect.id,
|
|
84
|
-
|
|
84
|
+
customId: channelSelect.custom_id,
|
|
85
85
|
channelTypes: channelSelect.channel_types,
|
|
86
86
|
placeholder: channelSelect.placeholder,
|
|
87
87
|
defaultValues: channelSelect.default_values,
|
|
@@ -94,7 +94,7 @@ class Components {
|
|
|
94
94
|
return {
|
|
95
95
|
type: channelSelect.type,
|
|
96
96
|
id: channelSelect.id,
|
|
97
|
-
custom_id: channelSelect.
|
|
97
|
+
custom_id: channelSelect.customId,
|
|
98
98
|
channel_types: channelSelect.channelTypes,
|
|
99
99
|
placeholder: channelSelect.placeholder,
|
|
100
100
|
default_values: channelSelect.defaultValues,
|
|
@@ -183,6 +183,26 @@ class Components {
|
|
|
183
183
|
size: file.size,
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
+
static fileUploadFromRaw(fileUpload) {
|
|
187
|
+
return {
|
|
188
|
+
type: fileUpload.type,
|
|
189
|
+
id: fileUpload.id,
|
|
190
|
+
customId: fileUpload.custom_id,
|
|
191
|
+
minValues: fileUpload.min_values,
|
|
192
|
+
maxValues: fileUpload.max_values,
|
|
193
|
+
required: fileUpload.required,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
static fileUploadToRaw(fileUpload) {
|
|
197
|
+
return {
|
|
198
|
+
type: fileUpload.type,
|
|
199
|
+
id: fileUpload.id,
|
|
200
|
+
custom_id: fileUpload.customId,
|
|
201
|
+
min_values: fileUpload.minValues,
|
|
202
|
+
max_values: fileUpload.maxValues,
|
|
203
|
+
required: fileUpload.required,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
186
206
|
static labelFromRaw(label) {
|
|
187
207
|
let component;
|
|
188
208
|
switch (label.component.type) {
|
|
@@ -204,6 +224,9 @@ class Components {
|
|
|
204
224
|
case constants_1.ComponentTypes.ChannelSelect:
|
|
205
225
|
component = Components.channelSelectFromRaw(label.component);
|
|
206
226
|
break;
|
|
227
|
+
case constants_1.ComponentTypes.FileUpload:
|
|
228
|
+
component = Components.fileUploadFromRaw(label.component);
|
|
229
|
+
break;
|
|
207
230
|
}
|
|
208
231
|
return {
|
|
209
232
|
type: label.type,
|
|
@@ -234,6 +257,9 @@ class Components {
|
|
|
234
257
|
case constants_1.ComponentTypes.ChannelSelect:
|
|
235
258
|
component = Components.channelSelectToRaw(label.component);
|
|
236
259
|
break;
|
|
260
|
+
case constants_1.ComponentTypes.FileUpload:
|
|
261
|
+
component = Components.fileUploadToRaw(label.component);
|
|
262
|
+
break;
|
|
237
263
|
}
|
|
238
264
|
return {
|
|
239
265
|
type: label.type,
|
|
@@ -269,7 +295,7 @@ class Components {
|
|
|
269
295
|
return {
|
|
270
296
|
type: mentionableSelect.type,
|
|
271
297
|
id: mentionableSelect.id,
|
|
272
|
-
|
|
298
|
+
customId: mentionableSelect.custom_id,
|
|
273
299
|
placeholder: mentionableSelect.placeholder,
|
|
274
300
|
defaultValues: mentionableSelect.default_values,
|
|
275
301
|
minValues: mentionableSelect.min_values,
|
|
@@ -281,7 +307,7 @@ class Components {
|
|
|
281
307
|
return {
|
|
282
308
|
type: mentionableSelect.type,
|
|
283
309
|
id: mentionableSelect.id,
|
|
284
|
-
custom_id: mentionableSelect.
|
|
310
|
+
custom_id: mentionableSelect.customId,
|
|
285
311
|
placeholder: mentionableSelect.placeholder,
|
|
286
312
|
default_values: mentionableSelect.defaultValues,
|
|
287
313
|
min_values: mentionableSelect.minValues,
|
|
@@ -293,7 +319,7 @@ class Components {
|
|
|
293
319
|
return {
|
|
294
320
|
type: roleSelect.type,
|
|
295
321
|
id: roleSelect.id,
|
|
296
|
-
|
|
322
|
+
customId: roleSelect.custom_id,
|
|
297
323
|
placeholder: roleSelect.placeholder,
|
|
298
324
|
defaultValues: roleSelect.default_values,
|
|
299
325
|
minValues: roleSelect.min_values,
|
|
@@ -305,7 +331,7 @@ class Components {
|
|
|
305
331
|
return {
|
|
306
332
|
type: roleSelect.type,
|
|
307
333
|
id: roleSelect.id,
|
|
308
|
-
custom_id: roleSelect.
|
|
334
|
+
custom_id: roleSelect.customId,
|
|
309
335
|
placeholder: roleSelect.placeholder,
|
|
310
336
|
default_values: roleSelect.defaultValues,
|
|
311
337
|
min_values: roleSelect.minValues,
|
|
@@ -377,7 +403,7 @@ class Components {
|
|
|
377
403
|
return {
|
|
378
404
|
type: stringSelect.type,
|
|
379
405
|
id: stringSelect.id,
|
|
380
|
-
|
|
406
|
+
customId: stringSelect.custom_id,
|
|
381
407
|
placeholder: stringSelect.placeholder,
|
|
382
408
|
options: stringSelect.options?.map((option) => ({
|
|
383
409
|
label: option.label,
|
|
@@ -400,7 +426,7 @@ class Components {
|
|
|
400
426
|
static stringSelectToRaw(stringSelect) {
|
|
401
427
|
return {
|
|
402
428
|
type: stringSelect.type,
|
|
403
|
-
custom_id: stringSelect.
|
|
429
|
+
custom_id: stringSelect.customId,
|
|
404
430
|
placeholder: stringSelect.placeholder,
|
|
405
431
|
options: stringSelect.options?.map((option) => ({
|
|
406
432
|
label: option.label,
|
|
@@ -437,7 +463,7 @@ class Components {
|
|
|
437
463
|
static textInputFromRaw(textInput) {
|
|
438
464
|
return {
|
|
439
465
|
type: textInput.type,
|
|
440
|
-
|
|
466
|
+
customId: textInput.custom_id,
|
|
441
467
|
style: textInput.style,
|
|
442
468
|
minLength: textInput.min_length,
|
|
443
469
|
maxLength: textInput.max_length,
|
|
@@ -451,7 +477,7 @@ class Components {
|
|
|
451
477
|
static textInputToRaw(textInput) {
|
|
452
478
|
return {
|
|
453
479
|
type: textInput.type,
|
|
454
|
-
custom_id: textInput.
|
|
480
|
+
custom_id: textInput.customId,
|
|
455
481
|
style: textInput.style,
|
|
456
482
|
min_length: textInput.minLength,
|
|
457
483
|
max_length: textInput.maxLength,
|
|
@@ -502,7 +528,7 @@ class Components {
|
|
|
502
528
|
return {
|
|
503
529
|
type: userSelect.type,
|
|
504
530
|
id: userSelect.id,
|
|
505
|
-
|
|
531
|
+
customId: userSelect.custom_id,
|
|
506
532
|
placeholder: userSelect.placeholder,
|
|
507
533
|
defaultValues: userSelect.default_values,
|
|
508
534
|
minValues: userSelect.min_values,
|
|
@@ -514,7 +540,7 @@ class Components {
|
|
|
514
540
|
return {
|
|
515
541
|
type: userSelect.type,
|
|
516
542
|
id: userSelect.id,
|
|
517
|
-
custom_id: userSelect.
|
|
543
|
+
custom_id: userSelect.customId,
|
|
518
544
|
placeholder: userSelect.placeholder,
|
|
519
545
|
default_values: userSelect.defaultValues,
|
|
520
546
|
min_values: userSelect.minValues,
|
|
@@ -2,6 +2,6 @@ import type { RawEntitlement, Entitlement } from "../types/entitlements";
|
|
|
2
2
|
export declare class Entitlements {
|
|
3
3
|
static entitlementFromRaw(entitlement: RawEntitlement): Entitlement;
|
|
4
4
|
static entitlementToRaw(entitlement: Entitlement): RawEntitlement;
|
|
5
|
-
static testEntitlementFromRaw(entitlement: Omit<RawEntitlement, "starts_at" | "ends_at" | "subscription_id">): Omit<Entitlement, "startsAt" | "endsAt" | "
|
|
6
|
-
static testEntitlementToRaw(entitlement: Omit<Entitlement, "startsAt" | "endsAt" | "
|
|
5
|
+
static testEntitlementFromRaw(entitlement: Omit<RawEntitlement, "starts_at" | "ends_at" | "subscription_id">): Omit<Entitlement, "startsAt" | "endsAt" | "subscriptionId">;
|
|
6
|
+
static testEntitlementToRaw(entitlement: Omit<Entitlement, "startsAt" | "endsAt" | "subscriptionId">): Omit<RawEntitlement, "starts_at" | "ends_at" | "subscription_id">;
|
|
7
7
|
}
|
|
@@ -5,53 +5,53 @@ class Entitlements {
|
|
|
5
5
|
static entitlementFromRaw(entitlement) {
|
|
6
6
|
return {
|
|
7
7
|
id: entitlement.id,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
skuId: entitlement.sku_id,
|
|
9
|
+
applicationId: entitlement.application_id,
|
|
10
|
+
userId: entitlement.user_id,
|
|
11
11
|
type: entitlement.type,
|
|
12
12
|
deleted: entitlement.deleted,
|
|
13
13
|
consumed: entitlement.consumed,
|
|
14
14
|
startsAt: entitlement.starts_at,
|
|
15
15
|
endsAt: entitlement.ends_at,
|
|
16
|
-
|
|
16
|
+
guildId: entitlement.guild_id,
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
static entitlementToRaw(entitlement) {
|
|
20
20
|
return {
|
|
21
21
|
id: entitlement.id,
|
|
22
|
-
sku_id: entitlement.
|
|
23
|
-
application_id: entitlement.
|
|
24
|
-
user_id: entitlement.
|
|
22
|
+
sku_id: entitlement.skuId,
|
|
23
|
+
application_id: entitlement.applicationId,
|
|
24
|
+
user_id: entitlement.userId,
|
|
25
25
|
type: entitlement.type,
|
|
26
26
|
deleted: entitlement.deleted,
|
|
27
27
|
consumed: entitlement.consumed,
|
|
28
28
|
starts_at: entitlement.startsAt,
|
|
29
29
|
ends_at: entitlement.endsAt,
|
|
30
|
-
guild_id: entitlement.
|
|
30
|
+
guild_id: entitlement.guildId,
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
static testEntitlementFromRaw(entitlement) {
|
|
34
34
|
return {
|
|
35
35
|
id: entitlement.id,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
skuId: entitlement.sku_id,
|
|
37
|
+
applicationId: entitlement.application_id,
|
|
38
|
+
userId: entitlement.user_id,
|
|
39
39
|
type: entitlement.type,
|
|
40
40
|
deleted: entitlement.deleted,
|
|
41
41
|
consumed: entitlement.consumed,
|
|
42
|
-
|
|
42
|
+
guildId: entitlement.guild_id,
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
static testEntitlementToRaw(entitlement) {
|
|
46
46
|
return {
|
|
47
47
|
id: entitlement.id,
|
|
48
|
-
sku_id: entitlement.
|
|
49
|
-
application_id: entitlement.
|
|
50
|
-
user_id: entitlement.
|
|
48
|
+
sku_id: entitlement.skuId,
|
|
49
|
+
application_id: entitlement.applicationId,
|
|
50
|
+
user_id: entitlement.userId,
|
|
51
51
|
type: entitlement.type,
|
|
52
52
|
deleted: entitlement.deleted,
|
|
53
53
|
consumed: entitlement.consumed,
|
|
54
|
-
guild_id: entitlement.
|
|
54
|
+
guild_id: entitlement.guildId,
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -34,9 +34,9 @@ class GuildScheduledEvents {
|
|
|
34
34
|
static guildScheduledEventFromRaw(guildScheduledEvent) {
|
|
35
35
|
return {
|
|
36
36
|
id: guildScheduledEvent.id,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
guildId: guildScheduledEvent.guild_id,
|
|
38
|
+
channelId: guildScheduledEvent.channel_id,
|
|
39
|
+
creatorId: guildScheduledEvent.creator_id,
|
|
40
40
|
name: guildScheduledEvent.name,
|
|
41
41
|
description: guildScheduledEvent.description,
|
|
42
42
|
scheduledStartTime: guildScheduledEvent.scheduled_start_time,
|
|
@@ -44,7 +44,7 @@ class GuildScheduledEvents {
|
|
|
44
44
|
privacyLevel: guildScheduledEvent.privacy_level,
|
|
45
45
|
status: guildScheduledEvent.status,
|
|
46
46
|
entityType: guildScheduledEvent.entity_type,
|
|
47
|
-
|
|
47
|
+
entityId: guildScheduledEvent.entity_id,
|
|
48
48
|
entityMetadata: guildScheduledEvent.entity_metadata,
|
|
49
49
|
creator: guildScheduledEvent.creator !== undefined
|
|
50
50
|
? Users_1.Users.userFromRaw(guildScheduledEvent.creator)
|
|
@@ -59,9 +59,9 @@ class GuildScheduledEvents {
|
|
|
59
59
|
static guildScheduledEventToRaw(guildScheduledEvent) {
|
|
60
60
|
return {
|
|
61
61
|
id: guildScheduledEvent.id,
|
|
62
|
-
guild_id: guildScheduledEvent.
|
|
63
|
-
channel_id: guildScheduledEvent.
|
|
64
|
-
creator_id: guildScheduledEvent.
|
|
62
|
+
guild_id: guildScheduledEvent.guildId,
|
|
63
|
+
channel_id: guildScheduledEvent.channelId,
|
|
64
|
+
creator_id: guildScheduledEvent.creatorId,
|
|
65
65
|
name: guildScheduledEvent.name,
|
|
66
66
|
description: guildScheduledEvent.description,
|
|
67
67
|
scheduled_start_time: guildScheduledEvent.scheduledStartTime,
|
|
@@ -69,7 +69,7 @@ class GuildScheduledEvents {
|
|
|
69
69
|
privacy_level: guildScheduledEvent.privacyLevel,
|
|
70
70
|
status: guildScheduledEvent.status,
|
|
71
71
|
entity_type: guildScheduledEvent.entityType,
|
|
72
|
-
entity_id: guildScheduledEvent.
|
|
72
|
+
entity_id: guildScheduledEvent.entityId,
|
|
73
73
|
entity_metadata: guildScheduledEvent.entityMetadata,
|
|
74
74
|
creator: guildScheduledEvent.creator !== undefined
|
|
75
75
|
? Users_1.Users.userToRaw(guildScheduledEvent.creator)
|
|
@@ -10,11 +10,11 @@ class GuildTemplates {
|
|
|
10
10
|
name: guildTemplate.name,
|
|
11
11
|
description: guildTemplate.description,
|
|
12
12
|
usageCount: guildTemplate.usage_count,
|
|
13
|
-
|
|
13
|
+
creatorId: guildTemplate.creator_id,
|
|
14
14
|
creator: Users_1.Users.userFromRaw(guildTemplate.creator),
|
|
15
15
|
createdAt: guildTemplate.created_at,
|
|
16
16
|
updatedAt: guildTemplate.updated_at,
|
|
17
|
-
|
|
17
|
+
sourceGuildId: guildTemplate.source_guild_id,
|
|
18
18
|
serializedSourceGuild: Guilds_1.Guilds.guildFromRaw(guildTemplate.serialized_source_guild),
|
|
19
19
|
isDirty: guildTemplate.is_dirty,
|
|
20
20
|
};
|
|
@@ -25,11 +25,11 @@ class GuildTemplates {
|
|
|
25
25
|
name: guildTemplate.name,
|
|
26
26
|
description: guildTemplate.description,
|
|
27
27
|
usage_count: guildTemplate.usageCount,
|
|
28
|
-
creator_id: guildTemplate.
|
|
28
|
+
creator_id: guildTemplate.creatorId,
|
|
29
29
|
creator: Users_1.Users.userToRaw(guildTemplate.creator),
|
|
30
30
|
created_at: guildTemplate.createdAt,
|
|
31
31
|
updated_at: guildTemplate.updatedAt,
|
|
32
|
-
source_guild_id: guildTemplate.
|
|
32
|
+
source_guild_id: guildTemplate.sourceGuildId,
|
|
33
33
|
serialized_source_guild: Guilds_1.Guilds.guildToRaw(guildTemplate.serializedSourceGuild),
|
|
34
34
|
is_dirty: guildTemplate.isDirty,
|
|
35
35
|
};
|