disgroove 2.2.7-dev.fca4921 → 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 +332 -301
- package/dist/lib/Client.js +562 -462
- package/dist/lib/constants.d.ts +35 -24
- package/dist/lib/constants.js +39 -27
- 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 +121 -570
- 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 +5 -1
- package/dist/lib/index.js +5 -1
- package/dist/lib/rest/Endpoints.d.ts +95 -91
- package/dist/lib/rest/Endpoints.js +111 -102
- package/dist/lib/rest/RequestManager.d.ts +1 -3
- 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 +15 -3
- package/dist/lib/transformers/Components.js +309 -156
- 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 +330 -55
- package/dist/lib/transformers/Lobbies.d.ts +7 -0
- package/dist/lib/transformers/Lobbies.js +38 -0
- package/dist/lib/transformers/Messages.d.ts +4 -3
- package/dist/lib/transformers/Messages.js +38 -52
- 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 +8 -8
- 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/transformers/index.d.ts +2 -1
- package/dist/lib/transformers/index.js +2 -1
- 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 +510 -0
- 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 +406 -207
- 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 +40 -22
- package/dist/lib/types/interaction.d.ts +35 -18
- package/dist/lib/types/invite.d.ts +5 -2
- package/dist/lib/types/lobby.d.ts +31 -0
- package/dist/lib/types/lobby.js +2 -0
- package/dist/lib/types/message.d.ts +32 -20
- package/dist/lib/types/poll.d.ts +7 -1
- package/dist/lib/types/role.d.ts +8 -5
- 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 +7 -7
- package/dist/lib/utils/formatters.js +28 -29
- 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 +4 -4
- package/package.json +5 -5
- package/dist/lib/types/message-components.d.ts +0 -234
- /package/dist/lib/types/{message-components.js → components.js} +0 -0
|
@@ -50,11 +50,12 @@ export interface RawGuildScheduledEventRecurrenceRuleNWeekday {
|
|
|
50
50
|
n: number;
|
|
51
51
|
day: GuildScheduledEventRecurrenceRuleWeekday;
|
|
52
52
|
}
|
|
53
|
+
/** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure */
|
|
53
54
|
export interface GuildScheduledEvent {
|
|
54
55
|
id: snowflake;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
guildId: snowflake;
|
|
57
|
+
channelId: snowflake | null;
|
|
58
|
+
creatorId?: snowflake | null;
|
|
58
59
|
name: string;
|
|
59
60
|
description?: string | null;
|
|
60
61
|
scheduledStartTime: timestamp;
|
|
@@ -62,21 +63,24 @@ export interface GuildScheduledEvent {
|
|
|
62
63
|
privacyLevel: GuildScheduledEventPrivacyLevel;
|
|
63
64
|
status: GuildScheduledEventStatus;
|
|
64
65
|
entityType: GuildScheduledEventEntityTypes;
|
|
65
|
-
|
|
66
|
+
entityId: snowflake | null;
|
|
66
67
|
entityMetadata: GuildScheduledEventEntityMetadata | null;
|
|
67
68
|
creator?: User;
|
|
68
69
|
userCount?: number;
|
|
69
70
|
image?: string;
|
|
70
71
|
recurrenceRule: GuildScheduledEventRecurrenceRule | null;
|
|
71
72
|
}
|
|
73
|
+
/** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata */
|
|
72
74
|
export interface GuildScheduledEventEntityMetadata {
|
|
73
75
|
location?: string;
|
|
74
76
|
}
|
|
77
|
+
/** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure */
|
|
75
78
|
export interface GuildScheduledEventUser {
|
|
76
|
-
|
|
79
|
+
guildScheduledEventId: snowflake;
|
|
77
80
|
user: User;
|
|
78
81
|
member?: GuildMember;
|
|
79
82
|
}
|
|
83
|
+
/** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-structure */
|
|
80
84
|
export interface GuildScheduledEventRecurrenceRule {
|
|
81
85
|
start: timestamp;
|
|
82
86
|
end: timestamp | null;
|
|
@@ -89,6 +93,7 @@ export interface GuildScheduledEventRecurrenceRule {
|
|
|
89
93
|
byYearDay: Array<number>;
|
|
90
94
|
count: number | null;
|
|
91
95
|
}
|
|
96
|
+
/** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-nweekday-structure */
|
|
92
97
|
export interface GuildScheduledEventRecurrenceRuleNWeekday {
|
|
93
98
|
n: number;
|
|
94
99
|
day: GuildScheduledEventRecurrenceRuleWeekday;
|
|
@@ -15,16 +15,17 @@ export interface RawGuildTemplate {
|
|
|
15
15
|
serialized_source_guild: RawGuild;
|
|
16
16
|
is_dirty: boolean | null;
|
|
17
17
|
}
|
|
18
|
+
/** https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure */
|
|
18
19
|
export interface GuildTemplate {
|
|
19
20
|
code: string;
|
|
20
21
|
name: string;
|
|
21
22
|
description: string | null;
|
|
22
23
|
usageCount: number;
|
|
23
|
-
|
|
24
|
+
creatorId: snowflake;
|
|
24
25
|
creator: User;
|
|
25
26
|
createdAt: timestamp;
|
|
26
27
|
updatedAt: timestamp;
|
|
27
|
-
|
|
28
|
+
sourceGuildId: snowflake;
|
|
28
29
|
serializedSourceGuild: Guild;
|
|
29
30
|
isDirty: boolean | null;
|
|
30
31
|
}
|
|
@@ -93,13 +93,14 @@ export interface RawGuildMember {
|
|
|
93
93
|
banner?: string | null;
|
|
94
94
|
roles: Array<snowflake>;
|
|
95
95
|
joined_at: timestamp | null;
|
|
96
|
-
premium_since?:
|
|
96
|
+
premium_since?: timestamp | null;
|
|
97
97
|
deaf: boolean;
|
|
98
98
|
mute: boolean;
|
|
99
99
|
flags: GuildMemberFlags;
|
|
100
100
|
pending?: boolean;
|
|
101
101
|
permissions?: string;
|
|
102
|
-
communication_disabled_until?:
|
|
102
|
+
communication_disabled_until?: timestamp | null;
|
|
103
|
+
unusual_dm_activity_until?: timestamp | null;
|
|
103
104
|
avatar_decoration_data?: RawAvatarDecorationData | null;
|
|
104
105
|
}
|
|
105
106
|
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-structure */
|
|
@@ -188,6 +189,7 @@ export interface RawIncidentsData {
|
|
|
188
189
|
dm_spam_detected_at?: timestamp | null;
|
|
189
190
|
raid_detected_at?: timestamp | null;
|
|
190
191
|
}
|
|
192
|
+
/** https://discord.com/developers/docs/resources/guild#guild-object-guild-structure */
|
|
191
193
|
export interface Guild {
|
|
192
194
|
id: snowflake;
|
|
193
195
|
name: string;
|
|
@@ -196,13 +198,13 @@ export interface Guild {
|
|
|
196
198
|
splash: string | null;
|
|
197
199
|
discoverySplash: string | null;
|
|
198
200
|
owner?: boolean;
|
|
199
|
-
|
|
201
|
+
ownerId: snowflake;
|
|
200
202
|
permissions?: string;
|
|
201
203
|
region?: string | null;
|
|
202
|
-
|
|
204
|
+
afkChannelId: snowflake | null;
|
|
203
205
|
afkTimeout: number;
|
|
204
206
|
widgetEnabled?: boolean;
|
|
205
|
-
|
|
207
|
+
widgetChannelId?: snowflake | null;
|
|
206
208
|
verificationLevel: VerificationLevel;
|
|
207
209
|
defaultMessageNotifications: DefaultMessageNotificationLevel;
|
|
208
210
|
explicitContentFilter: ExplicitContentFilterLevel;
|
|
@@ -210,10 +212,10 @@ export interface Guild {
|
|
|
210
212
|
emojis: Array<Emoji>;
|
|
211
213
|
features: Array<GuildFeatures>;
|
|
212
214
|
mfaLevel: MFALevel;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
+
applicationId: snowflake | null;
|
|
216
|
+
systemChannelId: snowflake | null;
|
|
215
217
|
systemChannelFlags: SystemChannelFlags;
|
|
216
|
-
|
|
218
|
+
rulesChannelId: snowflake | null;
|
|
217
219
|
maxPresences?: number | null;
|
|
218
220
|
maxMembers?: number;
|
|
219
221
|
vanityURLCode: string | null;
|
|
@@ -222,7 +224,7 @@ export interface Guild {
|
|
|
222
224
|
premiumTier: PremiumTier;
|
|
223
225
|
premiumSubscriptionCount?: number;
|
|
224
226
|
preferredLocale: string;
|
|
225
|
-
|
|
227
|
+
publicUpdatesChannelId: snowflake | null;
|
|
226
228
|
maxVideoChannelUsers?: number;
|
|
227
229
|
maxStageVideoChannelUsers?: number;
|
|
228
230
|
approximateMemberCount?: number;
|
|
@@ -231,13 +233,15 @@ export interface Guild {
|
|
|
231
233
|
nsfwLevel: GuildNSFWLevel;
|
|
232
234
|
stickers?: Array<Sticker>;
|
|
233
235
|
premiumProgressBarEnabled: boolean;
|
|
234
|
-
|
|
236
|
+
safetyAlertsChannelId: snowflake | null;
|
|
235
237
|
incidentsData: IncidentsData | null;
|
|
236
238
|
}
|
|
239
|
+
/** https://discord.com/developers/docs/resources/guild#unavailable-guild-object */
|
|
237
240
|
export interface UnavailableGuild {
|
|
238
241
|
id: snowflake;
|
|
239
242
|
unavailable: boolean;
|
|
240
243
|
}
|
|
244
|
+
/** https://discord.com/developers/docs/resources/guild#guild-preview-object-guild-preview-structure */
|
|
241
245
|
export interface GuildPreview {
|
|
242
246
|
id: snowflake;
|
|
243
247
|
name: string;
|
|
@@ -251,10 +255,12 @@ export interface GuildPreview {
|
|
|
251
255
|
description: string | null;
|
|
252
256
|
stickers?: Array<Sticker>;
|
|
253
257
|
}
|
|
258
|
+
/** https://discord.com/developers/docs/resources/guild#guild-widget-settings-object-guild-widget-settings-structure */
|
|
254
259
|
export interface GuildWidgetSettings {
|
|
255
260
|
enabled: boolean;
|
|
256
|
-
|
|
261
|
+
channelId: snowflake | null;
|
|
257
262
|
}
|
|
263
|
+
/** https://discord.com/developers/docs/resources/guild#guild-widget-object-guild-widget-structure */
|
|
258
264
|
export interface GuildWidget {
|
|
259
265
|
id: snowflake;
|
|
260
266
|
name: string;
|
|
@@ -263,29 +269,32 @@ export interface GuildWidget {
|
|
|
263
269
|
members: Array<User>;
|
|
264
270
|
presenceCount: number;
|
|
265
271
|
}
|
|
272
|
+
/** https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure */
|
|
266
273
|
export interface GuildMember {
|
|
267
274
|
user?: User;
|
|
268
275
|
nick?: string | null;
|
|
269
276
|
avatar?: string | null;
|
|
270
277
|
banner?: string | null;
|
|
271
278
|
roles: Array<snowflake>;
|
|
272
|
-
joinedAt:
|
|
273
|
-
premiumSince?:
|
|
279
|
+
joinedAt: timestamp | null;
|
|
280
|
+
premiumSince?: timestamp | null;
|
|
274
281
|
deaf: boolean;
|
|
275
282
|
mute: boolean;
|
|
276
283
|
flags: GuildMemberFlags;
|
|
277
284
|
pending?: boolean;
|
|
278
285
|
permissions?: string;
|
|
279
|
-
communicationDisabledUntil?:
|
|
286
|
+
communicationDisabledUntil?: timestamp | null;
|
|
287
|
+
unusualDMActivityUntil?: timestamp | null;
|
|
280
288
|
avatarDecorationData?: AvatarDecorationData | null;
|
|
281
289
|
}
|
|
290
|
+
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-structure */
|
|
282
291
|
export interface Integration {
|
|
283
292
|
id: snowflake;
|
|
284
293
|
name: string;
|
|
285
294
|
type: string;
|
|
286
295
|
enabled: boolean;
|
|
287
296
|
syncing?: boolean;
|
|
288
|
-
|
|
297
|
+
roleId?: snowflake;
|
|
289
298
|
enableEmoticons?: boolean;
|
|
290
299
|
expireBehavior?: IntegrationExpireBehaviors;
|
|
291
300
|
expireGracePeriod?: number;
|
|
@@ -297,10 +306,12 @@ export interface Integration {
|
|
|
297
306
|
application?: IntegrationApplication;
|
|
298
307
|
scopes?: Array<OAuth2Scopes>;
|
|
299
308
|
}
|
|
309
|
+
/** https://discord.com/developers/docs/resources/guild#integration-account-object-integration-account-structure */
|
|
300
310
|
export interface IntegrationAccount {
|
|
301
311
|
id: snowflake;
|
|
302
312
|
name: string;
|
|
303
313
|
}
|
|
314
|
+
/** https://discord.com/developers/docs/resources/guild#integration-application-object-integration-application-structure */
|
|
304
315
|
export interface IntegrationApplication {
|
|
305
316
|
id: snowflake;
|
|
306
317
|
name: string;
|
|
@@ -308,27 +319,32 @@ export interface IntegrationApplication {
|
|
|
308
319
|
description: string;
|
|
309
320
|
bot?: User;
|
|
310
321
|
}
|
|
322
|
+
/** https://discord.com/developers/docs/resources/guild#ban-object-ban-structure */
|
|
311
323
|
export interface Ban {
|
|
312
324
|
reason: string | null;
|
|
313
325
|
user: User;
|
|
314
326
|
}
|
|
327
|
+
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-structure */
|
|
315
328
|
export interface WelcomeScreen {
|
|
316
329
|
description: string | null;
|
|
317
330
|
welcomeChannels: Array<WelcomeScreenChannel>;
|
|
318
331
|
}
|
|
332
|
+
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-channel-structure */
|
|
319
333
|
export interface WelcomeScreenChannel {
|
|
320
|
-
|
|
334
|
+
channelId: snowflake;
|
|
321
335
|
description: string;
|
|
322
|
-
|
|
336
|
+
emojiId: snowflake | null;
|
|
323
337
|
emojiName: string | null;
|
|
324
338
|
}
|
|
339
|
+
/** https://discord.com/developers/docs/resources/guild#guild-onboarding-object-guild-onboarding-structure */
|
|
325
340
|
export interface GuildOnboarding {
|
|
326
|
-
|
|
341
|
+
guildId: snowflake;
|
|
327
342
|
prompts: Array<OnboardingPrompt>;
|
|
328
|
-
|
|
343
|
+
defaultChannelIds: Array<snowflake>;
|
|
329
344
|
enabled: boolean;
|
|
330
345
|
mode: OnboardingMode;
|
|
331
346
|
}
|
|
347
|
+
/** https://discord.com/developers/docs/resources/guild#guild-onboarding-object-onboarding-prompt-structure */
|
|
332
348
|
export interface OnboardingPrompt {
|
|
333
349
|
id: snowflake;
|
|
334
350
|
type: PromptTypes;
|
|
@@ -338,17 +354,19 @@ export interface OnboardingPrompt {
|
|
|
338
354
|
required: boolean;
|
|
339
355
|
inOnboarding: boolean;
|
|
340
356
|
}
|
|
357
|
+
/** https://discord.com/developers/docs/resources/guild#guild-onboarding-object-prompt-option-structure */
|
|
341
358
|
export interface PromptOption {
|
|
342
359
|
id: snowflake;
|
|
343
|
-
|
|
344
|
-
|
|
360
|
+
channelIds: Array<snowflake>;
|
|
361
|
+
roleIds: Array<snowflake>;
|
|
345
362
|
emoji?: Emoji;
|
|
346
|
-
|
|
363
|
+
emojiId?: snowflake;
|
|
347
364
|
emojiName?: string;
|
|
348
365
|
emojiAnimated?: boolean;
|
|
349
366
|
title: string;
|
|
350
367
|
description: string | null;
|
|
351
368
|
}
|
|
369
|
+
/** https://discord.com/developers/docs/resources/guild#incidents-data-object-incidents-data-structure */
|
|
352
370
|
export interface IncidentsData {
|
|
353
371
|
invitesDisabledUntil: timestamp | null;
|
|
354
372
|
dmsDisabledUntil: timestamp | null;
|
|
@@ -5,8 +5,8 @@ import type { RawChannel, Channel } from "./channel";
|
|
|
5
5
|
import type { snowflake } from "./common";
|
|
6
6
|
import type { RawEntitlement, Entitlement } from "./entitlements";
|
|
7
7
|
import type { RawGuildMember, GuildMember, Guild, RawGuild } from "./guild";
|
|
8
|
-
import type { RawMessage, RawAttachment, RawEmbed, RawAllowedMentions, Message, Attachment, Embed, AllowedMentions
|
|
9
|
-
import type {
|
|
8
|
+
import type { RawMessage, RawAttachment, RawEmbed, RawAllowedMentions, Message, Attachment, Embed, AllowedMentions } from "./message";
|
|
9
|
+
import type { ActionRow, ChannelSelectInteractionResponse, Container, File, FileUploadInteractionResponse, Label, LabelInteractionResponse, MediaGallery, MentionableSelectInteractionResponse, RawActionRow, RawChannelSelectInteractionResponse, RawContainer, RawFile, RawFileUploadInteractionResponse, RawLabel, RawLabelInteractionResponse, RawMediaGallery, RawMentionableSelectInteractionResponse, RawRoleSelectInteractionResponse, RawSection, RawSeparator, RawStringSelectInteractionResponse, RawTextDisplay, RawTextDisplayInteractionResponse, RawTextInputInteractionResponse, RawUserSelectInteractionResponse, RoleSelectInteractionResponse, Section, Separator, StringSelectInteractionResponse, TextDisplay, TextDisplayInteractionResponse, TextInputInteractionResponse, UserSelectInteractionResponse } from "./components";
|
|
10
10
|
import type { RawPollCreateParams, PollCreateParams } from "./poll";
|
|
11
11
|
import type { RawRole, Role } from "./role";
|
|
12
12
|
import type { RawUser, User } from "./user";
|
|
@@ -33,6 +33,7 @@ export interface RawInteraction {
|
|
|
33
33
|
entitlements: Array<RawEntitlement>;
|
|
34
34
|
authorizing_integration_owners: Record<ApplicationIntegrationTypes, string>;
|
|
35
35
|
context?: InteractionContextTypes;
|
|
36
|
+
attachment_size_limit: number;
|
|
36
37
|
}
|
|
37
38
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-data-structure */
|
|
38
39
|
export interface RawApplicationCommandData {
|
|
@@ -56,8 +57,9 @@ export interface RawModalSubmitData {
|
|
|
56
57
|
custom_id: string;
|
|
57
58
|
components: Array<{
|
|
58
59
|
type: ComponentTypes.ActionRow;
|
|
59
|
-
components: Array<
|
|
60
|
-
}>;
|
|
60
|
+
components: Array<RawTextInputInteractionResponse | RawStringSelectInteractionResponse | RawUserSelectInteractionResponse | RawRoleSelectInteractionResponse | RawMentionableSelectInteractionResponse | RawChannelSelectInteractionResponse | RawFileUploadInteractionResponse>;
|
|
61
|
+
} | RawTextDisplayInteractionResponse | RawLabelInteractionResponse>;
|
|
62
|
+
resolved?: RawResolvedData;
|
|
61
63
|
}
|
|
62
64
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */
|
|
63
65
|
export interface RawResolvedData {
|
|
@@ -96,7 +98,7 @@ export interface RawInteractionCallbackData {
|
|
|
96
98
|
embeds?: Array<RawEmbed>;
|
|
97
99
|
allowed_mentions?: RawAllowedMentions;
|
|
98
100
|
flags?: MessageFlags;
|
|
99
|
-
components?: Array<
|
|
101
|
+
components?: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer | RawLabel>;
|
|
100
102
|
attachments?: Array<Pick<RawAttachment, "filename" | "description">>;
|
|
101
103
|
poll?: RawPollCreateParams;
|
|
102
104
|
files?: Array<FileData>;
|
|
@@ -128,17 +130,18 @@ export interface RawInteractionResource {
|
|
|
128
130
|
export interface RawActivityInstanceResource {
|
|
129
131
|
id: string;
|
|
130
132
|
}
|
|
133
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure */
|
|
131
134
|
export interface Interaction {
|
|
132
135
|
id: snowflake;
|
|
133
|
-
|
|
136
|
+
applicationId: snowflake;
|
|
134
137
|
type: InteractionType;
|
|
135
138
|
data?: ApplicationCommandData & MessageComponentData & ModalSubmitData;
|
|
136
139
|
guild?: {
|
|
137
140
|
locale: Locales;
|
|
138
141
|
} & Pick<Guild, "id" | "features">;
|
|
139
|
-
|
|
142
|
+
guildId?: snowflake;
|
|
140
143
|
channel?: Channel;
|
|
141
|
-
|
|
144
|
+
channelId?: snowflake;
|
|
142
145
|
member?: GuildMember;
|
|
143
146
|
user?: User;
|
|
144
147
|
token: string;
|
|
@@ -150,29 +153,35 @@ export interface Interaction {
|
|
|
150
153
|
entitlements: Array<Entitlement>;
|
|
151
154
|
authorizingIntegrationOwners: Record<ApplicationIntegrationTypes, string>;
|
|
152
155
|
context?: InteractionContextTypes;
|
|
156
|
+
attachmentSizeLimit: number;
|
|
153
157
|
}
|
|
158
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-data-structure */
|
|
154
159
|
export interface ApplicationCommandData {
|
|
155
160
|
id: snowflake;
|
|
156
161
|
name: string;
|
|
157
162
|
type: ApplicationCommandTypes;
|
|
158
163
|
resolved?: ResolvedData;
|
|
159
164
|
options?: Array<ApplicationCommandInteractionDataOption>;
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
guildId?: snowflake;
|
|
166
|
+
targetId?: snowflake;
|
|
162
167
|
}
|
|
168
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-message-component-data-structure */
|
|
163
169
|
export interface MessageComponentData {
|
|
164
|
-
|
|
170
|
+
customId: string;
|
|
165
171
|
componentType: ComponentTypes;
|
|
166
172
|
values?: Array<string>;
|
|
167
173
|
resolved?: ResolvedData;
|
|
168
174
|
}
|
|
175
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure */
|
|
169
176
|
export interface ModalSubmitData {
|
|
170
|
-
|
|
177
|
+
customId: string;
|
|
171
178
|
components: Array<{
|
|
172
179
|
type: ComponentTypes.ActionRow;
|
|
173
|
-
components: Array<
|
|
174
|
-
}>;
|
|
180
|
+
components: Array<TextInputInteractionResponse | StringSelectInteractionResponse | UserSelectInteractionResponse | RoleSelectInteractionResponse | MentionableSelectInteractionResponse | ChannelSelectInteractionResponse | FileUploadInteractionResponse>;
|
|
181
|
+
} | TextDisplayInteractionResponse | LabelInteractionResponse>;
|
|
182
|
+
resolved?: ResolvedData;
|
|
175
183
|
}
|
|
184
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */
|
|
176
185
|
export interface ResolvedData {
|
|
177
186
|
users?: Record<snowflake, User>;
|
|
178
187
|
members?: Record<snowflake, GuildMember>;
|
|
@@ -181,6 +190,7 @@ export interface ResolvedData {
|
|
|
181
190
|
messages?: Record<snowflake, Message>;
|
|
182
191
|
attachments?: Record<snowflake, Attachment>;
|
|
183
192
|
}
|
|
193
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-interaction-data-option-structure */
|
|
184
194
|
export interface ApplicationCommandInteractionDataOption {
|
|
185
195
|
name: string;
|
|
186
196
|
type: ApplicationCommandOptionType;
|
|
@@ -188,6 +198,7 @@ export interface ApplicationCommandInteractionDataOption {
|
|
|
188
198
|
options?: Array<ApplicationCommandInteractionDataOption>;
|
|
189
199
|
focused?: boolean;
|
|
190
200
|
}
|
|
201
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object-message-interaction-structure */
|
|
191
202
|
export interface MessageInteraction {
|
|
192
203
|
id: snowflake;
|
|
193
204
|
type: InteractionType;
|
|
@@ -195,41 +206,47 @@ export interface MessageInteraction {
|
|
|
195
206
|
user: User;
|
|
196
207
|
member?: GuildMember;
|
|
197
208
|
}
|
|
209
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-response-structure */
|
|
198
210
|
export interface InteractionResponse {
|
|
199
211
|
type: InteractionCallbackType;
|
|
200
212
|
data?: InteractionCallbackData;
|
|
201
213
|
}
|
|
214
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-structure */
|
|
202
215
|
export interface InteractionCallbackData {
|
|
203
216
|
tts?: boolean;
|
|
204
217
|
content?: string;
|
|
205
218
|
embeds?: Array<Embed>;
|
|
206
219
|
allowedMentions?: AllowedMentions;
|
|
207
220
|
flags?: MessageFlags;
|
|
208
|
-
components?: Array<
|
|
221
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container | Label>;
|
|
209
222
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
210
223
|
poll?: PollCreateParams;
|
|
211
224
|
files?: Array<FileData>;
|
|
212
225
|
choices?: Array<ApplicationCommandOptionChoice>;
|
|
213
|
-
|
|
226
|
+
customId?: string;
|
|
214
227
|
title?: string;
|
|
215
228
|
}
|
|
229
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-response-object */
|
|
216
230
|
export interface InteractionCallbackResponse {
|
|
217
231
|
interaction: InteractionCallback;
|
|
218
232
|
resource?: InteractionResource;
|
|
219
233
|
}
|
|
234
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-object */
|
|
220
235
|
export interface InteractionCallback {
|
|
221
236
|
id: snowflake;
|
|
222
237
|
type: InteractionType;
|
|
223
|
-
|
|
224
|
-
|
|
238
|
+
activityInstanceId?: string;
|
|
239
|
+
responseMessageId?: snowflake;
|
|
225
240
|
responseMessageLoading?: boolean;
|
|
226
241
|
responseMessageEphemeral?: boolean;
|
|
227
242
|
}
|
|
243
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-resource-object */
|
|
228
244
|
export interface InteractionResource {
|
|
229
245
|
type: InteractionCallbackType;
|
|
230
246
|
activityInstance?: ActivityInstanceResource;
|
|
231
247
|
message?: Message;
|
|
232
248
|
}
|
|
249
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-activity-instance-resource */
|
|
233
250
|
export interface ActivityInstanceResource {
|
|
234
251
|
id: string;
|
|
235
252
|
}
|
|
@@ -17,7 +17,7 @@ export interface RawInvite {
|
|
|
17
17
|
target_application?: RawApplication;
|
|
18
18
|
approximate_presence_count?: number;
|
|
19
19
|
approximate_member_count?: number;
|
|
20
|
-
expires_at
|
|
20
|
+
expires_at: timestamp | null;
|
|
21
21
|
stage_instance?: RawInviteStageInstance;
|
|
22
22
|
guild_scheduled_event?: RawGuildScheduledEvent;
|
|
23
23
|
flags?: GuildInviteFlags;
|
|
@@ -37,6 +37,7 @@ export interface RawInviteStageInstance {
|
|
|
37
37
|
speaker_count: number;
|
|
38
38
|
topic: string;
|
|
39
39
|
}
|
|
40
|
+
/** https://discord.com/developers/docs/resources/invite#invite-object-invite-structure */
|
|
40
41
|
export interface Invite {
|
|
41
42
|
type: InviteTypes;
|
|
42
43
|
code: string;
|
|
@@ -48,11 +49,12 @@ export interface Invite {
|
|
|
48
49
|
targetApplication?: Application;
|
|
49
50
|
approximatePresenceCount?: number;
|
|
50
51
|
approximateMemberCount?: number;
|
|
51
|
-
expiresAt
|
|
52
|
+
expiresAt: timestamp | null;
|
|
52
53
|
stageInstance?: InviteStageInstance;
|
|
53
54
|
guildScheduledEvent?: GuildScheduledEvent;
|
|
54
55
|
flags?: GuildInviteFlags;
|
|
55
56
|
}
|
|
57
|
+
/** https://discord.com/developers/docs/resources/invite#invite-metadata-object-invite-metadata-structure */
|
|
56
58
|
export interface InviteMetadata {
|
|
57
59
|
uses: number;
|
|
58
60
|
maxUses: number;
|
|
@@ -60,6 +62,7 @@ export interface InviteMetadata {
|
|
|
60
62
|
temporary: boolean;
|
|
61
63
|
createdAt: string;
|
|
62
64
|
}
|
|
65
|
+
/** https://discord.com/developers/docs/resources/invite#invite-stage-instance-object-invite-stage-instance-structure */
|
|
63
66
|
export interface InviteStageInstance {
|
|
64
67
|
members: Array<GuildMember>;
|
|
65
68
|
participantCount: number;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { LobbyMemberFlags } from "../constants";
|
|
2
|
+
import type { RawChannel } from "./channel";
|
|
3
|
+
import type { snowflake } from "./common";
|
|
4
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-object */
|
|
5
|
+
export interface RawLobby {
|
|
6
|
+
id: snowflake;
|
|
7
|
+
application_id: snowflake;
|
|
8
|
+
metadata: Record<string, string> | null;
|
|
9
|
+
members: Array<RawLobbyMember>;
|
|
10
|
+
linked_channel: RawChannel;
|
|
11
|
+
}
|
|
12
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-structure */
|
|
13
|
+
export interface RawLobbyMember {
|
|
14
|
+
id: snowflake;
|
|
15
|
+
metadata?: Record<string, string> | null;
|
|
16
|
+
flags?: LobbyMemberFlags;
|
|
17
|
+
}
|
|
18
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-object */
|
|
19
|
+
export interface Lobby {
|
|
20
|
+
id: snowflake;
|
|
21
|
+
applicationId: snowflake;
|
|
22
|
+
metadata: Record<string, string> | null;
|
|
23
|
+
members: Array<LobbyMember>;
|
|
24
|
+
linkedChannel: RawChannel;
|
|
25
|
+
}
|
|
26
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-structure */
|
|
27
|
+
export interface LobbyMember {
|
|
28
|
+
id: snowflake;
|
|
29
|
+
metadata?: Record<string, string> | null;
|
|
30
|
+
flags?: LobbyMemberFlags;
|
|
31
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { MessageTypes, MessageFlags, MessageActivityTypes, InteractionType, ApplicationIntegrationTypes, MessageReferenceTypes, AttachmentFlags, ChannelTypes, AllowedMentionTypes, EmbedTypes } from "../constants";
|
|
2
2
|
import type { Application, RawApplication } from "./application";
|
|
3
|
-
import type { Channel, RawChannel
|
|
3
|
+
import type { Channel, RawChannel } from "./channel";
|
|
4
4
|
import type { snowflake, timestamp } from "./common";
|
|
5
5
|
import type { Emoji, RawEmoji } from "./emoji";
|
|
6
6
|
import type { MessageInteraction, RawMessageInteraction, RawResolvedData, ResolvedData } from "./interaction";
|
|
7
|
-
import type { ActionRow, Container, File, MediaGallery, RawActionRow, RawContainer, RawFile, RawMediaGallery, RawSection, RawSeparator, RawTextDisplay, Section, Separator, TextDisplay } from "./
|
|
7
|
+
import type { ActionRow, Container, File, MediaGallery, RawActionRow, RawContainer, RawFile, RawMediaGallery, RawSection, RawSeparator, RawTextDisplay, Section, Separator, TextDisplay } from "./components";
|
|
8
8
|
import type { Poll, RawPoll } from "./poll";
|
|
9
9
|
import type { RawStickerItem, RawSticker, Sticker, StickerItem } from "./sticker";
|
|
10
10
|
import type { RawUser, User } from "./user";
|
|
@@ -29,7 +29,7 @@ export interface RawMessage {
|
|
|
29
29
|
webhook_id?: snowflake;
|
|
30
30
|
type: MessageTypes;
|
|
31
31
|
activity?: RawMessageActivity;
|
|
32
|
-
application?: RawApplication
|
|
32
|
+
application?: Partial<RawApplication>;
|
|
33
33
|
application_id?: snowflake;
|
|
34
34
|
flags?: MessageFlags;
|
|
35
35
|
message_reference?: RawMessageReference;
|
|
@@ -38,7 +38,7 @@ export interface RawMessage {
|
|
|
38
38
|
interaction_metadata?: RawMessageInteractionMetadata;
|
|
39
39
|
interaction?: RawMessageInteraction;
|
|
40
40
|
thread?: RawChannel;
|
|
41
|
-
components?: Array<
|
|
41
|
+
components?: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer>;
|
|
42
42
|
sticker_items?: Array<RawStickerItem>;
|
|
43
43
|
stickers?: Array<RawSticker>;
|
|
44
44
|
position?: number;
|
|
@@ -47,7 +47,6 @@ export interface RawMessage {
|
|
|
47
47
|
poll?: RawPoll;
|
|
48
48
|
call?: RawMessageCall;
|
|
49
49
|
}
|
|
50
|
-
export type RawMessageTopLevelComponent = RawActionRow | RawTextDisplay | RawContainer | RawFile | RawSection | RawSeparator | RawMediaGallery;
|
|
51
50
|
/** https://discord.com/developers/docs/resources/message#message-object-message-activity-structure */
|
|
52
51
|
export interface RawMessageActivity {
|
|
53
52
|
type: MessageActivityTypes;
|
|
@@ -197,6 +196,13 @@ export interface RawAllowedMentions {
|
|
|
197
196
|
users?: Array<snowflake>;
|
|
198
197
|
replied_user?: boolean;
|
|
199
198
|
}
|
|
199
|
+
/** https://discord.com/developers/docs/resources/message#role-subscription-data-object-role-subscription-data-object-structure */
|
|
200
|
+
export interface RawRoleSubscriptionData {
|
|
201
|
+
role_subscription_listing_id: snowflake;
|
|
202
|
+
tier_name: string;
|
|
203
|
+
total_months_subscribed: number;
|
|
204
|
+
is_renewal: boolean;
|
|
205
|
+
}
|
|
200
206
|
/** https://discord.com/developers/docs/resources/message#message-pin-object-message-pin-structure */
|
|
201
207
|
export interface RawMessagePin {
|
|
202
208
|
pinnet_at: timestamp;
|
|
@@ -204,7 +210,7 @@ export interface RawMessagePin {
|
|
|
204
210
|
}
|
|
205
211
|
export interface Message {
|
|
206
212
|
id: snowflake;
|
|
207
|
-
|
|
213
|
+
channelId: snowflake;
|
|
208
214
|
author: User;
|
|
209
215
|
content: string;
|
|
210
216
|
timestamp: timestamp;
|
|
@@ -219,11 +225,11 @@ export interface Message {
|
|
|
219
225
|
reactions?: Array<Reaction>;
|
|
220
226
|
nonce?: number | string;
|
|
221
227
|
pinned: boolean;
|
|
222
|
-
|
|
228
|
+
webhookId?: snowflake;
|
|
223
229
|
type: MessageTypes;
|
|
224
230
|
activity?: MessageActivity;
|
|
225
|
-
application?: Application
|
|
226
|
-
|
|
231
|
+
application?: Partial<Application>;
|
|
232
|
+
applicationId?: snowflake;
|
|
227
233
|
flags?: MessageFlags;
|
|
228
234
|
messageReference?: MessageReference;
|
|
229
235
|
messageSnapshots?: Array<MessageSnapshot>;
|
|
@@ -231,7 +237,7 @@ export interface Message {
|
|
|
231
237
|
interactionMetadata?: MessageInteractionMetadata;
|
|
232
238
|
interaction?: MessageInteraction;
|
|
233
239
|
thread?: Channel;
|
|
234
|
-
components?: Array<
|
|
240
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
235
241
|
stickerItems?: Array<StickerItem>;
|
|
236
242
|
stickers?: Array<Sticker>;
|
|
237
243
|
position?: number;
|
|
@@ -240,18 +246,17 @@ export interface Message {
|
|
|
240
246
|
poll?: Poll;
|
|
241
247
|
call?: MessageCall;
|
|
242
248
|
}
|
|
243
|
-
export type MessageTopLevelComponent = ActionRow | TextDisplay | Container | File | Section | Separator | MediaGallery;
|
|
244
249
|
export interface MessageActivity {
|
|
245
250
|
type: MessageActivityTypes;
|
|
246
|
-
|
|
251
|
+
partyId?: string;
|
|
247
252
|
}
|
|
248
253
|
export interface MessageInteractionMetadata {
|
|
249
254
|
id: snowflake;
|
|
250
255
|
type: InteractionType;
|
|
251
256
|
user: User;
|
|
252
257
|
authorizingIntegrationOwners: Record<ApplicationIntegrationTypes, string>;
|
|
253
|
-
|
|
254
|
-
|
|
258
|
+
originalResponseMessageId?: snowflake;
|
|
259
|
+
interactedMessageId?: snowflake;
|
|
255
260
|
triggeringInteractionMetadata?: MessageInteractionMetadata;
|
|
256
261
|
}
|
|
257
262
|
export interface MessageCall {
|
|
@@ -260,9 +265,9 @@ export interface MessageCall {
|
|
|
260
265
|
}
|
|
261
266
|
export interface MessageReference {
|
|
262
267
|
type?: MessageReferenceTypes;
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
268
|
+
messageId?: snowflake;
|
|
269
|
+
channelId?: snowflake;
|
|
270
|
+
guildId?: snowflake;
|
|
266
271
|
failIfNotExists?: boolean;
|
|
267
272
|
}
|
|
268
273
|
export interface MessageSnapshot {
|
|
@@ -337,9 +342,9 @@ export interface PollResultEmbedFields {
|
|
|
337
342
|
pollQuestionText: string;
|
|
338
343
|
victorAnswerVotes: Array<number>;
|
|
339
344
|
totalVotes: number;
|
|
340
|
-
|
|
345
|
+
victorAnswerId?: snowflake;
|
|
341
346
|
victorAnswerText?: string;
|
|
342
|
-
|
|
347
|
+
victorAnswerEmojiId?: snowflake;
|
|
343
348
|
victorAnswerEmojiName?: string;
|
|
344
349
|
victorAnswerEmojiAnimated?: boolean;
|
|
345
350
|
}
|
|
@@ -361,7 +366,7 @@ export interface Attachment {
|
|
|
361
366
|
}
|
|
362
367
|
export interface ChannelMention {
|
|
363
368
|
id: snowflake;
|
|
364
|
-
|
|
369
|
+
guildId: snowflake;
|
|
365
370
|
type: ChannelTypes;
|
|
366
371
|
name: string;
|
|
367
372
|
}
|
|
@@ -371,6 +376,13 @@ export interface AllowedMentions {
|
|
|
371
376
|
users?: Array<snowflake>;
|
|
372
377
|
repliedUser?: boolean;
|
|
373
378
|
}
|
|
379
|
+
/** https://discord.com/developers/docs/resources/message#role-subscription-data-object-role-subscription-data-object-structure */
|
|
380
|
+
export interface RoleSubscriptionData {
|
|
381
|
+
roleSubscriptionListingId: snowflake;
|
|
382
|
+
tierName: string;
|
|
383
|
+
totalMonthsSubscribed: number;
|
|
384
|
+
isRenewal: boolean;
|
|
385
|
+
}
|
|
374
386
|
export interface MessagePin {
|
|
375
387
|
pinnetAt: timestamp;
|
|
376
388
|
message: Message;
|