disgroove 2.2.7 → 3.0.0-dev.2cf2b90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -9
- package/README.md +48 -48
- package/dist/lib/Client.d.ts +295 -300
- package/dist/lib/Client.js +480 -473
- package/dist/lib/constants.d.ts +7 -4
- package/dist/lib/constants.js +6 -3
- package/dist/lib/gateway/Dispatcher.d.ts +104 -0
- package/dist/lib/gateway/Dispatcher.js +471 -0
- package/dist/lib/gateway/Shard.d.ts +12 -21
- package/dist/lib/gateway/Shard.js +120 -584
- package/dist/lib/gateway/Transmitter.d.ts +22 -0
- package/dist/lib/gateway/Transmitter.js +93 -0
- package/dist/lib/gateway/WebSocketManager.d.ts +22 -0
- package/dist/lib/gateway/WebSocketManager.js +93 -0
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.js +4 -0
- package/dist/lib/rest/Endpoints.d.ts +94 -94
- package/dist/lib/rest/Endpoints.js +104 -104
- package/dist/lib/rest/RequestManager.js +17 -7
- package/dist/lib/rest/index.js +17 -7
- package/dist/lib/transformers/ApplicationCommands.js +4 -4
- package/dist/lib/transformers/Applications.d.ts +2 -0
- package/dist/lib/transformers/Applications.js +110 -4
- package/dist/lib/transformers/AuditLogs.js +10 -10
- package/dist/lib/transformers/AutoModeration.js +6 -6
- package/dist/lib/transformers/Channels.js +16 -16
- package/dist/lib/transformers/Components.d.ts +3 -1
- package/dist/lib/transformers/Components.js +42 -16
- package/dist/lib/transformers/Entitlements.d.ts +2 -2
- package/dist/lib/transformers/Entitlements.js +16 -16
- package/dist/lib/transformers/GuildScheduledEvents.js +8 -8
- package/dist/lib/transformers/GuildTemplates.js +4 -4
- package/dist/lib/transformers/Guilds.js +28 -28
- package/dist/lib/transformers/Interactions.js +74 -44
- package/dist/lib/transformers/Lobbies.js +2 -2
- package/dist/lib/transformers/Messages.js +18 -18
- package/dist/lib/transformers/Polls.js +2 -2
- package/dist/lib/transformers/Presences.d.ts +3 -3
- package/dist/lib/transformers/Presences.js +6 -6
- package/dist/lib/transformers/Roles.js +6 -6
- package/dist/lib/transformers/SKUs.js +2 -2
- package/dist/lib/transformers/Soundboards.js +6 -6
- package/dist/lib/transformers/StageInstances.js +6 -6
- package/dist/lib/transformers/Stickers.js +3 -3
- package/dist/lib/transformers/Subscriptions.js +8 -8
- package/dist/lib/transformers/Teams.js +4 -4
- package/dist/lib/transformers/Users.js +6 -6
- package/dist/lib/transformers/Voice.js +8 -8
- package/dist/lib/transformers/Webhooks.js +6 -6
- package/dist/lib/types/application-command.d.ts +9 -4
- package/dist/lib/types/application-role-connection-metadata.d.ts +1 -0
- package/dist/lib/types/application.d.ts +12 -7
- package/dist/lib/types/audit-log.d.ts +9 -5
- package/dist/lib/types/auto-moderation.d.ts +7 -3
- package/dist/lib/types/channel.d.ts +17 -23
- package/dist/lib/types/common.d.ts +2 -0
- package/dist/lib/types/components.d.ts +79 -19
- package/dist/lib/types/emoji.d.ts +1 -0
- package/dist/lib/types/entitlements.d.ts +5 -4
- package/dist/lib/types/gateway-events.d.ts +387 -210
- package/dist/lib/types/guild-scheduled-event.d.ts +10 -5
- package/dist/lib/types/guild-template.d.ts +3 -2
- package/dist/lib/types/guild.d.ts +33 -17
- package/dist/lib/types/interaction.d.ts +26 -13
- package/dist/lib/types/invite.d.ts +3 -0
- package/dist/lib/types/lobby.d.ts +3 -1
- package/dist/lib/types/message.d.ts +29 -15
- package/dist/lib/types/poll.d.ts +7 -1
- package/dist/lib/types/role.d.ts +6 -3
- package/dist/lib/types/sku.d.ts +2 -1
- package/dist/lib/types/soundboard.d.ts +4 -3
- package/dist/lib/types/stage-instance.d.ts +4 -3
- package/dist/lib/types/sticker.d.ts +8 -5
- package/dist/lib/types/subscription.d.ts +6 -5
- package/dist/lib/types/team.d.ts +4 -2
- package/dist/lib/types/user.d.ts +10 -3
- package/dist/lib/types/voice.d.ts +6 -4
- package/dist/lib/types/webhook.d.ts +4 -3
- package/dist/lib/utils/CDN.d.ts +22 -22
- package/dist/lib/utils/CDN.js +22 -22
- package/dist/lib/utils/errors.d.ts +3 -1
- package/dist/lib/utils/errors.js +4 -0
- package/dist/lib/utils/formatters.d.ts +6 -6
- package/dist/lib/utils/formatters.js +27 -28
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.js +18 -7
- package/dist/lib/utils/permissions.d.ts +2 -0
- package/dist/lib/utils/permissions.js +7 -0
- package/dist/package.json +1 -1
- package/package.json +2 -2
- package/dist/lib/types/message-components.d.ts +0 -450
- package/dist/lib/types/message-components.js +0 -2
|
@@ -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
|
}
|
|
@@ -189,6 +189,7 @@ export interface RawIncidentsData {
|
|
|
189
189
|
dm_spam_detected_at?: timestamp | null;
|
|
190
190
|
raid_detected_at?: timestamp | null;
|
|
191
191
|
}
|
|
192
|
+
/** https://discord.com/developers/docs/resources/guild#guild-object-guild-structure */
|
|
192
193
|
export interface Guild {
|
|
193
194
|
id: snowflake;
|
|
194
195
|
name: string;
|
|
@@ -197,13 +198,13 @@ export interface Guild {
|
|
|
197
198
|
splash: string | null;
|
|
198
199
|
discoverySplash: string | null;
|
|
199
200
|
owner?: boolean;
|
|
200
|
-
|
|
201
|
+
ownerId: snowflake;
|
|
201
202
|
permissions?: string;
|
|
202
203
|
region?: string | null;
|
|
203
|
-
|
|
204
|
+
afkChannelId: snowflake | null;
|
|
204
205
|
afkTimeout: number;
|
|
205
206
|
widgetEnabled?: boolean;
|
|
206
|
-
|
|
207
|
+
widgetChannelId?: snowflake | null;
|
|
207
208
|
verificationLevel: VerificationLevel;
|
|
208
209
|
defaultMessageNotifications: DefaultMessageNotificationLevel;
|
|
209
210
|
explicitContentFilter: ExplicitContentFilterLevel;
|
|
@@ -211,10 +212,10 @@ export interface Guild {
|
|
|
211
212
|
emojis: Array<Emoji>;
|
|
212
213
|
features: Array<GuildFeatures>;
|
|
213
214
|
mfaLevel: MFALevel;
|
|
214
|
-
|
|
215
|
-
|
|
215
|
+
applicationId: snowflake | null;
|
|
216
|
+
systemChannelId: snowflake | null;
|
|
216
217
|
systemChannelFlags: SystemChannelFlags;
|
|
217
|
-
|
|
218
|
+
rulesChannelId: snowflake | null;
|
|
218
219
|
maxPresences?: number | null;
|
|
219
220
|
maxMembers?: number;
|
|
220
221
|
vanityURLCode: string | null;
|
|
@@ -223,7 +224,7 @@ export interface Guild {
|
|
|
223
224
|
premiumTier: PremiumTier;
|
|
224
225
|
premiumSubscriptionCount?: number;
|
|
225
226
|
preferredLocale: string;
|
|
226
|
-
|
|
227
|
+
publicUpdatesChannelId: snowflake | null;
|
|
227
228
|
maxVideoChannelUsers?: number;
|
|
228
229
|
maxStageVideoChannelUsers?: number;
|
|
229
230
|
approximateMemberCount?: number;
|
|
@@ -232,13 +233,15 @@ export interface Guild {
|
|
|
232
233
|
nsfwLevel: GuildNSFWLevel;
|
|
233
234
|
stickers?: Array<Sticker>;
|
|
234
235
|
premiumProgressBarEnabled: boolean;
|
|
235
|
-
|
|
236
|
+
safetyAlertsChannelId: snowflake | null;
|
|
236
237
|
incidentsData: IncidentsData | null;
|
|
237
238
|
}
|
|
239
|
+
/** https://discord.com/developers/docs/resources/guild#unavailable-guild-object */
|
|
238
240
|
export interface UnavailableGuild {
|
|
239
241
|
id: snowflake;
|
|
240
242
|
unavailable: boolean;
|
|
241
243
|
}
|
|
244
|
+
/** https://discord.com/developers/docs/resources/guild#guild-preview-object-guild-preview-structure */
|
|
242
245
|
export interface GuildPreview {
|
|
243
246
|
id: snowflake;
|
|
244
247
|
name: string;
|
|
@@ -252,10 +255,12 @@ export interface GuildPreview {
|
|
|
252
255
|
description: string | null;
|
|
253
256
|
stickers?: Array<Sticker>;
|
|
254
257
|
}
|
|
258
|
+
/** https://discord.com/developers/docs/resources/guild#guild-widget-settings-object-guild-widget-settings-structure */
|
|
255
259
|
export interface GuildWidgetSettings {
|
|
256
260
|
enabled: boolean;
|
|
257
|
-
|
|
261
|
+
channelId: snowflake | null;
|
|
258
262
|
}
|
|
263
|
+
/** https://discord.com/developers/docs/resources/guild#guild-widget-object-guild-widget-structure */
|
|
259
264
|
export interface GuildWidget {
|
|
260
265
|
id: snowflake;
|
|
261
266
|
name: string;
|
|
@@ -264,6 +269,7 @@ export interface GuildWidget {
|
|
|
264
269
|
members: Array<User>;
|
|
265
270
|
presenceCount: number;
|
|
266
271
|
}
|
|
272
|
+
/** https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure */
|
|
267
273
|
export interface GuildMember {
|
|
268
274
|
user?: User;
|
|
269
275
|
nick?: string | null;
|
|
@@ -281,13 +287,14 @@ export interface GuildMember {
|
|
|
281
287
|
unusualDMActivityUntil?: timestamp | null;
|
|
282
288
|
avatarDecorationData?: AvatarDecorationData | null;
|
|
283
289
|
}
|
|
290
|
+
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-structure */
|
|
284
291
|
export interface Integration {
|
|
285
292
|
id: snowflake;
|
|
286
293
|
name: string;
|
|
287
294
|
type: string;
|
|
288
295
|
enabled: boolean;
|
|
289
296
|
syncing?: boolean;
|
|
290
|
-
|
|
297
|
+
roleId?: snowflake;
|
|
291
298
|
enableEmoticons?: boolean;
|
|
292
299
|
expireBehavior?: IntegrationExpireBehaviors;
|
|
293
300
|
expireGracePeriod?: number;
|
|
@@ -299,10 +306,12 @@ export interface Integration {
|
|
|
299
306
|
application?: IntegrationApplication;
|
|
300
307
|
scopes?: Array<OAuth2Scopes>;
|
|
301
308
|
}
|
|
309
|
+
/** https://discord.com/developers/docs/resources/guild#integration-account-object-integration-account-structure */
|
|
302
310
|
export interface IntegrationAccount {
|
|
303
311
|
id: snowflake;
|
|
304
312
|
name: string;
|
|
305
313
|
}
|
|
314
|
+
/** https://discord.com/developers/docs/resources/guild#integration-application-object-integration-application-structure */
|
|
306
315
|
export interface IntegrationApplication {
|
|
307
316
|
id: snowflake;
|
|
308
317
|
name: string;
|
|
@@ -310,27 +319,32 @@ export interface IntegrationApplication {
|
|
|
310
319
|
description: string;
|
|
311
320
|
bot?: User;
|
|
312
321
|
}
|
|
322
|
+
/** https://discord.com/developers/docs/resources/guild#ban-object-ban-structure */
|
|
313
323
|
export interface Ban {
|
|
314
324
|
reason: string | null;
|
|
315
325
|
user: User;
|
|
316
326
|
}
|
|
327
|
+
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-structure */
|
|
317
328
|
export interface WelcomeScreen {
|
|
318
329
|
description: string | null;
|
|
319
330
|
welcomeChannels: Array<WelcomeScreenChannel>;
|
|
320
331
|
}
|
|
332
|
+
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-channel-structure */
|
|
321
333
|
export interface WelcomeScreenChannel {
|
|
322
|
-
|
|
334
|
+
channelId: snowflake;
|
|
323
335
|
description: string;
|
|
324
|
-
|
|
336
|
+
emojiId: snowflake | null;
|
|
325
337
|
emojiName: string | null;
|
|
326
338
|
}
|
|
339
|
+
/** https://discord.com/developers/docs/resources/guild#guild-onboarding-object-guild-onboarding-structure */
|
|
327
340
|
export interface GuildOnboarding {
|
|
328
|
-
|
|
341
|
+
guildId: snowflake;
|
|
329
342
|
prompts: Array<OnboardingPrompt>;
|
|
330
|
-
|
|
343
|
+
defaultChannelIds: Array<snowflake>;
|
|
331
344
|
enabled: boolean;
|
|
332
345
|
mode: OnboardingMode;
|
|
333
346
|
}
|
|
347
|
+
/** https://discord.com/developers/docs/resources/guild#guild-onboarding-object-onboarding-prompt-structure */
|
|
334
348
|
export interface OnboardingPrompt {
|
|
335
349
|
id: snowflake;
|
|
336
350
|
type: PromptTypes;
|
|
@@ -340,17 +354,19 @@ export interface OnboardingPrompt {
|
|
|
340
354
|
required: boolean;
|
|
341
355
|
inOnboarding: boolean;
|
|
342
356
|
}
|
|
357
|
+
/** https://discord.com/developers/docs/resources/guild#guild-onboarding-object-prompt-option-structure */
|
|
343
358
|
export interface PromptOption {
|
|
344
359
|
id: snowflake;
|
|
345
|
-
|
|
346
|
-
|
|
360
|
+
channelIds: Array<snowflake>;
|
|
361
|
+
roleIds: Array<snowflake>;
|
|
347
362
|
emoji?: Emoji;
|
|
348
|
-
|
|
363
|
+
emojiId?: snowflake;
|
|
349
364
|
emojiName?: string;
|
|
350
365
|
emojiAnimated?: boolean;
|
|
351
366
|
title: string;
|
|
352
367
|
description: string | null;
|
|
353
368
|
}
|
|
369
|
+
/** https://discord.com/developers/docs/resources/guild#incidents-data-object-incidents-data-structure */
|
|
354
370
|
export interface IncidentsData {
|
|
355
371
|
invitesDisabledUntil: timestamp | null;
|
|
356
372
|
dmsDisabledUntil: timestamp | null;
|
|
@@ -6,7 +6,7 @@ import type { snowflake } from "./common";
|
|
|
6
6
|
import type { RawEntitlement, Entitlement } from "./entitlements";
|
|
7
7
|
import type { RawGuildMember, GuildMember, Guild, RawGuild } from "./guild";
|
|
8
8
|
import type { RawMessage, RawAttachment, RawEmbed, RawAllowedMentions, Message, Attachment, Embed, AllowedMentions } from "./message";
|
|
9
|
-
import type { ActionRow, ChannelSelectInteractionResponse, Container, File, Label, LabelInteractionResponse, MediaGallery, MentionableSelectInteractionResponse, RawActionRow, RawChannelSelectInteractionResponse, RawContainer, RawFile, RawLabel, RawLabelInteractionResponse, RawMediaGallery, RawMentionableSelectInteractionResponse, RawRoleSelectInteractionResponse, RawSection, RawSeparator, RawStringSelectInteractionResponse, RawTextDisplay, RawTextDisplayInteractionResponse, RawTextInputInteractionResponse, RawUserSelectInteractionResponse, RoleSelectInteractionResponse, Section, Separator, StringSelectInteractionResponse, TextDisplay, TextDisplayInteractionResponse, TextInputInteractionResponse, UserSelectInteractionResponse } from "./components";
|
|
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";
|
|
@@ -57,7 +57,7 @@ export interface RawModalSubmitData {
|
|
|
57
57
|
custom_id: string;
|
|
58
58
|
components: Array<{
|
|
59
59
|
type: ComponentTypes.ActionRow;
|
|
60
|
-
components: Array<RawTextInputInteractionResponse | RawStringSelectInteractionResponse | RawUserSelectInteractionResponse | RawRoleSelectInteractionResponse | RawMentionableSelectInteractionResponse | RawChannelSelectInteractionResponse>;
|
|
60
|
+
components: Array<RawTextInputInteractionResponse | RawStringSelectInteractionResponse | RawUserSelectInteractionResponse | RawRoleSelectInteractionResponse | RawMentionableSelectInteractionResponse | RawChannelSelectInteractionResponse | RawFileUploadInteractionResponse>;
|
|
61
61
|
} | RawTextDisplayInteractionResponse | RawLabelInteractionResponse>;
|
|
62
62
|
resolved?: RawResolvedData;
|
|
63
63
|
}
|
|
@@ -130,17 +130,18 @@ export interface RawInteractionResource {
|
|
|
130
130
|
export interface RawActivityInstanceResource {
|
|
131
131
|
id: string;
|
|
132
132
|
}
|
|
133
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure */
|
|
133
134
|
export interface Interaction {
|
|
134
135
|
id: snowflake;
|
|
135
|
-
|
|
136
|
+
applicationId: snowflake;
|
|
136
137
|
type: InteractionType;
|
|
137
138
|
data?: ApplicationCommandData & MessageComponentData & ModalSubmitData;
|
|
138
139
|
guild?: {
|
|
139
140
|
locale: Locales;
|
|
140
141
|
} & Pick<Guild, "id" | "features">;
|
|
141
|
-
|
|
142
|
+
guildId?: snowflake;
|
|
142
143
|
channel?: Channel;
|
|
143
|
-
|
|
144
|
+
channelId?: snowflake;
|
|
144
145
|
member?: GuildMember;
|
|
145
146
|
user?: User;
|
|
146
147
|
token: string;
|
|
@@ -154,29 +155,33 @@ export interface Interaction {
|
|
|
154
155
|
context?: InteractionContextTypes;
|
|
155
156
|
attachmentSizeLimit: number;
|
|
156
157
|
}
|
|
158
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-data-structure */
|
|
157
159
|
export interface ApplicationCommandData {
|
|
158
160
|
id: snowflake;
|
|
159
161
|
name: string;
|
|
160
162
|
type: ApplicationCommandTypes;
|
|
161
163
|
resolved?: ResolvedData;
|
|
162
164
|
options?: Array<ApplicationCommandInteractionDataOption>;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
guildId?: snowflake;
|
|
166
|
+
targetId?: snowflake;
|
|
165
167
|
}
|
|
168
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-message-component-data-structure */
|
|
166
169
|
export interface MessageComponentData {
|
|
167
|
-
|
|
170
|
+
customId: string;
|
|
168
171
|
componentType: ComponentTypes;
|
|
169
172
|
values?: Array<string>;
|
|
170
173
|
resolved?: ResolvedData;
|
|
171
174
|
}
|
|
175
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure */
|
|
172
176
|
export interface ModalSubmitData {
|
|
173
|
-
|
|
177
|
+
customId: string;
|
|
174
178
|
components: Array<{
|
|
175
179
|
type: ComponentTypes.ActionRow;
|
|
176
|
-
components: Array<TextInputInteractionResponse | StringSelectInteractionResponse | UserSelectInteractionResponse | RoleSelectInteractionResponse | MentionableSelectInteractionResponse | ChannelSelectInteractionResponse>;
|
|
180
|
+
components: Array<TextInputInteractionResponse | StringSelectInteractionResponse | UserSelectInteractionResponse | RoleSelectInteractionResponse | MentionableSelectInteractionResponse | ChannelSelectInteractionResponse | FileUploadInteractionResponse>;
|
|
177
181
|
} | TextDisplayInteractionResponse | LabelInteractionResponse>;
|
|
178
182
|
resolved?: ResolvedData;
|
|
179
183
|
}
|
|
184
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */
|
|
180
185
|
export interface ResolvedData {
|
|
181
186
|
users?: Record<snowflake, User>;
|
|
182
187
|
members?: Record<snowflake, GuildMember>;
|
|
@@ -185,6 +190,7 @@ export interface ResolvedData {
|
|
|
185
190
|
messages?: Record<snowflake, Message>;
|
|
186
191
|
attachments?: Record<snowflake, Attachment>;
|
|
187
192
|
}
|
|
193
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-interaction-data-option-structure */
|
|
188
194
|
export interface ApplicationCommandInteractionDataOption {
|
|
189
195
|
name: string;
|
|
190
196
|
type: ApplicationCommandOptionType;
|
|
@@ -192,6 +198,7 @@ export interface ApplicationCommandInteractionDataOption {
|
|
|
192
198
|
options?: Array<ApplicationCommandInteractionDataOption>;
|
|
193
199
|
focused?: boolean;
|
|
194
200
|
}
|
|
201
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object-message-interaction-structure */
|
|
195
202
|
export interface MessageInteraction {
|
|
196
203
|
id: snowflake;
|
|
197
204
|
type: InteractionType;
|
|
@@ -199,10 +206,12 @@ export interface MessageInteraction {
|
|
|
199
206
|
user: User;
|
|
200
207
|
member?: GuildMember;
|
|
201
208
|
}
|
|
209
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-response-structure */
|
|
202
210
|
export interface InteractionResponse {
|
|
203
211
|
type: InteractionCallbackType;
|
|
204
212
|
data?: InteractionCallbackData;
|
|
205
213
|
}
|
|
214
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-structure */
|
|
206
215
|
export interface InteractionCallbackData {
|
|
207
216
|
tts?: boolean;
|
|
208
217
|
content?: string;
|
|
@@ -214,26 +223,30 @@ export interface InteractionCallbackData {
|
|
|
214
223
|
poll?: PollCreateParams;
|
|
215
224
|
files?: Array<FileData>;
|
|
216
225
|
choices?: Array<ApplicationCommandOptionChoice>;
|
|
217
|
-
|
|
226
|
+
customId?: string;
|
|
218
227
|
title?: string;
|
|
219
228
|
}
|
|
229
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-response-object */
|
|
220
230
|
export interface InteractionCallbackResponse {
|
|
221
231
|
interaction: InteractionCallback;
|
|
222
232
|
resource?: InteractionResource;
|
|
223
233
|
}
|
|
234
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-object */
|
|
224
235
|
export interface InteractionCallback {
|
|
225
236
|
id: snowflake;
|
|
226
237
|
type: InteractionType;
|
|
227
|
-
|
|
228
|
-
|
|
238
|
+
activityInstanceId?: string;
|
|
239
|
+
responseMessageId?: snowflake;
|
|
229
240
|
responseMessageLoading?: boolean;
|
|
230
241
|
responseMessageEphemeral?: boolean;
|
|
231
242
|
}
|
|
243
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-resource-object */
|
|
232
244
|
export interface InteractionResource {
|
|
233
245
|
type: InteractionCallbackType;
|
|
234
246
|
activityInstance?: ActivityInstanceResource;
|
|
235
247
|
message?: Message;
|
|
236
248
|
}
|
|
249
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-activity-instance-resource */
|
|
237
250
|
export interface ActivityInstanceResource {
|
|
238
251
|
id: string;
|
|
239
252
|
}
|
|
@@ -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;
|
|
@@ -53,6 +54,7 @@ export interface Invite {
|
|
|
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;
|
|
@@ -15,13 +15,15 @@ export interface RawLobbyMember {
|
|
|
15
15
|
metadata?: Record<string, string> | null;
|
|
16
16
|
flags?: LobbyMemberFlags;
|
|
17
17
|
}
|
|
18
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-object */
|
|
18
19
|
export interface Lobby {
|
|
19
20
|
id: snowflake;
|
|
20
|
-
|
|
21
|
+
applicationId: snowflake;
|
|
21
22
|
metadata: Record<string, string> | null;
|
|
22
23
|
members: Array<LobbyMember>;
|
|
23
24
|
linkedChannel: RawChannel;
|
|
24
25
|
}
|
|
26
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-structure */
|
|
25
27
|
export interface LobbyMember {
|
|
26
28
|
id: snowflake;
|
|
27
29
|
metadata?: Record<string, string> | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
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";
|
|
@@ -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;
|
|
@@ -196,6 +196,13 @@ export interface RawAllowedMentions {
|
|
|
196
196
|
users?: Array<snowflake>;
|
|
197
197
|
replied_user?: boolean;
|
|
198
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
|
+
}
|
|
199
206
|
/** https://discord.com/developers/docs/resources/message#message-pin-object-message-pin-structure */
|
|
200
207
|
export interface RawMessagePin {
|
|
201
208
|
pinnet_at: timestamp;
|
|
@@ -203,7 +210,7 @@ export interface RawMessagePin {
|
|
|
203
210
|
}
|
|
204
211
|
export interface Message {
|
|
205
212
|
id: snowflake;
|
|
206
|
-
|
|
213
|
+
channelId: snowflake;
|
|
207
214
|
author: User;
|
|
208
215
|
content: string;
|
|
209
216
|
timestamp: timestamp;
|
|
@@ -218,11 +225,11 @@ export interface Message {
|
|
|
218
225
|
reactions?: Array<Reaction>;
|
|
219
226
|
nonce?: number | string;
|
|
220
227
|
pinned: boolean;
|
|
221
|
-
|
|
228
|
+
webhookId?: snowflake;
|
|
222
229
|
type: MessageTypes;
|
|
223
230
|
activity?: MessageActivity;
|
|
224
|
-
application?: Application
|
|
225
|
-
|
|
231
|
+
application?: Partial<Application>;
|
|
232
|
+
applicationId?: snowflake;
|
|
226
233
|
flags?: MessageFlags;
|
|
227
234
|
messageReference?: MessageReference;
|
|
228
235
|
messageSnapshots?: Array<MessageSnapshot>;
|
|
@@ -241,15 +248,15 @@ export interface Message {
|
|
|
241
248
|
}
|
|
242
249
|
export interface MessageActivity {
|
|
243
250
|
type: MessageActivityTypes;
|
|
244
|
-
|
|
251
|
+
partyId?: string;
|
|
245
252
|
}
|
|
246
253
|
export interface MessageInteractionMetadata {
|
|
247
254
|
id: snowflake;
|
|
248
255
|
type: InteractionType;
|
|
249
256
|
user: User;
|
|
250
257
|
authorizingIntegrationOwners: Record<ApplicationIntegrationTypes, string>;
|
|
251
|
-
|
|
252
|
-
|
|
258
|
+
originalResponseMessageId?: snowflake;
|
|
259
|
+
interactedMessageId?: snowflake;
|
|
253
260
|
triggeringInteractionMetadata?: MessageInteractionMetadata;
|
|
254
261
|
}
|
|
255
262
|
export interface MessageCall {
|
|
@@ -258,9 +265,9 @@ export interface MessageCall {
|
|
|
258
265
|
}
|
|
259
266
|
export interface MessageReference {
|
|
260
267
|
type?: MessageReferenceTypes;
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
268
|
+
messageId?: snowflake;
|
|
269
|
+
channelId?: snowflake;
|
|
270
|
+
guildId?: snowflake;
|
|
264
271
|
failIfNotExists?: boolean;
|
|
265
272
|
}
|
|
266
273
|
export interface MessageSnapshot {
|
|
@@ -335,9 +342,9 @@ export interface PollResultEmbedFields {
|
|
|
335
342
|
pollQuestionText: string;
|
|
336
343
|
victorAnswerVotes: Array<number>;
|
|
337
344
|
totalVotes: number;
|
|
338
|
-
|
|
345
|
+
victorAnswerId?: snowflake;
|
|
339
346
|
victorAnswerText?: string;
|
|
340
|
-
|
|
347
|
+
victorAnswerEmojiId?: snowflake;
|
|
341
348
|
victorAnswerEmojiName?: string;
|
|
342
349
|
victorAnswerEmojiAnimated?: boolean;
|
|
343
350
|
}
|
|
@@ -359,7 +366,7 @@ export interface Attachment {
|
|
|
359
366
|
}
|
|
360
367
|
export interface ChannelMention {
|
|
361
368
|
id: snowflake;
|
|
362
|
-
|
|
369
|
+
guildId: snowflake;
|
|
363
370
|
type: ChannelTypes;
|
|
364
371
|
name: string;
|
|
365
372
|
}
|
|
@@ -369,6 +376,13 @@ export interface AllowedMentions {
|
|
|
369
376
|
users?: Array<snowflake>;
|
|
370
377
|
repliedUser?: boolean;
|
|
371
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
|
+
}
|
|
372
386
|
export interface MessagePin {
|
|
373
387
|
pinnetAt: timestamp;
|
|
374
388
|
message: Message;
|
package/dist/lib/types/poll.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export interface RawPollAnswerCount {
|
|
|
38
38
|
count: number;
|
|
39
39
|
me_voted: boolean;
|
|
40
40
|
}
|
|
41
|
+
/** https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure */
|
|
41
42
|
export interface Poll {
|
|
42
43
|
question: PollMedia;
|
|
43
44
|
answers: Array<PollAnswer>;
|
|
@@ -46,6 +47,7 @@ export interface Poll {
|
|
|
46
47
|
layoutType: LayoutType;
|
|
47
48
|
results?: PollResults;
|
|
48
49
|
}
|
|
50
|
+
/** https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure */
|
|
49
51
|
export interface PollCreateParams {
|
|
50
52
|
question: PollMedia;
|
|
51
53
|
answers: Array<PollAnswer>;
|
|
@@ -53,18 +55,22 @@ export interface PollCreateParams {
|
|
|
53
55
|
allowMultiselect?: boolean;
|
|
54
56
|
layoutType?: LayoutType;
|
|
55
57
|
}
|
|
58
|
+
/** https://discord.com/developers/docs/resources/poll#poll-media-object-poll-media-object-structure */
|
|
56
59
|
export interface PollMedia {
|
|
57
60
|
text?: string;
|
|
58
61
|
emoji?: Pick<Emoji, "id" | "name">;
|
|
59
62
|
}
|
|
63
|
+
/** https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure */
|
|
60
64
|
export interface PollAnswer {
|
|
61
|
-
|
|
65
|
+
answerId: number;
|
|
62
66
|
pollMedia: PollMedia;
|
|
63
67
|
}
|
|
68
|
+
/** https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure */
|
|
64
69
|
export interface PollResults {
|
|
65
70
|
isFinalized: boolean;
|
|
66
71
|
answerCounts: Array<PollAnswerCount>;
|
|
67
72
|
}
|
|
73
|
+
/** https://discord.com/developers/docs/resources/poll#poll-results-object-poll-answer-count-object-structure */
|
|
68
74
|
export interface PollAnswerCount {
|
|
69
75
|
id: number;
|
|
70
76
|
count: number;
|
package/dist/lib/types/role.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export interface RawRoleColors {
|
|
|
31
31
|
secondary_color: number | null;
|
|
32
32
|
tertiary_color: number | null;
|
|
33
33
|
}
|
|
34
|
+
/** https://discord.com/developers/docs/topics/permissions#role-object-role-structure */
|
|
34
35
|
export interface Role {
|
|
35
36
|
id: snowflake;
|
|
36
37
|
name: string;
|
|
@@ -46,14 +47,16 @@ export interface Role {
|
|
|
46
47
|
tags?: RoleTags;
|
|
47
48
|
flags: RoleFlags;
|
|
48
49
|
}
|
|
50
|
+
/** https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure */
|
|
49
51
|
export interface RoleTags {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
botId?: snowflake;
|
|
53
|
+
integrationId?: snowflake;
|
|
52
54
|
premiumSubscriber?: null;
|
|
53
|
-
|
|
55
|
+
subscriptionListingId?: snowflake;
|
|
54
56
|
availableForPurchase?: null;
|
|
55
57
|
guildConnections?: null;
|
|
56
58
|
}
|
|
59
|
+
/** https://discord.com/developers/docs/topics/permissions#role-object-role-colors-object */
|
|
57
60
|
export interface RoleColors {
|
|
58
61
|
primaryColor: number;
|
|
59
62
|
secondaryColor: number | null;
|
package/dist/lib/types/sku.d.ts
CHANGED
|
@@ -9,10 +9,11 @@ export interface RawSKU {
|
|
|
9
9
|
slug: string;
|
|
10
10
|
flags: SKUFlags;
|
|
11
11
|
}
|
|
12
|
+
/** https://discord.com/developers/docs/resources/sku#sku-object-sku-structure */
|
|
12
13
|
export interface SKU {
|
|
13
14
|
id: snowflake;
|
|
14
15
|
type: SKUTypes;
|
|
15
|
-
|
|
16
|
+
applicationId: snowflake;
|
|
16
17
|
name: string;
|
|
17
18
|
slug: string;
|
|
18
19
|
flags: SKUFlags;
|
|
@@ -11,13 +11,14 @@ export interface RawSoundboardSound {
|
|
|
11
11
|
available: boolean;
|
|
12
12
|
user?: RawUser;
|
|
13
13
|
}
|
|
14
|
+
/** https://discord.com/developers/docs/resources/soundboard#soundboard-sound-structure */
|
|
14
15
|
export interface SoundboardSound {
|
|
15
16
|
name: string;
|
|
16
|
-
|
|
17
|
+
soundId: snowflake;
|
|
17
18
|
volume: number;
|
|
18
|
-
|
|
19
|
+
emojiId: snowflake | null;
|
|
19
20
|
emojiName: string | null;
|
|
20
|
-
|
|
21
|
+
guildId?: snowflake;
|
|
21
22
|
available: boolean;
|
|
22
23
|
user?: User;
|
|
23
24
|
}
|
|
@@ -10,12 +10,13 @@ export interface RawStageInstance {
|
|
|
10
10
|
discoverable_disabled: boolean;
|
|
11
11
|
guild_scheduled_event_id: snowflake | null;
|
|
12
12
|
}
|
|
13
|
+
/** https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure */
|
|
13
14
|
export interface StageInstance {
|
|
14
15
|
id: snowflake;
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
guildId: snowflake;
|
|
17
|
+
channelId: snowflake;
|
|
17
18
|
topic: string;
|
|
18
19
|
privacyLevel: PrivacyLevel;
|
|
19
20
|
discoverableDisabled: boolean;
|
|
20
|
-
|
|
21
|
+
guildScheduledEventId: snowflake | null;
|
|
21
22
|
}
|