disgroove 3.0.1-dev.739a5a9 → 3.0.1-dev.c1d6d42
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 +38 -8
- package/dist/lib/Client.d.ts +45 -3
- package/dist/lib/Client.js +54 -0
- package/dist/lib/constants.d.ts +77 -5
- package/dist/lib/constants.js +83 -2
- package/dist/lib/gateway/Dispatcher.d.ts +4 -1
- package/dist/lib/gateway/Dispatcher.js +24 -0
- package/dist/lib/gateway/Transmitter.d.ts +3 -1
- package/dist/lib/gateway/Transmitter.js +7 -0
- package/dist/lib/rest/Endpoints.d.ts +2 -0
- package/dist/lib/rest/Endpoints.js +7 -3
- package/dist/lib/transformers/AuditLogs.js +2 -0
- package/dist/lib/transformers/Components.d.ts +7 -1
- package/dist/lib/transformers/Components.js +80 -0
- package/dist/lib/transformers/Guilds.js +10 -0
- package/dist/lib/transformers/Interactions.js +46 -0
- package/dist/lib/transformers/Invites.d.ts +3 -0
- package/dist/lib/transformers/Invites.js +32 -0
- package/dist/lib/transformers/Messages.d.ts +1 -1
- package/dist/lib/transformers/Messages.js +78 -20
- package/dist/lib/transformers/Users.d.ts +3 -1
- package/dist/lib/transformers/Users.js +16 -10
- package/dist/lib/types/application.d.ts +2 -2
- package/dist/lib/types/audit-log.d.ts +2 -0
- package/dist/lib/types/components.d.ts +131 -5
- package/dist/lib/types/gateway-events.d.ts +61 -1
- package/dist/lib/types/guild.d.ts +3 -1
- package/dist/lib/types/invite.d.ts +2 -2
- package/dist/lib/types/message.d.ts +66 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -67,6 +67,14 @@ exports.Handlers = {
|
|
|
67
67
|
[constants_1.GatewayEvents.ChannelCreate]: (shard, data) => shard.client.emit("channelCreate", transformers_1.Channels.channelFromRaw(data)),
|
|
68
68
|
[constants_1.GatewayEvents.ChannelUpdate]: (shard, data) => shard.client.emit("channelUpdate", transformers_1.Channels.channelFromRaw(data)),
|
|
69
69
|
[constants_1.GatewayEvents.ChannelDelete]: (shard, data) => shard.client.emit("channelDelete", transformers_1.Channels.channelFromRaw(data)),
|
|
70
|
+
[constants_1.GatewayEvents.ChannelInfo]: (shard, data) => shard.client.emit("channelInfo", {
|
|
71
|
+
guildId: data.guild_id,
|
|
72
|
+
channels: data.channels.map((channel) => ({
|
|
73
|
+
id: channel.id,
|
|
74
|
+
status: channel.status,
|
|
75
|
+
voiceStartTime: channel.voice_start_time,
|
|
76
|
+
})),
|
|
77
|
+
}),
|
|
70
78
|
[constants_1.GatewayEvents.ChannelPinsUpdate]: (shard, data) => shard.client.emit("channelPinsUpdate", {
|
|
71
79
|
guildId: data.guild_id,
|
|
72
80
|
channelId: data.channel_id,
|
|
@@ -208,6 +216,11 @@ exports.Handlers = {
|
|
|
208
216
|
}
|
|
209
217
|
: null
|
|
210
218
|
: undefined,
|
|
219
|
+
collectibles: data.collectibles !== undefined
|
|
220
|
+
? data.collectibles !== null
|
|
221
|
+
? transformers_1.Users.collectiblesFromRaw(data.collectibles)
|
|
222
|
+
: null
|
|
223
|
+
: undefined,
|
|
211
224
|
});
|
|
212
225
|
},
|
|
213
226
|
[constants_1.GatewayEvents.GuildMembersChunk]: (shard, data) => {
|
|
@@ -306,6 +319,7 @@ exports.Handlers = {
|
|
|
306
319
|
temporary: data.temporary,
|
|
307
320
|
uses: data.uses,
|
|
308
321
|
expiresAt: data.expires_at,
|
|
322
|
+
roleIds: data.roles_ids,
|
|
309
323
|
});
|
|
310
324
|
},
|
|
311
325
|
[constants_1.GatewayEvents.InviteDelete]: (shard, data) => {
|
|
@@ -426,6 +440,16 @@ exports.Handlers = {
|
|
|
426
440
|
soundVolume: data.sound_volume,
|
|
427
441
|
});
|
|
428
442
|
},
|
|
443
|
+
[constants_1.GatewayEvents.VoiceChannelStatusUpdate]: (shard, data) => shard.client.emit("voiceChannelStatusUpdate", {
|
|
444
|
+
id: data.id,
|
|
445
|
+
guildId: data.guild_id,
|
|
446
|
+
status: data.status,
|
|
447
|
+
}),
|
|
448
|
+
[constants_1.GatewayEvents.VoiceChannelStartTimeUpdate]: (shard, data) => shard.client.emit("voiceChannelStartTimeUpdate", {
|
|
449
|
+
id: data.id,
|
|
450
|
+
guildId: data.guild_id,
|
|
451
|
+
voiceStartTime: data.voice_start_time,
|
|
452
|
+
}),
|
|
429
453
|
[constants_1.GatewayEvents.VoiceStateUpdate]: (shard, data) => {
|
|
430
454
|
shard.client.emit("voiceStateUpdate", transformers_1.Voice.voiceStateFromRaw(data));
|
|
431
455
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WebSocket from "ws";
|
|
2
2
|
import { GatewayOPCodes } from "../constants";
|
|
3
|
-
import type { GatewayPresenceUpdate, GatewayVoiceStateUpdate, Identify, RequestGuildMembers, RequestSoundboardSounds, Resume } from "../types/gateway-events";
|
|
3
|
+
import type { GatewayPresenceUpdate, GatewayVoiceStateUpdate, Identify, RequestChannelInfo, RequestGuildMembers, RequestSoundboardSounds, Resume } from "../types/gateway-events";
|
|
4
4
|
export declare class Transmitter {
|
|
5
5
|
private ws;
|
|
6
6
|
constructor(ws: WebSocket | null);
|
|
@@ -13,6 +13,8 @@ export declare class Transmitter {
|
|
|
13
13
|
requestGuildMembers(options: RequestGuildMembers): void;
|
|
14
14
|
/** https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds */
|
|
15
15
|
requestSoundboardSounds(options: RequestSoundboardSounds): void;
|
|
16
|
+
/** https://discord.com/developers/docs/topics/gateway-events#request-channel-info */
|
|
17
|
+
requestChannelInfo(options: RequestChannelInfo): void;
|
|
16
18
|
/** https://discord.com/developers/docs/topics/gateway-events#resume */
|
|
17
19
|
resume(options: Resume): void;
|
|
18
20
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
|
@@ -56,6 +56,13 @@ class Transmitter {
|
|
|
56
56
|
guild_ids: options.guildIds,
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
+
/** https://discord.com/developers/docs/topics/gateway-events#request-channel-info */
|
|
60
|
+
requestChannelInfo(options) {
|
|
61
|
+
this.send(constants_1.GatewayOPCodes.RequestChannelInfo, {
|
|
62
|
+
guild_id: options.guildId,
|
|
63
|
+
fields: options.fields
|
|
64
|
+
});
|
|
65
|
+
}
|
|
59
66
|
/** https://discord.com/developers/docs/topics/gateway-events#resume */
|
|
60
67
|
resume(options) {
|
|
61
68
|
this.send(constants_1.GatewayOPCodes.Resume, {
|
|
@@ -22,6 +22,7 @@ export declare const guildMemberRole: (guildId: snowflake, memberId: snowflake,
|
|
|
22
22
|
export declare const guildMembers: (guildId: snowflake) => `guilds/${string}/members`;
|
|
23
23
|
export declare const guildMembersSearch: (guildId: snowflake) => `guilds/${string}/members/search`;
|
|
24
24
|
export declare const guildMemberVerification: (guildId: snowflake) => `guilds/${string}/member-verification`;
|
|
25
|
+
export declare const guildMessagesSearch: (guildId: snowflake) => `guilds/${string}/messages/search`;
|
|
25
26
|
export declare const guildOnboarding: (guildId: snowflake) => `guilds/${string}/onboarding`;
|
|
26
27
|
export declare const guildPreview: (guildId: snowflake) => `guilds/${string}/preview`;
|
|
27
28
|
export declare const guildPrune: (guildId: snowflake) => `guilds/${string}/prune`;
|
|
@@ -66,6 +67,7 @@ export declare const threads: (channelId: snowflake, messageId?: snowflake) => `
|
|
|
66
67
|
export declare const threadMembers: (threadId: snowflake, userId?: snowflake | "@me") => `channels/${string}/thread-members` | `channels/${string}/thread-members/${string}`;
|
|
67
68
|
export declare const pollAnswerVoters: (channelId: snowflake, messageId: snowflake, answerId: snowflake) => `channels/${string}/polls/${string}/answers/${string}`;
|
|
68
69
|
export declare const pollExpire: (channelId: snowflake, messageId: snowflake) => `channels/${string}/polls/${string}/expire`;
|
|
70
|
+
export declare const channelVoiceStatus: (channelId: snowflake) => `channels/${string}/voice-status`;
|
|
69
71
|
export declare const user: (userId?: snowflake | "@me") => `users/${string}`;
|
|
70
72
|
export declare const userApplicationRoleConnection: (applicationId: snowflake) => `users/@me/applications/${string}/role-connection`;
|
|
71
73
|
export declare const userChannels: () => "users/@me/channels";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.inviteTargetUsersJobStatus = exports.inviteTargetUsers = exports.lobbyChannelLinking = exports.lobbyMember = exports.lobby = exports.lobbies = exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = exports.oauth2Application = void 0;
|
|
3
|
+
exports.channelBulkDelete = exports.channel = exports.template = exports.guildWidgetSettings = exports.guildWidgetJSON = exports.guildWidgetImage = exports.guildWelcomeScreen = exports.guildWebhooks = exports.guildVoiceState = exports.guildVoiceRegions = exports.guildVanityURL = exports.guildTemplates = exports.guildTemplate = exports.guildStickers = exports.guildSticker = exports.guildSoundboardSounds = exports.guildSoundboardSound = exports.guildScheduledEventUsers = exports.guildScheduledEvents = exports.guildScheduledEvent = exports.guildRoles = exports.guildRoleMemberCounts = exports.guildRole = exports.guildPrune = exports.guildPreview = exports.guildOnboarding = exports.guildMessagesSearch = exports.guildMemberVerification = exports.guildMembersSearch = exports.guildMembers = exports.guildMemberRole = exports.guildMember = exports.guildMFA = exports.guildInvites = exports.guildIntegrations = exports.guildIntegration = exports.guildIncidentsActions = 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.gateway = exports.soundboardDefaultSounds = exports.sendSoundboardSound = exports.skuSubscriptions = exports.skuSubscription = exports.stickerPacks = exports.stickerPack = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSKUs = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlementConsume = exports.applicationEntitlement = exports.applicationEmojis = exports.applicationEmoji = exports.applicationUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.applicationActivityInstance = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.channelVoiceStatus = exports.pollExpire = exports.pollAnswerVoters = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = exports.channelMessageReaction = exports.channelMessageCrosspost = exports.channelMessageAllReactions = exports.channelMessage = exports.channelInvites = exports.channelFollowers = void 0;
|
|
5
|
+
exports.inviteTargetUsersJobStatus = exports.inviteTargetUsers = exports.lobbyChannelLinking = exports.lobbyMember = exports.lobby = exports.lobbies = exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = exports.oauth2Application = exports.oauth2Authorize = exports.gatewayBot = void 0;
|
|
6
6
|
// Guilds
|
|
7
7
|
const guild = (guildId) => `guilds/${guildId}`;
|
|
8
8
|
exports.guild = guild;
|
|
@@ -50,6 +50,8 @@ const guildMembersSearch = (guildId) => `guilds/${guildId}/members/search`;
|
|
|
50
50
|
exports.guildMembersSearch = guildMembersSearch;
|
|
51
51
|
const guildMemberVerification = (guildId) => `guilds/${guildId}/member-verification`;
|
|
52
52
|
exports.guildMemberVerification = guildMemberVerification;
|
|
53
|
+
const guildMessagesSearch = (guildId) => `guilds/${guildId}/messages/search`;
|
|
54
|
+
exports.guildMessagesSearch = guildMessagesSearch;
|
|
53
55
|
const guildOnboarding = (guildId) => `guilds/${guildId}/onboarding`;
|
|
54
56
|
exports.guildOnboarding = guildOnboarding;
|
|
55
57
|
const guildPreview = (guildId) => `guilds/${guildId}/preview`;
|
|
@@ -147,6 +149,8 @@ const pollAnswerVoters = (channelId, messageId, answerId) => `channels/${channel
|
|
|
147
149
|
exports.pollAnswerVoters = pollAnswerVoters;
|
|
148
150
|
const pollExpire = (channelId, messageId) => `channels/${channelId}/polls/${messageId}/expire`;
|
|
149
151
|
exports.pollExpire = pollExpire;
|
|
152
|
+
const channelVoiceStatus = (channelId) => `channels/${channelId}/voice-status`;
|
|
153
|
+
exports.channelVoiceStatus = channelVoiceStatus;
|
|
150
154
|
// Users
|
|
151
155
|
const user = (userId = "@me") => `users/${userId}`;
|
|
152
156
|
exports.user = user;
|
|
@@ -34,6 +34,7 @@ class AuditLogs {
|
|
|
34
34
|
roleName: auditLogEntry.options.role_name,
|
|
35
35
|
type: auditLogEntry.options.type,
|
|
36
36
|
integrationType: auditLogEntry.options.integration_type,
|
|
37
|
+
status: auditLogEntry.options.status
|
|
37
38
|
}
|
|
38
39
|
: undefined,
|
|
39
40
|
reason: auditLogEntry.reason,
|
|
@@ -64,6 +65,7 @@ class AuditLogs {
|
|
|
64
65
|
role_name: auditLogEntry.options.roleName,
|
|
65
66
|
type: auditLogEntry.options.type,
|
|
66
67
|
integration_type: auditLogEntry.options.integrationType,
|
|
68
|
+
status: auditLogEntry.options.status
|
|
67
69
|
}
|
|
68
70
|
: undefined,
|
|
69
71
|
reason: auditLogEntry.reason,
|
|
@@ -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, RawFileUpload, FileUpload } from "../types/components";
|
|
1
|
+
import type { 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, RawRadioGroup, RadioGroup, RawCheckbox, Checkbox, RawCheckboxGroup, CheckboxGroup } from "../types/components";
|
|
2
2
|
export declare class Components {
|
|
3
3
|
static actionRowFromRaw(actionRow: RawActionRow): ActionRow;
|
|
4
4
|
static actionRowToRaw(actionRow: ActionRow): RawActionRow;
|
|
@@ -6,6 +6,10 @@ export declare class Components {
|
|
|
6
6
|
static buttonToRaw(button: Button): RawButton;
|
|
7
7
|
static channelSelectFromRaw(channelSelect: RawChannelSelect): ChannelSelect;
|
|
8
8
|
static channelSelectToRaw(channelSelect: ChannelSelect): RawChannelSelect;
|
|
9
|
+
static checkboxFromRaw(checkbox: RawCheckbox): Checkbox;
|
|
10
|
+
static checkboxToRaw(checkbox: Checkbox): RawCheckbox;
|
|
11
|
+
static checkboxGroupFromRaw(checkboxGroup: RawCheckboxGroup): CheckboxGroup;
|
|
12
|
+
static checkboxGroupToRaw(checkboxGroup: CheckboxGroup): RawCheckboxGroup;
|
|
9
13
|
static containerFromRaw(container: RawContainer): Container;
|
|
10
14
|
static containerToRaw(container: Container): RawContainer;
|
|
11
15
|
static fileFromRaw(file: RawFile): File;
|
|
@@ -18,6 +22,8 @@ export declare class Components {
|
|
|
18
22
|
static mediaGalleryToRaw(mediaGallery: MediaGallery): RawMediaGallery;
|
|
19
23
|
static mentionableSelectFromRaw(mentionableSelect: RawMentionableSelect): MentionableSelect;
|
|
20
24
|
static mentionableSelectToRaw(mentionableSelect: MentionableSelect): RawMentionableSelect;
|
|
25
|
+
static radioGroupFromRaw(radioGroup: RawRadioGroup): RadioGroup;
|
|
26
|
+
static radioGroupToRaw(radioGroup: RadioGroup): RawRadioGroup;
|
|
21
27
|
static roleSelectFromRaw(roleSelect: RawRoleSelect): RoleSelect;
|
|
22
28
|
static roleSelectToRaw(roleSelect: RoleSelect): RawRoleSelect;
|
|
23
29
|
static sectionFromRaw(section: RawSection): Section;
|
|
@@ -103,6 +103,44 @@ class Components {
|
|
|
103
103
|
disabled: channelSelect.disabled,
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
+
static checkboxFromRaw(checkbox) {
|
|
107
|
+
return {
|
|
108
|
+
type: checkbox.type,
|
|
109
|
+
id: checkbox.id,
|
|
110
|
+
customId: checkbox.custom_id,
|
|
111
|
+
default: checkbox.default,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
static checkboxToRaw(checkbox) {
|
|
115
|
+
return {
|
|
116
|
+
type: checkbox.type,
|
|
117
|
+
id: checkbox.id,
|
|
118
|
+
custom_id: checkbox.customId,
|
|
119
|
+
default: checkbox.default,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
static checkboxGroupFromRaw(checkboxGroup) {
|
|
123
|
+
return {
|
|
124
|
+
type: checkboxGroup.type,
|
|
125
|
+
id: checkboxGroup.id,
|
|
126
|
+
customId: checkboxGroup.custom_id,
|
|
127
|
+
options: checkboxGroup.options,
|
|
128
|
+
minValues: checkboxGroup.min_values,
|
|
129
|
+
maxValues: checkboxGroup.max_values,
|
|
130
|
+
required: checkboxGroup.required,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
static checkboxGroupToRaw(checkboxGroup) {
|
|
134
|
+
return {
|
|
135
|
+
type: checkboxGroup.type,
|
|
136
|
+
id: checkboxGroup.id,
|
|
137
|
+
custom_id: checkboxGroup.customId,
|
|
138
|
+
options: checkboxGroup.options,
|
|
139
|
+
min_values: checkboxGroup.minValues,
|
|
140
|
+
max_values: checkboxGroup.maxValues,
|
|
141
|
+
required: checkboxGroup.required,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
106
144
|
static containerFromRaw(container) {
|
|
107
145
|
return {
|
|
108
146
|
type: container.type,
|
|
@@ -227,6 +265,14 @@ class Components {
|
|
|
227
265
|
case constants_1.ComponentTypes.FileUpload:
|
|
228
266
|
component = Components.fileUploadFromRaw(label.component);
|
|
229
267
|
break;
|
|
268
|
+
case constants_1.ComponentTypes.RadioGroup:
|
|
269
|
+
component = Components.radioGroupFromRaw(label.component);
|
|
270
|
+
break;
|
|
271
|
+
case constants_1.ComponentTypes.CheckboxGroup:
|
|
272
|
+
component = Components.checkboxGroupFromRaw(label.component);
|
|
273
|
+
break;
|
|
274
|
+
case constants_1.ComponentTypes.Checkbox:
|
|
275
|
+
component = Components.checkboxFromRaw(label.component);
|
|
230
276
|
}
|
|
231
277
|
return {
|
|
232
278
|
type: label.type,
|
|
@@ -260,6 +306,14 @@ class Components {
|
|
|
260
306
|
case constants_1.ComponentTypes.FileUpload:
|
|
261
307
|
component = Components.fileUploadToRaw(label.component);
|
|
262
308
|
break;
|
|
309
|
+
case constants_1.ComponentTypes.RadioGroup:
|
|
310
|
+
component = Components.radioGroupToRaw(label.component);
|
|
311
|
+
break;
|
|
312
|
+
case constants_1.ComponentTypes.CheckboxGroup:
|
|
313
|
+
component = Components.checkboxGroupToRaw(label.component);
|
|
314
|
+
break;
|
|
315
|
+
case constants_1.ComponentTypes.Checkbox:
|
|
316
|
+
component = Components.checkboxToRaw(label.component);
|
|
263
317
|
}
|
|
264
318
|
return {
|
|
265
319
|
type: label.type,
|
|
@@ -315,6 +369,24 @@ class Components {
|
|
|
315
369
|
disabled: mentionableSelect.disabled,
|
|
316
370
|
};
|
|
317
371
|
}
|
|
372
|
+
static radioGroupFromRaw(radioGroup) {
|
|
373
|
+
return {
|
|
374
|
+
type: radioGroup.type,
|
|
375
|
+
id: radioGroup.id,
|
|
376
|
+
customId: radioGroup.custom_id,
|
|
377
|
+
options: radioGroup.options,
|
|
378
|
+
required: radioGroup.required,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
static radioGroupToRaw(radioGroup) {
|
|
382
|
+
return {
|
|
383
|
+
type: radioGroup.type,
|
|
384
|
+
id: radioGroup.id,
|
|
385
|
+
custom_id: radioGroup.customId,
|
|
386
|
+
options: radioGroup.options,
|
|
387
|
+
required: radioGroup.required,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
318
390
|
static roleSelectFromRaw(roleSelect) {
|
|
319
391
|
return {
|
|
320
392
|
type: roleSelect.type,
|
|
@@ -512,7 +584,11 @@ class Components {
|
|
|
512
584
|
proxyURL: unfurledMediaItem.proxy_url,
|
|
513
585
|
height: unfurledMediaItem.height,
|
|
514
586
|
width: unfurledMediaItem.width,
|
|
587
|
+
placeholder: unfurledMediaItem.placeholder,
|
|
588
|
+
placeholderVersion: unfurledMediaItem.placeholder_version,
|
|
515
589
|
contentType: unfurledMediaItem.content_type,
|
|
590
|
+
flags: unfurledMediaItem.flags,
|
|
591
|
+
attachmentId: unfurledMediaItem.attachment_id,
|
|
516
592
|
};
|
|
517
593
|
}
|
|
518
594
|
static unfurledMediaItemToRaw(unfurledMediaItem) {
|
|
@@ -521,7 +597,11 @@ class Components {
|
|
|
521
597
|
proxy_url: unfurledMediaItem.proxyURL,
|
|
522
598
|
height: unfurledMediaItem.height,
|
|
523
599
|
width: unfurledMediaItem.width,
|
|
600
|
+
placeholder: unfurledMediaItem.placeholder,
|
|
601
|
+
placeholder_version: unfurledMediaItem.placeholderVersion,
|
|
524
602
|
content_type: unfurledMediaItem.contentType,
|
|
603
|
+
flags: unfurledMediaItem.flags,
|
|
604
|
+
attachment_id: unfurledMediaItem.attachmentId,
|
|
525
605
|
};
|
|
526
606
|
}
|
|
527
607
|
static userSelectFromRaw(userSelect) {
|
|
@@ -119,6 +119,11 @@ class Guilds {
|
|
|
119
119
|
}
|
|
120
120
|
: null
|
|
121
121
|
: undefined,
|
|
122
|
+
collectibles: guildMember.collectibles !== undefined
|
|
123
|
+
? guildMember.collectibles !== null
|
|
124
|
+
? Users_1.Users.collectiblesFromRaw(guildMember.collectibles)
|
|
125
|
+
: null
|
|
126
|
+
: undefined,
|
|
122
127
|
};
|
|
123
128
|
}
|
|
124
129
|
static guildMemberToRaw(guildMember) {
|
|
@@ -145,6 +150,11 @@ class Guilds {
|
|
|
145
150
|
}
|
|
146
151
|
: null
|
|
147
152
|
: undefined,
|
|
153
|
+
collectibles: guildMember.collectibles !== undefined
|
|
154
|
+
? guildMember.collectibles !== null
|
|
155
|
+
? Users_1.Users.collectiblesToRaw(guildMember.collectibles)
|
|
156
|
+
: null
|
|
157
|
+
: undefined,
|
|
148
158
|
};
|
|
149
159
|
}
|
|
150
160
|
static guildToRaw(guild) {
|
|
@@ -211,6 +211,29 @@ class Interactions {
|
|
|
211
211
|
values: component.component.values,
|
|
212
212
|
};
|
|
213
213
|
break;
|
|
214
|
+
case constants_1.ComponentTypes.RadioGroup:
|
|
215
|
+
c = {
|
|
216
|
+
type: component.component.type,
|
|
217
|
+
id: component.component.id,
|
|
218
|
+
customId: component.component.custom_id,
|
|
219
|
+
value: component.component.value
|
|
220
|
+
};
|
|
221
|
+
break;
|
|
222
|
+
case constants_1.ComponentTypes.CheckboxGroup:
|
|
223
|
+
c = {
|
|
224
|
+
type: component.component.type,
|
|
225
|
+
id: component.component.id,
|
|
226
|
+
customId: component.component.custom_id,
|
|
227
|
+
values: component.component.values,
|
|
228
|
+
};
|
|
229
|
+
break;
|
|
230
|
+
case constants_1.ComponentTypes.Checkbox:
|
|
231
|
+
c = {
|
|
232
|
+
type: component.component.type,
|
|
233
|
+
id: component.component.id,
|
|
234
|
+
customId: component.component.custom_id,
|
|
235
|
+
value: component.component.value
|
|
236
|
+
};
|
|
214
237
|
}
|
|
215
238
|
return {
|
|
216
239
|
type: component.type,
|
|
@@ -449,6 +472,29 @@ class Interactions {
|
|
|
449
472
|
values: component.component.values,
|
|
450
473
|
};
|
|
451
474
|
break;
|
|
475
|
+
case constants_1.ComponentTypes.RadioGroup:
|
|
476
|
+
c = {
|
|
477
|
+
type: component.component.type,
|
|
478
|
+
id: component.component.id,
|
|
479
|
+
custom_id: component.component.customId,
|
|
480
|
+
value: component.component.value
|
|
481
|
+
};
|
|
482
|
+
break;
|
|
483
|
+
case constants_1.ComponentTypes.CheckboxGroup:
|
|
484
|
+
c = {
|
|
485
|
+
type: component.component.type,
|
|
486
|
+
id: component.component.id,
|
|
487
|
+
custom_id: component.component.customId,
|
|
488
|
+
values: component.component.values,
|
|
489
|
+
};
|
|
490
|
+
break;
|
|
491
|
+
case constants_1.ComponentTypes.Checkbox:
|
|
492
|
+
c = {
|
|
493
|
+
type: component.component.type,
|
|
494
|
+
id: component.component.id,
|
|
495
|
+
custom_id: component.component.customId,
|
|
496
|
+
value: component.component.value
|
|
497
|
+
};
|
|
452
498
|
}
|
|
453
499
|
return {
|
|
454
500
|
type: component.type,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { RawInvite, Invite } from "../types/invite";
|
|
2
|
+
import { RawRole, Role } from "../types/role";
|
|
2
3
|
export declare class Invites {
|
|
3
4
|
static inviteFromRaw(invite: RawInvite): Invite;
|
|
4
5
|
static inviteToRaw(invite: Invite): RawInvite;
|
|
6
|
+
static partialRoleFromRaw(role: Pick<RawRole, "id" | "name" | "position" | "color" | "colors" | "icon" | "unicode_emoji">): Pick<Role, "id" | "name" | "position" | "color" | "colors" | "icon" | "unicodeEmoji">;
|
|
7
|
+
static partialRoleToRaw(role: Pick<Role, "id" | "name" | "position" | "color" | "colors" | "icon" | "unicodeEmoji">): Pick<RawRole, "id" | "name" | "position" | "color" | "colors" | "icon" | "unicode_emoji">;
|
|
5
8
|
}
|
|
@@ -40,6 +40,7 @@ class Invites {
|
|
|
40
40
|
? GuildScheduledEvents_1.GuildScheduledEvents.guildScheduledEventFromRaw(invite.guild_scheduled_event)
|
|
41
41
|
: undefined,
|
|
42
42
|
flags: invite.flags,
|
|
43
|
+
roles: invite.roles?.map((role) => Invites.partialRoleFromRaw(role))
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
static inviteToRaw(invite) {
|
|
@@ -75,6 +76,37 @@ class Invites {
|
|
|
75
76
|
? GuildScheduledEvents_1.GuildScheduledEvents.guildScheduledEventToRaw(invite.guildScheduledEvent)
|
|
76
77
|
: undefined,
|
|
77
78
|
flags: invite.flags,
|
|
79
|
+
roles: invite.roles?.map((role) => Invites.partialRoleToRaw(role))
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
static partialRoleFromRaw(role) {
|
|
83
|
+
return {
|
|
84
|
+
id: role.id,
|
|
85
|
+
name: role.name,
|
|
86
|
+
position: role.position,
|
|
87
|
+
color: role.color,
|
|
88
|
+
colors: {
|
|
89
|
+
primaryColor: role.colors.primary_color,
|
|
90
|
+
secondaryColor: role.colors.secondary_color,
|
|
91
|
+
tertiaryColor: role.colors.tertiary_color
|
|
92
|
+
},
|
|
93
|
+
icon: role.icon,
|
|
94
|
+
unicodeEmoji: role.unicode_emoji
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
static partialRoleToRaw(role) {
|
|
98
|
+
return {
|
|
99
|
+
id: role.id,
|
|
100
|
+
name: role.name,
|
|
101
|
+
position: role.position,
|
|
102
|
+
color: role.color,
|
|
103
|
+
colors: {
|
|
104
|
+
primary_color: role.colors.primaryColor,
|
|
105
|
+
secondary_color: role.colors.secondaryColor,
|
|
106
|
+
tertiary_color: role.colors.tertiaryColor
|
|
107
|
+
},
|
|
108
|
+
icon: role.icon,
|
|
109
|
+
unicode_emoji: role.unicodeEmoji
|
|
78
110
|
};
|
|
79
111
|
}
|
|
80
112
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RawAttachment, Attachment, RawEmbed, Embed, RawMessage, Message } from "../types/message";
|
|
1
|
+
import type { RawAttachment, Attachment, RawEmbed, Embed, RawMessage, Message } from "../types/message";
|
|
2
2
|
import type { ActionRow, Container, File, MediaGallery, RawActionRow, RawContainer, RawFile, RawMediaGallery, RawSection, RawSeparator, RawTextDisplay, Section, Separator, TextDisplay } from "../types/components";
|
|
3
3
|
export declare class Messages {
|
|
4
4
|
static attachmentFromRaw(attachment: RawAttachment): Attachment;
|
|
@@ -28,6 +28,13 @@ class Messages {
|
|
|
28
28
|
durationSecs: attachment.duration_secs,
|
|
29
29
|
waveform: attachment.waveform,
|
|
30
30
|
flags: attachment.flags,
|
|
31
|
+
clipParticipants: attachment.clip_participants?.map((user) => Users_1.Users.userFromRaw(user)),
|
|
32
|
+
clipCreatedAt: attachment.clip_created_at,
|
|
33
|
+
application: attachment.application !== undefined
|
|
34
|
+
? attachment.application !== null
|
|
35
|
+
? Applications_1.Applications.applicationFromRaw(attachment.application)
|
|
36
|
+
: null
|
|
37
|
+
: undefined,
|
|
31
38
|
};
|
|
32
39
|
}
|
|
33
40
|
static attachmentToRaw(attachment) {
|
|
@@ -46,6 +53,13 @@ class Messages {
|
|
|
46
53
|
duration_secs: attachment.durationSecs,
|
|
47
54
|
waveform: attachment.waveform,
|
|
48
55
|
flags: attachment.flags,
|
|
56
|
+
clip_participants: attachment.clipParticipants?.map((user) => Users_1.Users.userToRaw(user)),
|
|
57
|
+
clip_created_at: attachment.clipCreatedAt,
|
|
58
|
+
application: attachment.application !== undefined
|
|
59
|
+
? attachment.application !== null
|
|
60
|
+
? Applications_1.Applications.applicationToRaw(attachment.application)
|
|
61
|
+
: null
|
|
62
|
+
: undefined,
|
|
49
63
|
};
|
|
50
64
|
}
|
|
51
65
|
static componentsFromRaw(components) {
|
|
@@ -109,6 +123,11 @@ class Messages {
|
|
|
109
123
|
proxyURL: embed.image.proxy_url,
|
|
110
124
|
height: embed.image.height,
|
|
111
125
|
width: embed.image.width,
|
|
126
|
+
contentType: embed.image.content_type,
|
|
127
|
+
placeholder: embed.image.placeholder,
|
|
128
|
+
placeholderVersion: embed.image.placeholder_version,
|
|
129
|
+
description: embed.image.description,
|
|
130
|
+
flags: embed.image.flags,
|
|
112
131
|
}
|
|
113
132
|
: undefined,
|
|
114
133
|
thumbnail: embed.thumbnail !== undefined
|
|
@@ -119,16 +138,25 @@ class Messages {
|
|
|
119
138
|
width: embed.thumbnail.width,
|
|
120
139
|
}
|
|
121
140
|
: undefined,
|
|
122
|
-
video:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
141
|
+
video: embed.video !== undefined
|
|
142
|
+
? {
|
|
143
|
+
url: embed.video.url,
|
|
144
|
+
proxyURL: embed.video.proxy_url,
|
|
145
|
+
height: embed.video.height,
|
|
146
|
+
width: embed.video.width,
|
|
147
|
+
contentType: embed.video.content_type,
|
|
148
|
+
placeholder: embed.video.placeholder,
|
|
149
|
+
placeholderVersion: embed.video.placeholder_version,
|
|
150
|
+
description: embed.video.description,
|
|
151
|
+
flags: embed.video.flags,
|
|
152
|
+
}
|
|
153
|
+
: undefined,
|
|
154
|
+
provider: embed.provider !== undefined
|
|
155
|
+
? {
|
|
156
|
+
name: embed.provider.name,
|
|
157
|
+
url: embed.provider.url,
|
|
158
|
+
}
|
|
159
|
+
: undefined,
|
|
132
160
|
author: embed.author !== undefined
|
|
133
161
|
? {
|
|
134
162
|
name: embed.author.name,
|
|
@@ -161,6 +189,11 @@ class Messages {
|
|
|
161
189
|
proxy_url: embed.image.proxyURL,
|
|
162
190
|
height: embed.image.height,
|
|
163
191
|
width: embed.image.width,
|
|
192
|
+
content_type: embed.image.contentType,
|
|
193
|
+
placeholder: embed.image.placeholder,
|
|
194
|
+
placeholder_version: embed.image.placeholderVersion,
|
|
195
|
+
description: embed.image.description,
|
|
196
|
+
flags: embed.image.flags,
|
|
164
197
|
}
|
|
165
198
|
: undefined,
|
|
166
199
|
thumbnail: embed.thumbnail !== undefined
|
|
@@ -171,16 +204,25 @@ class Messages {
|
|
|
171
204
|
width: embed.thumbnail.width,
|
|
172
205
|
}
|
|
173
206
|
: undefined,
|
|
174
|
-
video:
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
207
|
+
video: embed.video !== undefined
|
|
208
|
+
? {
|
|
209
|
+
url: embed.video.url,
|
|
210
|
+
proxy_url: embed.video.proxyURL,
|
|
211
|
+
height: embed.video.height,
|
|
212
|
+
width: embed.video.width,
|
|
213
|
+
content_type: embed.video.contentType,
|
|
214
|
+
placeholder: embed.video.placeholder,
|
|
215
|
+
placeholder_version: embed.video.placeholderVersion,
|
|
216
|
+
description: embed.video.description,
|
|
217
|
+
flags: embed.video.flags,
|
|
218
|
+
}
|
|
219
|
+
: undefined,
|
|
220
|
+
provider: embed.provider !== undefined
|
|
221
|
+
? {
|
|
222
|
+
name: embed.provider.name,
|
|
223
|
+
url: embed.provider.url,
|
|
224
|
+
}
|
|
225
|
+
: undefined,
|
|
184
226
|
author: embed.author !== undefined
|
|
185
227
|
? {
|
|
186
228
|
name: embed.author.name,
|
|
@@ -298,6 +340,14 @@ class Messages {
|
|
|
298
340
|
? Polls_1.Polls.pollFromRaw(message.poll)
|
|
299
341
|
: undefined,
|
|
300
342
|
call: message.call,
|
|
343
|
+
sharedClientTheme: message.shared_client_theme !== undefined
|
|
344
|
+
? {
|
|
345
|
+
colors: message.shared_client_theme.colors,
|
|
346
|
+
gradientAngle: message.shared_client_theme.gradient_angle,
|
|
347
|
+
baseMix: message.shared_client_theme.base_mix,
|
|
348
|
+
baseTheme: message.shared_client_theme.base_theme,
|
|
349
|
+
}
|
|
350
|
+
: undefined,
|
|
301
351
|
};
|
|
302
352
|
}
|
|
303
353
|
static messageToRaw(message) {
|
|
@@ -404,6 +454,14 @@ class Messages {
|
|
|
404
454
|
: undefined,
|
|
405
455
|
poll: message.poll !== undefined ? Polls_1.Polls.pollToRaw(message.poll) : undefined,
|
|
406
456
|
call: message.call,
|
|
457
|
+
shared_client_theme: message.sharedClientTheme !== undefined
|
|
458
|
+
? {
|
|
459
|
+
colors: message.sharedClientTheme.colors,
|
|
460
|
+
gradient_angle: message.sharedClientTheme.gradientAngle,
|
|
461
|
+
base_mix: message.sharedClientTheme.baseMix,
|
|
462
|
+
base_theme: message.sharedClientTheme.baseTheme,
|
|
463
|
+
}
|
|
464
|
+
: undefined,
|
|
407
465
|
};
|
|
408
466
|
}
|
|
409
467
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { Nameplate, RawNameplate, RawUser, User } from "../types/user";
|
|
1
|
+
import type { Collectibles, Nameplate, RawCollectibles, RawNameplate, RawUser, User } from "../types/user";
|
|
2
2
|
export declare class Users {
|
|
3
|
+
static collectiblesFromRaw(collectibles: RawCollectibles): Collectibles;
|
|
4
|
+
static collectiblesToRaw(collectibles: Collectibles): RawCollectibles;
|
|
3
5
|
static nameplateFromRaw(nameplate: RawNameplate): Nameplate;
|
|
4
6
|
static nameplateToRaw(nameplate: Nameplate): RawNameplate;
|
|
5
7
|
static userFromRaw(user: RawUser): User;
|