disgroove 2.2.6-dev.fd02f21 → 2.2.7-dev.045389f
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 +14 -52
- package/dist/lib/Client.js +42 -59
- package/dist/lib/constants.d.ts +28 -22
- package/dist/lib/constants.js +29 -23
- package/dist/lib/gateway/Shard.js +14 -0
- package/dist/lib/rest/RequestManager.d.ts +1 -3
- package/dist/lib/transformers/Components.d.ts +13 -3
- package/dist/lib/transformers/Components.js +199 -126
- package/dist/lib/transformers/Interactions.js +32 -38
- package/dist/lib/transformers/Messages.d.ts +4 -3
- package/dist/lib/transformers/Messages.js +48 -34
- package/dist/lib/types/gateway-events.d.ts +20 -0
- package/dist/lib/types/interaction.d.ts +6 -12
- package/dist/lib/types/invite.d.ts +2 -2
- package/dist/lib/types/message-components.d.ts +219 -122
- package/dist/lib/types/message.d.ts +3 -5
- package/dist/package.json +6 -6
- package/package.json +6 -6
package/dist/lib/Client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
/// <reference types="node" />
|
|
4
|
-
import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, type
|
|
4
|
+
import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, type ReactionTypes, type ApplicationCommandTypes, type EventTypes, type TriggerTypes, type ChannelTypes, type VideoQualityModes, type SortOrderTypes, type ForumLayoutTypes, type InviteTargetTypes, type VerificationLevel, type DefaultMessageNotificationLevel, type ExplicitContentFilterLevel, type SystemChannelFlags, type ApplicationFlags, type ApplicationIntegrationTypes, type ChannelFlags, type GuildFeatures, type GuildScheduledEventEntityTypes, type GuildScheduledEventPrivacyLevel, type GuildScheduledEventStatus, type MessageFlags, type OnboardingMode, type PrivacyLevel, type GuildMemberFlags, type InteractionContextTypes } from "./constants";
|
|
5
5
|
import { RequestManager, type FileData } from "./rest";
|
|
6
6
|
import EventEmitter from "node:events";
|
|
7
7
|
import { Shard } from "./gateway";
|
|
@@ -14,7 +14,7 @@ import type { Channel, FollowedChannel, ThreadMember, Overwrite, DefaultReaction
|
|
|
14
14
|
import type { LocaleMap, snowflake, timestamp } from "./types/common";
|
|
15
15
|
import type { Emoji } from "./types/emoji";
|
|
16
16
|
import type { Entitlement } from "./types/entitlements";
|
|
17
|
-
import type { AutoModerationActionExecutionEventFields, ChannelPinsUpdateEventFields, ThreadListSyncEventFields, ThreadMemberUpdateEventExtraFields, ThreadMembersUpdateEventFields, GuildCreateEventExtraFields, GuildAuditLogEntryCreateExtraFields, GuildBanAddEventFields, GuildBanRemoveEventFields, GuildMemberAddEventExtraFields, GuildMemberRemoveEventFields, GuildMemberUpdateEventFields, GuildMembersChunkEventFields, IntegrationCreateEventExtraFields, IntegrationUpdateEventExtraFields, IntegrationDeleteEventFields, InviteCreateEventFields, InviteDeleteEventFields, MessageCreateEventExtraFields, MessageDeleteEventFields, MessageDeleteBulkEventFields, MessageReactionAddEventFields, MessageReactionRemoveEventFields, MessageReactionRemoveAllEventFields, MessageReactionRemoveEmojiEventFields, PresenceUpdateEventFields, TypingStartEventFields, VoiceServerUpdateEventFields, MessagePollVoteAddFields, MessagePollVoteRemoveFields, GatewayPresenceUpdate, RawPayload, IdentifyConnectionProperties, VoiceChannelEffectSendEventFields, GuildSoundboardSoundDeleteEventFields } from "./types/gateway-events";
|
|
17
|
+
import type { AutoModerationActionExecutionEventFields, ChannelPinsUpdateEventFields, ThreadListSyncEventFields, ThreadMemberUpdateEventExtraFields, ThreadMembersUpdateEventFields, GuildCreateEventExtraFields, GuildAuditLogEntryCreateExtraFields, GuildBanAddEventFields, GuildBanRemoveEventFields, GuildMemberAddEventExtraFields, GuildMemberRemoveEventFields, GuildMemberUpdateEventFields, GuildMembersChunkEventFields, IntegrationCreateEventExtraFields, IntegrationUpdateEventExtraFields, IntegrationDeleteEventFields, InviteCreateEventFields, InviteDeleteEventFields, MessageCreateEventExtraFields, MessageDeleteEventFields, MessageDeleteBulkEventFields, MessageReactionAddEventFields, MessageReactionRemoveEventFields, MessageReactionRemoveAllEventFields, MessageReactionRemoveEmojiEventFields, PresenceUpdateEventFields, TypingStartEventFields, VoiceServerUpdateEventFields, MessagePollVoteAddFields, MessagePollVoteRemoveFields, GatewayPresenceUpdate, RawPayload, IdentifyConnectionProperties, VoiceChannelEffectSendEventFields, GuildSoundboardSoundDeleteEventFields, RateLimitedFields } from "./types/gateway-events";
|
|
18
18
|
import type { Guild, GuildMember, WelcomeScreen, GuildWidgetSettings, Ban, Integration, GuildOnboarding, GuildPreview, GuildWidget, UnavailableGuild, OnboardingPrompt, WelcomeScreenChannel, IncidentsData } from "./types/guild";
|
|
19
19
|
import type { GuildScheduledEvent, GuildScheduledEventUser, GuildScheduledEventEntityMetadata, GuildScheduledEventRecurrenceRule } from "./types/guild-scheduled-event";
|
|
20
20
|
import type { GuildTemplate } from "./types/guild-template";
|
|
@@ -29,9 +29,10 @@ import type { User, ApplicationRoleConnection, Connection } from "./types/user";
|
|
|
29
29
|
import type { VoiceRegion, VoiceState } from "./types/voice";
|
|
30
30
|
import type { Webhook } from "./types/webhook";
|
|
31
31
|
import type { ClientOptions as WebSocketOptions } from "ws";
|
|
32
|
-
import type { Embed, AllowedMentions, Attachment, Message, MessageReference,
|
|
32
|
+
import type { Embed, AllowedMentions, Attachment, Message, MessageReference, MessagePin } from "./types/message";
|
|
33
33
|
import type { Subscription } from "./types/subscription";
|
|
34
34
|
import type { SoundboardSound } from "./types/soundboard";
|
|
35
|
+
import type { ActionRow, Button, ChannelSelect, Container, File, MediaGallery, MentionableSelect, RoleSelect, Section, Separator, StringSelect, TextDisplay, Thumbnail, UserSelect } from "./types/message-components";
|
|
35
36
|
export interface GatewayOptions {
|
|
36
37
|
properties?: IdentifyConnectionProperties;
|
|
37
38
|
compress?: boolean;
|
|
@@ -203,33 +204,6 @@ export declare class Client extends EventEmitter {
|
|
|
203
204
|
accessTokens: Array<string>;
|
|
204
205
|
nicks: Array<string>;
|
|
205
206
|
}): Promise<Channel>;
|
|
206
|
-
/** https://discord.com/developers/docs/resources/guild#create-guild */
|
|
207
|
-
createGuild(options: {
|
|
208
|
-
name: string;
|
|
209
|
-
icon?: string;
|
|
210
|
-
verificationLevel?: VerificationLevel;
|
|
211
|
-
defaultMessageNotifications?: DefaultMessageNotificationLevel;
|
|
212
|
-
explicitContentFilter?: ExplicitContentFilterLevel;
|
|
213
|
-
roles?: Array<{
|
|
214
|
-
name?: string;
|
|
215
|
-
permissions?: string;
|
|
216
|
-
color?: number;
|
|
217
|
-
hoist?: boolean;
|
|
218
|
-
icon?: string | null;
|
|
219
|
-
unicodeEmoji?: string | null;
|
|
220
|
-
mentionable?: boolean;
|
|
221
|
-
}>;
|
|
222
|
-
channels?: Array<{
|
|
223
|
-
name: string;
|
|
224
|
-
type: ChannelTypes;
|
|
225
|
-
id?: number;
|
|
226
|
-
parentID?: number;
|
|
227
|
-
}>;
|
|
228
|
-
afkChannelID?: snowflake;
|
|
229
|
-
afkTimeout?: number;
|
|
230
|
-
systemChannelID?: snowflake;
|
|
231
|
-
systemChannelFlags?: SystemChannelFlags;
|
|
232
|
-
}): Promise<Guild>;
|
|
233
207
|
/** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
|
|
234
208
|
createGuildApplicationCommand(applicationID: snowflake, guildID: snowflake, options: {
|
|
235
209
|
name: string;
|
|
@@ -252,11 +226,6 @@ export declare class Client extends EventEmitter {
|
|
|
252
226
|
image: string;
|
|
253
227
|
roles: Array<snowflake>;
|
|
254
228
|
}, reason?: string): Promise<Emoji>;
|
|
255
|
-
/** https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template */
|
|
256
|
-
createGuildFromTemplate(code: string, options: {
|
|
257
|
-
name: string;
|
|
258
|
-
icon?: string;
|
|
259
|
-
}): Promise<Guild>;
|
|
260
229
|
/** https://discord.com/developers/docs/resources/guild#create-guild-role */
|
|
261
230
|
createGuildRole(guildID: snowflake, options: {
|
|
262
231
|
name?: string;
|
|
@@ -307,7 +276,7 @@ export declare class Client extends EventEmitter {
|
|
|
307
276
|
tts?: boolean;
|
|
308
277
|
embeds?: Array<Embed>;
|
|
309
278
|
allowedMentions?: AllowedMentions;
|
|
310
|
-
components?: Array<
|
|
279
|
+
components?: Array<ActionRow | Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container>;
|
|
311
280
|
files?: Array<FileData> | null;
|
|
312
281
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
313
282
|
flags?: MessageFlags;
|
|
@@ -327,7 +296,7 @@ export declare class Client extends EventEmitter {
|
|
|
327
296
|
embeds?: Array<Embed>;
|
|
328
297
|
allowedMentions?: AllowedMentions;
|
|
329
298
|
messageReference?: MessageReference;
|
|
330
|
-
components?: Array<
|
|
299
|
+
components?: Array<ActionRow | Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container>;
|
|
331
300
|
stickersIDs?: Array<snowflake>;
|
|
332
301
|
files?: Array<FileData>;
|
|
333
302
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
@@ -360,7 +329,7 @@ export declare class Client extends EventEmitter {
|
|
|
360
329
|
content?: string;
|
|
361
330
|
embeds?: Array<Embed>;
|
|
362
331
|
allowedMentions?: AllowedMentions;
|
|
363
|
-
components?: Array<
|
|
332
|
+
components?: Array<ActionRow | Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container>;
|
|
364
333
|
stickerIDs?: Array<snowflake>;
|
|
365
334
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
366
335
|
flags?: MessageFlags;
|
|
@@ -396,8 +365,6 @@ export declare class Client extends EventEmitter {
|
|
|
396
365
|
deleteChannelPermission(channelID: snowflake, overwriteID: snowflake, reason?: string): void;
|
|
397
366
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
|
|
398
367
|
deleteGlobalApplicationCommand(applicationID: snowflake, commandID: snowflake): void;
|
|
399
|
-
/** https://discord.com/developers/docs/resources/guild#delete-guild */
|
|
400
|
-
deleteGuild(guildID: snowflake): void;
|
|
401
368
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
|
402
369
|
deleteGuildApplicationCommand(applicationID: snowflake, guildID: snowflake, commandID: snowflake): void;
|
|
403
370
|
/** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
|
|
@@ -547,7 +514,6 @@ export declare class Client extends EventEmitter {
|
|
|
547
514
|
afkChannelID?: snowflake | null;
|
|
548
515
|
afkTimeout?: number;
|
|
549
516
|
icon?: string | null;
|
|
550
|
-
ownerID?: snowflake;
|
|
551
517
|
splash?: string | null;
|
|
552
518
|
discoverySplash?: string | null;
|
|
553
519
|
banner?: string | null;
|
|
@@ -591,10 +557,6 @@ export declare class Client extends EventEmitter {
|
|
|
591
557
|
communicationDisabledUntil?: timestamp | null;
|
|
592
558
|
flags?: GuildMemberFlags | null;
|
|
593
559
|
}, reason?: string): Promise<GuildMember>;
|
|
594
|
-
/** https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level */
|
|
595
|
-
editGuildMFALevel(guildID: snowflake, options: {
|
|
596
|
-
level: MFALevel;
|
|
597
|
-
}, reason?: string): Promise<MFALevel>;
|
|
598
560
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */
|
|
599
561
|
editGuildOnboarding(guildID: snowflake, options: {
|
|
600
562
|
prompts?: Array<OnboardingPrompt>;
|
|
@@ -667,7 +629,7 @@ export declare class Client extends EventEmitter {
|
|
|
667
629
|
embeds?: Array<Embed> | null;
|
|
668
630
|
flags?: MessageFlags | null;
|
|
669
631
|
allowedMentions?: AllowedMentions | null;
|
|
670
|
-
components?: Array<
|
|
632
|
+
components?: Array<ActionRow | Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container> | null;
|
|
671
633
|
files?: Array<FileData> | null;
|
|
672
634
|
attachments?: Array<Attachment> | null;
|
|
673
635
|
}): Promise<Message>;
|
|
@@ -681,7 +643,7 @@ export declare class Client extends EventEmitter {
|
|
|
681
643
|
content?: string | null;
|
|
682
644
|
embeds?: Array<Embed> | null;
|
|
683
645
|
allowedMentions?: AllowedMentions | null;
|
|
684
|
-
components?: Array<
|
|
646
|
+
components?: Array<ActionRow | Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container> | null;
|
|
685
647
|
files?: Array<FileData> | null;
|
|
686
648
|
attachments?: Array<Partial<Attachment>> | null;
|
|
687
649
|
poll?: PollCreateParams | null;
|
|
@@ -692,7 +654,7 @@ export declare class Client extends EventEmitter {
|
|
|
692
654
|
content?: string | null;
|
|
693
655
|
embeds?: Array<Embed> | null;
|
|
694
656
|
allowedMentions?: AllowedMentions | null;
|
|
695
|
-
components?: Array<
|
|
657
|
+
components?: Array<ActionRow | Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container> | null;
|
|
696
658
|
files?: Array<FileData> | null;
|
|
697
659
|
attachments?: Array<Partial<Attachment>> | null;
|
|
698
660
|
poll?: PollCreateParams | null;
|
|
@@ -700,7 +662,7 @@ export declare class Client extends EventEmitter {
|
|
|
700
662
|
}): Promise<Message>;
|
|
701
663
|
/** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
|
|
702
664
|
editUserVoiceState(guildID: snowflake, userID: snowflake, options: {
|
|
703
|
-
channelID
|
|
665
|
+
channelID?: snowflake;
|
|
704
666
|
suppress?: boolean;
|
|
705
667
|
}): void;
|
|
706
668
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook */
|
|
@@ -714,7 +676,7 @@ export declare class Client extends EventEmitter {
|
|
|
714
676
|
content?: string | null;
|
|
715
677
|
embeds?: Array<Embed> | null;
|
|
716
678
|
allowedMentions?: AllowedMentions | null;
|
|
717
|
-
components?: Array<
|
|
679
|
+
components?: Array<ActionRow | Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container> | null;
|
|
718
680
|
files?: Array<FileData> | null;
|
|
719
681
|
attachments?: Array<Partial<Attachment>> | null;
|
|
720
682
|
poll?: PollCreateParams | null;
|
|
@@ -736,7 +698,7 @@ export declare class Client extends EventEmitter {
|
|
|
736
698
|
tts?: boolean;
|
|
737
699
|
embeds?: Array<Embed>;
|
|
738
700
|
allowedMentions?: AllowedMentions;
|
|
739
|
-
components?: Array<
|
|
701
|
+
components?: Array<ActionRow | Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container>;
|
|
740
702
|
files?: Array<FileData>;
|
|
741
703
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
742
704
|
flags?: MessageFlags;
|
|
@@ -961,7 +923,6 @@ export declare class Client extends EventEmitter {
|
|
|
961
923
|
/** https://discord.com/developers/docs/resources/invite#get-invite */
|
|
962
924
|
getInvite(code: string, options?: {
|
|
963
925
|
withCounts?: boolean;
|
|
964
|
-
withExpiration?: boolean;
|
|
965
926
|
guildScheduledEventID?: snowflake;
|
|
966
927
|
}): Promise<Invite>;
|
|
967
928
|
/** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads */
|
|
@@ -1125,6 +1086,7 @@ export interface ClientEvents {
|
|
|
1125
1086
|
hello: [interval: number, shard: number];
|
|
1126
1087
|
ready: [];
|
|
1127
1088
|
resumed: [];
|
|
1089
|
+
rateLimited: [rateLimit: RateLimitedFields];
|
|
1128
1090
|
reconnect: [];
|
|
1129
1091
|
invalidSession: [];
|
|
1130
1092
|
applicationCommandPermissionsUpdate: [
|
package/dist/lib/Client.js
CHANGED
|
@@ -288,38 +288,6 @@ class Client extends node_events_1.default {
|
|
|
288
288
|
});
|
|
289
289
|
return transformers_1.Channels.channelFromRaw(response);
|
|
290
290
|
}
|
|
291
|
-
/** https://discord.com/developers/docs/resources/guild#create-guild */
|
|
292
|
-
async createGuild(options) {
|
|
293
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guilds(), {
|
|
294
|
-
json: {
|
|
295
|
-
name: options.name,
|
|
296
|
-
icon: options.icon,
|
|
297
|
-
verification_level: options.verificationLevel,
|
|
298
|
-
default_message_notifications: options.defaultMessageNotifications,
|
|
299
|
-
explicit_content_filter: options.explicitContentFilter,
|
|
300
|
-
roles: options.roles?.map((role) => ({
|
|
301
|
-
name: role.name,
|
|
302
|
-
color: role.color,
|
|
303
|
-
hoist: role.hoist,
|
|
304
|
-
icon: role.icon,
|
|
305
|
-
unicode_emoji: role.unicodeEmoji,
|
|
306
|
-
permissions: role.permissions,
|
|
307
|
-
mentionable: role.mentionable,
|
|
308
|
-
})),
|
|
309
|
-
channels: options.channels?.map((channel) => ({
|
|
310
|
-
name: channel.name,
|
|
311
|
-
type: channel.type,
|
|
312
|
-
id: channel.id,
|
|
313
|
-
parent_id: channel.id,
|
|
314
|
-
})),
|
|
315
|
-
afk_channel_id: options.afkChannelID,
|
|
316
|
-
afk_timeout: options.afkTimeout,
|
|
317
|
-
system_channel_id: options.systemChannelID,
|
|
318
|
-
system_channel_flags: options.systemChannelFlags,
|
|
319
|
-
},
|
|
320
|
-
});
|
|
321
|
-
return transformers_1.Guilds.guildFromRaw(response);
|
|
322
|
-
}
|
|
323
291
|
/** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
|
|
324
292
|
async createGuildApplicationCommand(applicationID, guildID, options) {
|
|
325
293
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationGuildCommands(applicationID, guildID), {
|
|
@@ -358,16 +326,6 @@ class Client extends node_events_1.default {
|
|
|
358
326
|
});
|
|
359
327
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
360
328
|
}
|
|
361
|
-
/** https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template */
|
|
362
|
-
async createGuildFromTemplate(code, options) {
|
|
363
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.template(code), {
|
|
364
|
-
json: {
|
|
365
|
-
name: options.name,
|
|
366
|
-
icon: options.icon,
|
|
367
|
-
},
|
|
368
|
-
});
|
|
369
|
-
return transformers_1.Guilds.guildFromRaw(response);
|
|
370
|
-
}
|
|
371
329
|
/** https://discord.com/developers/docs/resources/guild#create-guild-role */
|
|
372
330
|
async createGuildRole(guildID, options, reason) {
|
|
373
331
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildRoles(guildID), {
|
|
@@ -507,7 +465,38 @@ class Client extends node_events_1.default {
|
|
|
507
465
|
: undefined,
|
|
508
466
|
flags: options.data?.flags,
|
|
509
467
|
components: options.data?.components !== undefined
|
|
510
|
-
?
|
|
468
|
+
? options.data?.components.map((component) => {
|
|
469
|
+
switch (component.type) {
|
|
470
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
471
|
+
return transformers_1.Components.actionRowToRaw(component);
|
|
472
|
+
case constants_1.ComponentTypes.Button:
|
|
473
|
+
return transformers_1.Components.buttonToRaw(component);
|
|
474
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
475
|
+
return transformers_1.Components.stringSelectToRaw(component);
|
|
476
|
+
case constants_1.ComponentTypes.UserSelect:
|
|
477
|
+
return transformers_1.Components.userSelectToRaw(component);
|
|
478
|
+
case constants_1.ComponentTypes.RoleSelect:
|
|
479
|
+
return transformers_1.Components.roleSelectToRaw(component);
|
|
480
|
+
case constants_1.ComponentTypes.MentionableSelect:
|
|
481
|
+
return transformers_1.Components.mentionableSelectToRaw(component);
|
|
482
|
+
case constants_1.ComponentTypes.ChannelSelect:
|
|
483
|
+
return transformers_1.Components.channelSelectToRaw(component);
|
|
484
|
+
case constants_1.ComponentTypes.Section:
|
|
485
|
+
return transformers_1.Components.sectionToRaw(component);
|
|
486
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
487
|
+
return transformers_1.Components.textDisplayToRaw(component);
|
|
488
|
+
case constants_1.ComponentTypes.Thumbnail:
|
|
489
|
+
return transformers_1.Components.thumbnailToRaw(component);
|
|
490
|
+
case constants_1.ComponentTypes.MediaGallery:
|
|
491
|
+
return transformers_1.Components.mediaGalleryToRaw(component);
|
|
492
|
+
case constants_1.ComponentTypes.File:
|
|
493
|
+
return transformers_1.Components.fileToRaw(component);
|
|
494
|
+
case constants_1.ComponentTypes.Separator:
|
|
495
|
+
return transformers_1.Components.separatorToRaw(component);
|
|
496
|
+
case constants_1.ComponentTypes.Container:
|
|
497
|
+
return transformers_1.Components.containerToRaw(component);
|
|
498
|
+
}
|
|
499
|
+
})
|
|
511
500
|
: undefined,
|
|
512
501
|
attachments: options.data?.attachments,
|
|
513
502
|
poll: options.data?.poll !== undefined
|
|
@@ -559,7 +548,16 @@ class Client extends node_events_1.default {
|
|
|
559
548
|
data: {
|
|
560
549
|
custom_id: options.data?.customID,
|
|
561
550
|
components: options.data?.components !== undefined
|
|
562
|
-
?
|
|
551
|
+
? options.data?.components.map((component) => {
|
|
552
|
+
switch (component.type) {
|
|
553
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
554
|
+
return transformers_1.Components.stringSelectToRaw(component);
|
|
555
|
+
case constants_1.ComponentTypes.TextInput:
|
|
556
|
+
return transformers_1.Components.textInputToRaw(component);
|
|
557
|
+
case constants_1.ComponentTypes.Label:
|
|
558
|
+
return transformers_1.Components.labelToRaw(component);
|
|
559
|
+
}
|
|
560
|
+
})
|
|
563
561
|
: undefined,
|
|
564
562
|
title: options.data?.title,
|
|
565
563
|
},
|
|
@@ -764,10 +762,6 @@ class Client extends node_events_1.default {
|
|
|
764
762
|
deleteGlobalApplicationCommand(applicationID, commandID) {
|
|
765
763
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationCommand(applicationID, commandID));
|
|
766
764
|
}
|
|
767
|
-
/** https://discord.com/developers/docs/resources/guild#delete-guild */
|
|
768
|
-
deleteGuild(guildID) {
|
|
769
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guild(guildID));
|
|
770
|
-
}
|
|
771
765
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
|
772
766
|
deleteGuildApplicationCommand(applicationID, guildID, commandID) {
|
|
773
767
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationGuildCommand(applicationID, guildID, commandID));
|
|
@@ -1054,7 +1048,6 @@ class Client extends node_events_1.default {
|
|
|
1054
1048
|
afk_channel_id: options.afkChannelID,
|
|
1055
1049
|
afk_timeout: options.afkTimeout,
|
|
1056
1050
|
icon: options.icon,
|
|
1057
|
-
owner_id: options.ownerID,
|
|
1058
1051
|
splash: options.splash,
|
|
1059
1052
|
discovery_splash: options.discoverySplash,
|
|
1060
1053
|
banner: options.banner,
|
|
@@ -1130,15 +1123,6 @@ class Client extends node_events_1.default {
|
|
|
1130
1123
|
});
|
|
1131
1124
|
return transformers_1.Guilds.guildMemberFromRaw(response);
|
|
1132
1125
|
}
|
|
1133
|
-
/** https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level */
|
|
1134
|
-
editGuildMFALevel(guildID, options, reason) {
|
|
1135
|
-
return this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildMFA(guildID), {
|
|
1136
|
-
json: {
|
|
1137
|
-
level: options.level,
|
|
1138
|
-
},
|
|
1139
|
-
reason,
|
|
1140
|
-
});
|
|
1141
|
-
}
|
|
1142
1126
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */
|
|
1143
1127
|
editGuildOnboarding(guildID, options, reason) {
|
|
1144
1128
|
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildOnboarding(guildID), {
|
|
@@ -2139,7 +2123,6 @@ class Client extends node_events_1.default {
|
|
|
2139
2123
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.invite(code), {
|
|
2140
2124
|
query: {
|
|
2141
2125
|
with_counts: options?.withCounts,
|
|
2142
|
-
with_expiration: options?.withExpiration,
|
|
2143
2126
|
guild_scheduled_event_id: options?.guildScheduledEventID,
|
|
2144
2127
|
},
|
|
2145
2128
|
});
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -106,7 +106,19 @@ export declare enum InteractionContextTypes {
|
|
|
106
106
|
BotDM = 1,
|
|
107
107
|
PrivateChannel = 2
|
|
108
108
|
}
|
|
109
|
-
/** https://discord.com/developers/docs/interactions/
|
|
109
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type */
|
|
110
|
+
export declare enum InteractionCallbackType {
|
|
111
|
+
Pong = 1,
|
|
112
|
+
ChannelMessageWithSource = 4,
|
|
113
|
+
DeferredChannelMessageWithSource = 5,
|
|
114
|
+
DeferredUpdateMessage = 6,
|
|
115
|
+
UpdateMessage = 7,
|
|
116
|
+
ApplicationCommandAutocompleteResult = 8,
|
|
117
|
+
Modal = 9,
|
|
118
|
+
PremiumRequired = 10,
|
|
119
|
+
LaunchActivity = 12
|
|
120
|
+
}
|
|
121
|
+
/** https://discord.com/developers/docs/components/reference#component-object-component-types */
|
|
110
122
|
export declare enum ComponentTypes {
|
|
111
123
|
ActionRow = 1,
|
|
112
124
|
Button = 2,
|
|
@@ -122,26 +134,10 @@ export declare enum ComponentTypes {
|
|
|
122
134
|
MediaGallery = 12,
|
|
123
135
|
File = 13,
|
|
124
136
|
Separator = 14,
|
|
125
|
-
Container = 17
|
|
126
|
-
|
|
127
|
-
/** https://discord.com/developers/docs/components/reference#separator-separator-structure */
|
|
128
|
-
export declare enum SeparatorSpacing {
|
|
129
|
-
Small = 1,
|
|
130
|
-
Large = 2
|
|
137
|
+
Container = 17,
|
|
138
|
+
Label = 18
|
|
131
139
|
}
|
|
132
|
-
/** https://discord.com/developers/docs/
|
|
133
|
-
export declare enum InteractionCallbackType {
|
|
134
|
-
Pong = 1,
|
|
135
|
-
ChannelMessageWithSource = 4,
|
|
136
|
-
DeferredChannelMessageWithSource = 5,
|
|
137
|
-
DeferredUpdateMessage = 6,
|
|
138
|
-
UpdateMessage = 7,
|
|
139
|
-
ApplicationCommandAutocompleteResult = 8,
|
|
140
|
-
Modal = 9,
|
|
141
|
-
PremiumRequired = 10,
|
|
142
|
-
LaunchActivity = 12
|
|
143
|
-
}
|
|
144
|
-
/** https://discord.com/developers/docs/interactions/message-components#button-object-button-styles */
|
|
140
|
+
/** https://discord.com/developers/docs/components/reference#button-button-styles */
|
|
145
141
|
export declare enum ButtonStyles {
|
|
146
142
|
Primary = 1,
|
|
147
143
|
Secondary = 2,
|
|
@@ -150,11 +146,16 @@ export declare enum ButtonStyles {
|
|
|
150
146
|
Link = 5,
|
|
151
147
|
Premium = 6
|
|
152
148
|
}
|
|
153
|
-
/** https://discord.com/developers/docs/
|
|
149
|
+
/** https://discord.com/developers/docs/components/reference#text-input-text-input-styles */
|
|
154
150
|
export declare enum TextInputStyles {
|
|
155
151
|
Short = 1,
|
|
156
152
|
Paragraph = 2
|
|
157
153
|
}
|
|
154
|
+
/** https://discord.com/developers/docs/components/reference#separator-separator-structure */
|
|
155
|
+
export declare enum SeparatorSpacing {
|
|
156
|
+
Small = 1,
|
|
157
|
+
Large = 2
|
|
158
|
+
}
|
|
158
159
|
/** https://discord.com/developers/docs/resources/application#application-object-application-integration-types */
|
|
159
160
|
export declare enum ApplicationIntegrationTypes {
|
|
160
161
|
GuildInstall = 0,
|
|
@@ -254,6 +255,7 @@ export declare enum AuditLogEvents {
|
|
|
254
255
|
AutoModerationBlockMessage = 143,
|
|
255
256
|
AutoModerationFlagToChannel = 144,
|
|
256
257
|
AutoModerationUserCommunicationDisabled = 145,
|
|
258
|
+
AutoModerationQuarantineUser = 146,
|
|
257
259
|
CreatorMonetizationRequestCreated = 150,
|
|
258
260
|
CreatorMonetizationTermsAccepted = 151,
|
|
259
261
|
OnboardingPromptCreate = 163,
|
|
@@ -407,6 +409,7 @@ export declare enum GuildFeatures {
|
|
|
407
409
|
VipRegions = "VIP_REGIONS",
|
|
408
410
|
WelcomeScreenEnabled = "WELCOME_SCREEN_ENABLED",
|
|
409
411
|
GuestsEnabled = "GUESTS_ENABLED",
|
|
412
|
+
GuildTags = "GUILD_TAGS",
|
|
410
413
|
EnhancedRoleColors = "ENHANCED_ROLE_COLORS"
|
|
411
414
|
}
|
|
412
415
|
/** https://discord.com/developers/docs/resources/guild#guild-object-mutable-guild-features */
|
|
@@ -426,7 +429,8 @@ export declare enum GuildMemberFlags {
|
|
|
426
429
|
StartedHomeActions = 32,
|
|
427
430
|
CompletedHomeActions = 64,
|
|
428
431
|
AutomodQuarantinedUsername = 128,
|
|
429
|
-
DMSettingsUpsellAckownledge = 512
|
|
432
|
+
DMSettingsUpsellAckownledge = 512,
|
|
433
|
+
AutomodQuarantinedGuildTag = 1024
|
|
430
434
|
}
|
|
431
435
|
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors */
|
|
432
436
|
export declare enum IntegrationExpireBehaviors {
|
|
@@ -745,6 +749,7 @@ export declare enum StatusTypes {
|
|
|
745
749
|
export declare enum GatewayEvents {
|
|
746
750
|
Ready = "READY",
|
|
747
751
|
Resumed = "RESUMED",
|
|
752
|
+
RateLimited = "RATE_LIMITED",
|
|
748
753
|
ApplicationCommandPermissionsUpdate = "APPLICATION_COMMAND_PERMISSIONS_UPDATE",
|
|
749
754
|
AutoModerationRuleCreate = "AUTO_MODERATION_RULE_CREATE",
|
|
750
755
|
AutoModerationRuleUpdate = "AUTO_MODERATION_RULE_UPDATE",
|
|
@@ -1258,6 +1263,7 @@ export declare const BitwisePermissionFlags: {
|
|
|
1258
1263
|
readonly SendVoiceMessages: bigint;
|
|
1259
1264
|
readonly SendPolls: bigint;
|
|
1260
1265
|
readonly UseExternalApps: bigint;
|
|
1266
|
+
readonly PinMessages: bigint;
|
|
1261
1267
|
};
|
|
1262
1268
|
/** https://discord.com/developers/docs/topics/permissions#role-object-role-flags */
|
|
1263
1269
|
export declare enum RoleFlags {
|
package/dist/lib/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GuildScheduledEventRecurrenceRuleMonth = exports.GuildScheduledEventRecurrenceRuleWeekday = exports.GuildScheduledEventRecurrenceRuleFrequency = exports.GuildScheduledEventStatus = exports.GuildScheduledEventEntityTypes = exports.GuildScheduledEventPrivacyLevel = exports.ImageWidgetStyleOptions = exports.PromptTypes = exports.OnboardingMode = exports.IntegrationExpireBehaviors = exports.GuildMemberFlags = exports.MutableGuildFeatures = exports.GuildFeatures = exports.SystemChannelFlags = exports.PremiumTier = exports.GuildNSFWLevel = exports.VerificationLevel = exports.MFALevel = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ActivityLocationKind = exports.ApplicationFlags = exports.ApplicationEventWebhookStatus = exports.ApplicationIntegrationTypes = exports.
|
|
3
|
+
exports.GuildScheduledEventRecurrenceRuleMonth = exports.GuildScheduledEventRecurrenceRuleWeekday = exports.GuildScheduledEventRecurrenceRuleFrequency = exports.GuildScheduledEventStatus = exports.GuildScheduledEventEntityTypes = exports.GuildScheduledEventPrivacyLevel = exports.ImageWidgetStyleOptions = exports.PromptTypes = exports.OnboardingMode = exports.IntegrationExpireBehaviors = exports.GuildMemberFlags = exports.MutableGuildFeatures = exports.GuildFeatures = exports.SystemChannelFlags = exports.PremiumTier = exports.GuildNSFWLevel = exports.VerificationLevel = exports.MFALevel = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ActivityLocationKind = exports.ApplicationFlags = exports.ApplicationEventWebhookStatus = exports.ApplicationIntegrationTypes = exports.SeparatorSpacing = exports.TextInputStyles = exports.ButtonStyles = exports.ComponentTypes = exports.InteractionCallbackType = exports.InteractionContextTypes = exports.InteractionType = exports.ApplicationCommandPermissionType = exports.EntryPointCommandHandlerTypes = exports.ApplicationCommandOptionType = exports.ApplicationCommandTypes = exports.Locales = exports.ImageFormats = exports.GuildNavigationTypes = exports.TimestampStyles = void 0;
|
|
4
4
|
exports.EntitlementTypes = exports.SKUFlags = exports.SKUTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.AnimationTypes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.SubscriptionStatuses = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.ReactionTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.EmbedTypes = exports.MessageReferenceTypes = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.GuildInviteFlags = exports.InviteTargetTypes = exports.InviteTypes = void 0;
|
|
5
5
|
/** https://discord.com/developers/docs/reference#message-formatting-timestamp-styles */
|
|
6
6
|
var TimestampStyles;
|
|
@@ -120,7 +120,20 @@ var InteractionContextTypes;
|
|
|
120
120
|
InteractionContextTypes[InteractionContextTypes["BotDM"] = 1] = "BotDM";
|
|
121
121
|
InteractionContextTypes[InteractionContextTypes["PrivateChannel"] = 2] = "PrivateChannel";
|
|
122
122
|
})(InteractionContextTypes || (exports.InteractionContextTypes = InteractionContextTypes = {}));
|
|
123
|
-
/** https://discord.com/developers/docs/interactions/
|
|
123
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type */
|
|
124
|
+
var InteractionCallbackType;
|
|
125
|
+
(function (InteractionCallbackType) {
|
|
126
|
+
InteractionCallbackType[InteractionCallbackType["Pong"] = 1] = "Pong";
|
|
127
|
+
InteractionCallbackType[InteractionCallbackType["ChannelMessageWithSource"] = 4] = "ChannelMessageWithSource";
|
|
128
|
+
InteractionCallbackType[InteractionCallbackType["DeferredChannelMessageWithSource"] = 5] = "DeferredChannelMessageWithSource";
|
|
129
|
+
InteractionCallbackType[InteractionCallbackType["DeferredUpdateMessage"] = 6] = "DeferredUpdateMessage";
|
|
130
|
+
InteractionCallbackType[InteractionCallbackType["UpdateMessage"] = 7] = "UpdateMessage";
|
|
131
|
+
InteractionCallbackType[InteractionCallbackType["ApplicationCommandAutocompleteResult"] = 8] = "ApplicationCommandAutocompleteResult";
|
|
132
|
+
InteractionCallbackType[InteractionCallbackType["Modal"] = 9] = "Modal";
|
|
133
|
+
InteractionCallbackType[InteractionCallbackType["PremiumRequired"] = 10] = "PremiumRequired";
|
|
134
|
+
InteractionCallbackType[InteractionCallbackType["LaunchActivity"] = 12] = "LaunchActivity";
|
|
135
|
+
})(InteractionCallbackType || (exports.InteractionCallbackType = InteractionCallbackType = {}));
|
|
136
|
+
/** https://discord.com/developers/docs/components/reference#component-object-component-types */
|
|
124
137
|
var ComponentTypes;
|
|
125
138
|
(function (ComponentTypes) {
|
|
126
139
|
ComponentTypes[ComponentTypes["ActionRow"] = 1] = "ActionRow";
|
|
@@ -138,27 +151,9 @@ var ComponentTypes;
|
|
|
138
151
|
ComponentTypes[ComponentTypes["File"] = 13] = "File";
|
|
139
152
|
ComponentTypes[ComponentTypes["Separator"] = 14] = "Separator";
|
|
140
153
|
ComponentTypes[ComponentTypes["Container"] = 17] = "Container";
|
|
154
|
+
ComponentTypes[ComponentTypes["Label"] = 18] = "Label";
|
|
141
155
|
})(ComponentTypes || (exports.ComponentTypes = ComponentTypes = {}));
|
|
142
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
143
|
-
var SeparatorSpacing;
|
|
144
|
-
(function (SeparatorSpacing) {
|
|
145
|
-
SeparatorSpacing[SeparatorSpacing["Small"] = 1] = "Small";
|
|
146
|
-
SeparatorSpacing[SeparatorSpacing["Large"] = 2] = "Large";
|
|
147
|
-
})(SeparatorSpacing || (exports.SeparatorSpacing = SeparatorSpacing = {}));
|
|
148
|
-
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type */
|
|
149
|
-
var InteractionCallbackType;
|
|
150
|
-
(function (InteractionCallbackType) {
|
|
151
|
-
InteractionCallbackType[InteractionCallbackType["Pong"] = 1] = "Pong";
|
|
152
|
-
InteractionCallbackType[InteractionCallbackType["ChannelMessageWithSource"] = 4] = "ChannelMessageWithSource";
|
|
153
|
-
InteractionCallbackType[InteractionCallbackType["DeferredChannelMessageWithSource"] = 5] = "DeferredChannelMessageWithSource";
|
|
154
|
-
InteractionCallbackType[InteractionCallbackType["DeferredUpdateMessage"] = 6] = "DeferredUpdateMessage";
|
|
155
|
-
InteractionCallbackType[InteractionCallbackType["UpdateMessage"] = 7] = "UpdateMessage";
|
|
156
|
-
InteractionCallbackType[InteractionCallbackType["ApplicationCommandAutocompleteResult"] = 8] = "ApplicationCommandAutocompleteResult";
|
|
157
|
-
InteractionCallbackType[InteractionCallbackType["Modal"] = 9] = "Modal";
|
|
158
|
-
InteractionCallbackType[InteractionCallbackType["PremiumRequired"] = 10] = "PremiumRequired";
|
|
159
|
-
InteractionCallbackType[InteractionCallbackType["LaunchActivity"] = 12] = "LaunchActivity";
|
|
160
|
-
})(InteractionCallbackType || (exports.InteractionCallbackType = InteractionCallbackType = {}));
|
|
161
|
-
/** https://discord.com/developers/docs/interactions/message-components#button-object-button-styles */
|
|
156
|
+
/** https://discord.com/developers/docs/components/reference#button-button-styles */
|
|
162
157
|
var ButtonStyles;
|
|
163
158
|
(function (ButtonStyles) {
|
|
164
159
|
ButtonStyles[ButtonStyles["Primary"] = 1] = "Primary";
|
|
@@ -168,12 +163,18 @@ var ButtonStyles;
|
|
|
168
163
|
ButtonStyles[ButtonStyles["Link"] = 5] = "Link";
|
|
169
164
|
ButtonStyles[ButtonStyles["Premium"] = 6] = "Premium";
|
|
170
165
|
})(ButtonStyles || (exports.ButtonStyles = ButtonStyles = {}));
|
|
171
|
-
/** https://discord.com/developers/docs/
|
|
166
|
+
/** https://discord.com/developers/docs/components/reference#text-input-text-input-styles */
|
|
172
167
|
var TextInputStyles;
|
|
173
168
|
(function (TextInputStyles) {
|
|
174
169
|
TextInputStyles[TextInputStyles["Short"] = 1] = "Short";
|
|
175
170
|
TextInputStyles[TextInputStyles["Paragraph"] = 2] = "Paragraph";
|
|
176
171
|
})(TextInputStyles || (exports.TextInputStyles = TextInputStyles = {}));
|
|
172
|
+
/** https://discord.com/developers/docs/components/reference#separator-separator-structure */
|
|
173
|
+
var SeparatorSpacing;
|
|
174
|
+
(function (SeparatorSpacing) {
|
|
175
|
+
SeparatorSpacing[SeparatorSpacing["Small"] = 1] = "Small";
|
|
176
|
+
SeparatorSpacing[SeparatorSpacing["Large"] = 2] = "Large";
|
|
177
|
+
})(SeparatorSpacing || (exports.SeparatorSpacing = SeparatorSpacing = {}));
|
|
177
178
|
/** https://discord.com/developers/docs/resources/application#application-object-application-integration-types */
|
|
178
179
|
var ApplicationIntegrationTypes;
|
|
179
180
|
(function (ApplicationIntegrationTypes) {
|
|
@@ -279,6 +280,7 @@ var AuditLogEvents;
|
|
|
279
280
|
AuditLogEvents[AuditLogEvents["AutoModerationBlockMessage"] = 143] = "AutoModerationBlockMessage";
|
|
280
281
|
AuditLogEvents[AuditLogEvents["AutoModerationFlagToChannel"] = 144] = "AutoModerationFlagToChannel";
|
|
281
282
|
AuditLogEvents[AuditLogEvents["AutoModerationUserCommunicationDisabled"] = 145] = "AutoModerationUserCommunicationDisabled";
|
|
283
|
+
AuditLogEvents[AuditLogEvents["AutoModerationQuarantineUser"] = 146] = "AutoModerationQuarantineUser";
|
|
282
284
|
AuditLogEvents[AuditLogEvents["CreatorMonetizationRequestCreated"] = 150] = "CreatorMonetizationRequestCreated";
|
|
283
285
|
AuditLogEvents[AuditLogEvents["CreatorMonetizationTermsAccepted"] = 151] = "CreatorMonetizationTermsAccepted";
|
|
284
286
|
AuditLogEvents[AuditLogEvents["OnboardingPromptCreate"] = 163] = "OnboardingPromptCreate";
|
|
@@ -449,6 +451,7 @@ var GuildFeatures;
|
|
|
449
451
|
GuildFeatures["VipRegions"] = "VIP_REGIONS";
|
|
450
452
|
GuildFeatures["WelcomeScreenEnabled"] = "WELCOME_SCREEN_ENABLED";
|
|
451
453
|
GuildFeatures["GuestsEnabled"] = "GUESTS_ENABLED";
|
|
454
|
+
GuildFeatures["GuildTags"] = "GUILD_TAGS";
|
|
452
455
|
GuildFeatures["EnhancedRoleColors"] = "ENHANCED_ROLE_COLORS";
|
|
453
456
|
})(GuildFeatures || (exports.GuildFeatures = GuildFeatures = {}));
|
|
454
457
|
/** https://discord.com/developers/docs/resources/guild#guild-object-mutable-guild-features */
|
|
@@ -471,6 +474,7 @@ var GuildMemberFlags;
|
|
|
471
474
|
GuildMemberFlags[GuildMemberFlags["CompletedHomeActions"] = 64] = "CompletedHomeActions";
|
|
472
475
|
GuildMemberFlags[GuildMemberFlags["AutomodQuarantinedUsername"] = 128] = "AutomodQuarantinedUsername";
|
|
473
476
|
GuildMemberFlags[GuildMemberFlags["DMSettingsUpsellAckownledge"] = 512] = "DMSettingsUpsellAckownledge";
|
|
477
|
+
GuildMemberFlags[GuildMemberFlags["AutomodQuarantinedGuildTag"] = 1024] = "AutomodQuarantinedGuildTag";
|
|
474
478
|
})(GuildMemberFlags || (exports.GuildMemberFlags = GuildMemberFlags = {}));
|
|
475
479
|
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors */
|
|
476
480
|
var IntegrationExpireBehaviors;
|
|
@@ -824,6 +828,7 @@ var GatewayEvents;
|
|
|
824
828
|
(function (GatewayEvents) {
|
|
825
829
|
GatewayEvents["Ready"] = "READY";
|
|
826
830
|
GatewayEvents["Resumed"] = "RESUMED";
|
|
831
|
+
GatewayEvents["RateLimited"] = "RATE_LIMITED";
|
|
827
832
|
GatewayEvents["ApplicationCommandPermissionsUpdate"] = "APPLICATION_COMMAND_PERMISSIONS_UPDATE";
|
|
828
833
|
GatewayEvents["AutoModerationRuleCreate"] = "AUTO_MODERATION_RULE_CREATE";
|
|
829
834
|
GatewayEvents["AutoModerationRuleUpdate"] = "AUTO_MODERATION_RULE_UPDATE";
|
|
@@ -1349,6 +1354,7 @@ exports.BitwisePermissionFlags = {
|
|
|
1349
1354
|
SendVoiceMessages: 1n << 46n,
|
|
1350
1355
|
SendPolls: 1n << 49n,
|
|
1351
1356
|
UseExternalApps: 1n << 50n,
|
|
1357
|
+
PinMessages: 1n << 51n,
|
|
1352
1358
|
};
|
|
1353
1359
|
/** https://discord.com/developers/docs/topics/permissions#role-object-role-flags */
|
|
1354
1360
|
var RoleFlags;
|
|
@@ -102,6 +102,20 @@ class Shard {
|
|
|
102
102
|
case constants_1.GatewayEvents.Resumed:
|
|
103
103
|
this.client.emit("resumed");
|
|
104
104
|
break;
|
|
105
|
+
case constants_1.GatewayEvents.RateLimited:
|
|
106
|
+
switch (packet.d.opcode) {
|
|
107
|
+
case constants_1.GatewayOPCodes.RequestGuildMembers: {
|
|
108
|
+
this.client.emit("rateLimited", {
|
|
109
|
+
opcode: constants_1.GatewayOPCodes.RequestGuildMembers,
|
|
110
|
+
retryAfter: packet.d.retry_after,
|
|
111
|
+
meta: {
|
|
112
|
+
guildID: packet.d.meta.guild_id,
|
|
113
|
+
nonce: packet.d.nonce,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
105
119
|
case constants_1.GatewayEvents.ApplicationCommandPermissionsUpdate:
|
|
106
120
|
this.client.emit("applicationCommandPermissionsUpdate", transformers_1.Guilds.guildApplicationCommandPermissionsFromRaw(packet.d));
|
|
107
121
|
break;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { type JSONErrorCodes } from "../constants";
|
|
4
2
|
export declare enum RESTMethods {
|
|
5
3
|
Get = "GET",
|
|
@@ -23,7 +21,7 @@ export interface ErrorResponse {
|
|
|
23
21
|
errors: Record<string, unknown>;
|
|
24
22
|
}
|
|
25
23
|
export interface FileData {
|
|
26
|
-
contents:
|
|
24
|
+
contents: BlobPart;
|
|
27
25
|
name: string;
|
|
28
26
|
}
|
|
29
27
|
export declare class RequestManager {
|