disgroove 3.0.1-dev.6e60c8d → 3.0.1-dev.73d9f92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/Client.d.ts +56 -3
- package/dist/lib/Client.js +74 -1
- package/dist/lib/constants.d.ts +74 -4
- package/dist/lib/constants.js +81 -2
- package/dist/lib/gateway/Dispatcher.d.ts +4 -1
- package/dist/lib/gateway/Dispatcher.js +24 -1
- package/dist/lib/gateway/Transmitter.d.ts +3 -1
- package/dist/lib/gateway/Transmitter.js +7 -0
- package/dist/lib/rest/Endpoints.d.ts +4 -0
- package/dist/lib/rest/Endpoints.js +11 -3
- package/dist/lib/rest/RequestManager.d.ts +1 -0
- package/dist/lib/rest/RequestManager.js +2 -3
- package/dist/lib/transformers/Applications.js +2 -0
- package/dist/lib/transformers/AuditLogs.js +2 -0
- package/dist/lib/transformers/Components.d.ts +1 -1
- package/dist/lib/transformers/Components.js +8 -0
- package/dist/lib/transformers/Guilds.js +10 -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 +4 -2
- package/dist/lib/types/audit-log.d.ts +2 -0
- package/dist/lib/types/components.d.ts +9 -3
- package/dist/lib/types/gateway-events.d.ts +59 -1
- package/dist/lib/types/guild.d.ts +3 -1
- 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,7 +319,7 @@ exports.Handlers = {
|
|
|
306
319
|
temporary: data.temporary,
|
|
307
320
|
uses: data.uses,
|
|
308
321
|
expiresAt: data.expires_at,
|
|
309
|
-
roleIds: data.roles_ids
|
|
322
|
+
roleIds: data.roles_ids,
|
|
310
323
|
});
|
|
311
324
|
},
|
|
312
325
|
[constants_1.GatewayEvents.InviteDelete]: (shard, data) => {
|
|
@@ -427,6 +440,16 @@ exports.Handlers = {
|
|
|
427
440
|
soundVolume: data.sound_volume,
|
|
428
441
|
});
|
|
429
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
|
+
}),
|
|
430
453
|
[constants_1.GatewayEvents.VoiceStateUpdate]: (shard, data) => {
|
|
431
454
|
shard.client.emit("voiceStateUpdate", transformers_1.Voice.voiceStateFromRaw(data));
|
|
432
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";
|
|
@@ -113,5 +115,7 @@ export declare const lobbies: () => "lobbies";
|
|
|
113
115
|
export declare const lobby: (lobbyId: snowflake) => `lobbies/${string}`;
|
|
114
116
|
export declare const lobbyMember: (lobbyId: snowflake, userId?: snowflake | "@me") => `lobbies/${string}/members/${string}`;
|
|
115
117
|
export declare const lobbyChannelLinking: (lobbyId: snowflake) => `lobbies/${string}/channel-linking`;
|
|
118
|
+
export declare const lobbyMembersBulk: (lobbyId: snowflake) => `lobbies/${string}/members/bulk`;
|
|
119
|
+
export declare const lobbyMessageModerationMetadata: (lobbyId: snowflake, messageId: snowflake) => `lobbies/${string}/messages/${string}/moderation-metadata`;
|
|
116
120
|
export declare const inviteTargetUsers: (inviteCode: string) => `invites/${string}/target-users`;
|
|
117
121
|
export declare const inviteTargetUsersJobStatus: (inviteCode: string) => `invites/${string}/target-users/job-status`;
|
|
@@ -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.lobbyMessageModerationMetadata = exports.lobbyMembersBulk = 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;
|
|
@@ -253,6 +257,10 @@ const lobbyMember = (lobbyId, userId = "@me") => `lobbies/${lobbyId}/members/${u
|
|
|
253
257
|
exports.lobbyMember = lobbyMember;
|
|
254
258
|
const lobbyChannelLinking = (lobbyId) => `lobbies/${lobbyId}/channel-linking`;
|
|
255
259
|
exports.lobbyChannelLinking = lobbyChannelLinking;
|
|
260
|
+
const lobbyMembersBulk = (lobbyId) => `lobbies/${lobbyId}/members/bulk`;
|
|
261
|
+
exports.lobbyMembersBulk = lobbyMembersBulk;
|
|
262
|
+
const lobbyMessageModerationMetadata = (lobbyId, messageId) => `lobbies/${lobbyId}/messages/${messageId}/moderation-metadata`;
|
|
263
|
+
exports.lobbyMessageModerationMetadata = lobbyMessageModerationMetadata;
|
|
256
264
|
// Invites
|
|
257
265
|
const inviteTargetUsers = (inviteCode) => `invites/${inviteCode}/target-users`;
|
|
258
266
|
exports.inviteTargetUsers = inviteTargetUsers;
|
|
@@ -123,9 +123,8 @@ class RequestManager {
|
|
|
123
123
|
resolve(null);
|
|
124
124
|
}
|
|
125
125
|
else {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
resolve(blob);
|
|
126
|
+
if (data?.returnsBlob) {
|
|
127
|
+
resolve((await response.blob));
|
|
129
128
|
}
|
|
130
129
|
resolve((await response.json()));
|
|
131
130
|
}
|
|
@@ -29,6 +29,7 @@ class Applications {
|
|
|
29
29
|
slug: application.slug,
|
|
30
30
|
coverImage: application.cover_image,
|
|
31
31
|
flags: application.flags,
|
|
32
|
+
flagsNew: application.flags_new,
|
|
32
33
|
approximateGuildCount: application.approximate_guild_count,
|
|
33
34
|
approximateUserInstallCount: application.approximate_user_install_count,
|
|
34
35
|
approximateUserAuthorizationCount: application.approximate_user_authorization_count,
|
|
@@ -79,6 +80,7 @@ class Applications {
|
|
|
79
80
|
slug: application.slug,
|
|
80
81
|
cover_image: application.coverImage,
|
|
81
82
|
flags: application.flags,
|
|
83
|
+
flags_new: application.flagsNew,
|
|
82
84
|
approximate_guild_count: application.approximateGuildCount,
|
|
83
85
|
approximate_user_install_count: application.approximateUserInstallCount,
|
|
84
86
|
approximate_user_authorization_count: application.approximateUserAuthorizationCount,
|
|
@@ -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, RawRadioGroup, RadioGroup, RawCheckbox, Checkbox, RawCheckboxGroup, CheckboxGroup } 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;
|
|
@@ -584,7 +584,11 @@ class Components {
|
|
|
584
584
|
proxyURL: unfurledMediaItem.proxy_url,
|
|
585
585
|
height: unfurledMediaItem.height,
|
|
586
586
|
width: unfurledMediaItem.width,
|
|
587
|
+
placeholder: unfurledMediaItem.placeholder,
|
|
588
|
+
placeholderVersion: unfurledMediaItem.placeholder_version,
|
|
587
589
|
contentType: unfurledMediaItem.content_type,
|
|
590
|
+
flags: unfurledMediaItem.flags,
|
|
591
|
+
attachmentId: unfurledMediaItem.attachment_id,
|
|
588
592
|
};
|
|
589
593
|
}
|
|
590
594
|
static unfurledMediaItemToRaw(unfurledMediaItem) {
|
|
@@ -593,7 +597,11 @@ class Components {
|
|
|
593
597
|
proxy_url: unfurledMediaItem.proxyURL,
|
|
594
598
|
height: unfurledMediaItem.height,
|
|
595
599
|
width: unfurledMediaItem.width,
|
|
600
|
+
placeholder: unfurledMediaItem.placeholder,
|
|
601
|
+
placeholder_version: unfurledMediaItem.placeholderVersion,
|
|
596
602
|
content_type: unfurledMediaItem.contentType,
|
|
603
|
+
flags: unfurledMediaItem.flags,
|
|
604
|
+
attachment_id: unfurledMediaItem.attachmentId,
|
|
597
605
|
};
|
|
598
606
|
}
|
|
599
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) {
|
|
@@ -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;
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Users = void 0;
|
|
4
4
|
class Users {
|
|
5
|
+
static collectiblesFromRaw(collectibles) {
|
|
6
|
+
return {
|
|
7
|
+
nameplate: collectibles.nameplate !== undefined
|
|
8
|
+
? this.nameplateFromRaw(collectibles.nameplate)
|
|
9
|
+
: undefined,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
static collectiblesToRaw(collectibles) {
|
|
13
|
+
return {
|
|
14
|
+
nameplate: collectibles.nameplate !== undefined
|
|
15
|
+
? this.nameplateToRaw(collectibles.nameplate)
|
|
16
|
+
: undefined,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
5
19
|
static nameplateFromRaw(nameplate) {
|
|
6
20
|
return {
|
|
7
21
|
skuId: nameplate.sku_id,
|
|
@@ -46,11 +60,7 @@ class Users {
|
|
|
46
60
|
: undefined,
|
|
47
61
|
collectibles: user.collectibles !== undefined
|
|
48
62
|
? user.collectibles !== null
|
|
49
|
-
?
|
|
50
|
-
nameplate: user.collectibles.nameplate !== undefined
|
|
51
|
-
? this.nameplateFromRaw(user.collectibles.nameplate)
|
|
52
|
-
: undefined,
|
|
53
|
-
}
|
|
63
|
+
? this.collectiblesFromRaw(user.collectibles)
|
|
54
64
|
: null
|
|
55
65
|
: undefined,
|
|
56
66
|
primaryGuild: user.primary_guild !== undefined
|
|
@@ -93,11 +103,7 @@ class Users {
|
|
|
93
103
|
: undefined,
|
|
94
104
|
collectibles: user.collectibles !== undefined
|
|
95
105
|
? user.collectibles !== null
|
|
96
|
-
?
|
|
97
|
-
nameplate: user.collectibles.nameplate !== undefined
|
|
98
|
-
? this.nameplateToRaw(user.collectibles.nameplate)
|
|
99
|
-
: undefined,
|
|
100
|
-
}
|
|
106
|
+
? this.collectiblesToRaw(user.collectibles)
|
|
101
107
|
: null
|
|
102
108
|
: undefined,
|
|
103
109
|
primary_guild: user.primaryGuild !== undefined
|
|
@@ -23,6 +23,7 @@ export interface RawApplication {
|
|
|
23
23
|
slug?: string;
|
|
24
24
|
cover_image?: string;
|
|
25
25
|
flags?: ApplicationFlags;
|
|
26
|
+
flags_new?: string;
|
|
26
27
|
approximate_guild_count?: number;
|
|
27
28
|
approximate_user_install_count?: number;
|
|
28
29
|
approximate_user_authorization_count?: number;
|
|
@@ -30,7 +31,7 @@ export interface RawApplication {
|
|
|
30
31
|
interactions_endpoint_url?: string;
|
|
31
32
|
role_connections_verification_url?: string;
|
|
32
33
|
event_webhooks_url?: string | null;
|
|
33
|
-
event_webhooks_status
|
|
34
|
+
event_webhooks_status?: ApplicationEventWebhookStatus;
|
|
34
35
|
event_webhooks_types?: Array<string>;
|
|
35
36
|
tags?: Array<string>;
|
|
36
37
|
install_params?: RawInstallParams;
|
|
@@ -81,6 +82,7 @@ export interface Application {
|
|
|
81
82
|
slug?: string;
|
|
82
83
|
coverImage?: string;
|
|
83
84
|
flags?: ApplicationFlags;
|
|
85
|
+
flagsNew?: string;
|
|
84
86
|
approximateGuildCount?: number;
|
|
85
87
|
approximateUserInstallCount?: number;
|
|
86
88
|
approximateUserAuthorizationCount?: number;
|
|
@@ -88,7 +90,7 @@ export interface Application {
|
|
|
88
90
|
interactionsEndpointURL?: string;
|
|
89
91
|
roleConnectionsVerificationURL?: string;
|
|
90
92
|
eventWebhooksURL?: string | null;
|
|
91
|
-
eventWebhooksStatus
|
|
93
|
+
eventWebhooksStatus?: ApplicationEventWebhookStatus;
|
|
92
94
|
eventWebhooksTypes?: Array<string>;
|
|
93
95
|
tags?: Array<string>;
|
|
94
96
|
installParams?: InstallParams;
|
|
@@ -42,6 +42,7 @@ export interface RawOptionalAuditLogEntryInfo {
|
|
|
42
42
|
role_name: string;
|
|
43
43
|
type: string;
|
|
44
44
|
integration_type: string;
|
|
45
|
+
status: string;
|
|
45
46
|
}
|
|
46
47
|
/** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */
|
|
47
48
|
export interface RawAuditLogChange {
|
|
@@ -84,6 +85,7 @@ export interface OptionalAuditLogEntryInfo {
|
|
|
84
85
|
roleName: string;
|
|
85
86
|
type: string;
|
|
86
87
|
integrationType: string;
|
|
88
|
+
status: string;
|
|
87
89
|
}
|
|
88
90
|
/** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */
|
|
89
91
|
export interface AuditLogChange {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ButtonStyles, ChannelTypes, ComponentTypes, SeparatorSpacing, TextInputStyles } from "../constants";
|
|
1
|
+
import type { ButtonStyles, ChannelTypes, ComponentTypes, SeparatorSpacing, TextInputStyles, UnfurledMediaItemFlags } from "../constants";
|
|
2
2
|
import type { snowflake } from "./common";
|
|
3
3
|
import type { RawEmoji, Emoji } from "./emoji";
|
|
4
4
|
import type { RawResolvedData, ResolvedData } from "./interaction";
|
|
@@ -15,7 +15,7 @@ export interface RawButton {
|
|
|
15
15
|
style: ButtonStyles;
|
|
16
16
|
label?: string;
|
|
17
17
|
emoji?: Pick<RawEmoji, "name" | "id" | "animated">;
|
|
18
|
-
custom_id
|
|
18
|
+
custom_id?: string;
|
|
19
19
|
sku_id?: snowflake;
|
|
20
20
|
url?: string;
|
|
21
21
|
disabled?: boolean;
|
|
@@ -252,7 +252,10 @@ export interface RawUnfurledMediaItem {
|
|
|
252
252
|
proxy_url?: string;
|
|
253
253
|
height?: number | null;
|
|
254
254
|
width?: number | null;
|
|
255
|
+
placeholder?: string;
|
|
256
|
+
placeholder_version?: number;
|
|
255
257
|
content_type?: string;
|
|
258
|
+
flags?: UnfurledMediaItemFlags;
|
|
256
259
|
attachment_id?: snowflake;
|
|
257
260
|
}
|
|
258
261
|
/** https://docs.discord.com/developers/components/reference#radio-group-structure */
|
|
@@ -328,7 +331,7 @@ export interface Button {
|
|
|
328
331
|
style: ButtonStyles;
|
|
329
332
|
label?: string;
|
|
330
333
|
emoji?: Pick<Emoji, "name" | "id" | "animated">;
|
|
331
|
-
customId
|
|
334
|
+
customId?: string;
|
|
332
335
|
skuId?: snowflake;
|
|
333
336
|
url?: string;
|
|
334
337
|
disabled?: boolean;
|
|
@@ -565,7 +568,10 @@ export interface UnfurledMediaItem {
|
|
|
565
568
|
proxyURL?: string;
|
|
566
569
|
height?: number | null;
|
|
567
570
|
width?: number | null;
|
|
571
|
+
placeholder?: string;
|
|
572
|
+
placeholderVersion?: number;
|
|
568
573
|
contentType?: string;
|
|
574
|
+
flags?: UnfurledMediaItemFlags;
|
|
569
575
|
attachmentId?: snowflake;
|
|
570
576
|
}
|
|
571
577
|
/** https://docs.discord.com/developers/components/reference#radio-group-structure */
|