disgroove 2.2.2 → 2.2.3-dev.4f98e3d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/lib/Client.d.ts +69 -77
- package/dist/lib/Client.js +204 -95
- package/dist/lib/gateway/Shard.d.ts +1 -0
- package/dist/lib/gateway/Shard.js +10 -4
- package/dist/lib/transformers/ApplicationCommands.d.ts +7 -0
- package/dist/lib/transformers/ApplicationCommands.js +90 -0
- package/dist/lib/transformers/ApplicationRoleConnectionMetadatas.d.ts +5 -0
- package/dist/lib/transformers/ApplicationRoleConnectionMetadatas.js +26 -0
- package/dist/lib/transformers/Applications.d.ts +0 -3
- package/dist/lib/transformers/Applications.js +0 -114
- package/dist/lib/transformers/AuditLogs.js +3 -3
- package/dist/lib/transformers/AutoModeration.d.ts +5 -1
- package/dist/lib/transformers/AutoModeration.js +44 -32
- package/dist/lib/transformers/Guilds.js +16 -0
- package/dist/lib/transformers/Presences.d.ts +0 -3
- package/dist/lib/transformers/Presences.js +52 -44
- package/dist/lib/transformers/Users.js +16 -2
- package/dist/lib/transformers/index.d.ts +2 -0
- package/dist/lib/transformers/index.js +2 -0
- package/dist/lib/types/guild.d.ts +3 -1
- package/dist/lib/types/user.d.ts +2 -2
- package/dist/lib/utils/errors.js +4 -4
- package/dist/lib/utils/formatters.d.ts +7 -0
- package/dist/lib/utils/formatters.js +7 -1
- package/dist/lib/utils/index.d.ts +0 -1
- package/dist/lib/utils/index.js +0 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/lib/utils/Util.d.ts +0 -4
- package/dist/lib/utils/Util.js +0 -63
package/README.md
CHANGED
@@ -9,13 +9,13 @@ A module to interface with Discord
|
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
12
|
-
[**
|
12
|
+
[**Node.js v18**](https://nodejs.org) or newer required
|
13
13
|
|
14
14
|
```
|
15
15
|
npm install disgroove
|
16
16
|
```
|
17
17
|
|
18
|
-
|
18
|
+
## Example
|
19
19
|
|
20
20
|
```js
|
21
21
|
const {
|
package/dist/lib/Client.d.ts
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, type MFALevel, 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";
|
3
|
-
import { Util } from "./utils";
|
4
3
|
import { RequestManager, type File } from "./rest";
|
5
4
|
import EventEmitter from "node:events";
|
6
5
|
import { ShardManager } from "./gateway";
|
7
6
|
import type { Application, ApplicationIntegrationTypeConfiguration, InstallParams } from "./types/application";
|
8
|
-
import type { ApplicationCommand, GuildApplicationCommandPermissions, ApplicationCommandOption } from "./types/application-command";
|
7
|
+
import type { ApplicationCommand, GuildApplicationCommandPermissions, ApplicationCommandOption, ApplicationCommandPermission } from "./types/application-command";
|
9
8
|
import type { ApplicationRoleConnectionMetadata } from "./types/application-role-connection-metadata";
|
10
9
|
import type { AuditLog, AuditLogEntry } from "./types/audit-log";
|
11
10
|
import type { AutoModerationRule, TriggerMetadata, AutoModerationAction } from "./types/auto-moderation";
|
@@ -13,7 +12,7 @@ import type { Channel, Message, FollowedChannel, ThreadMember, Overwrite, Defaul
|
|
13
12
|
import type { LocaleMap, snowflake, timestamp } from "./types/common";
|
14
13
|
import type { Emoji } from "./types/emoji";
|
15
14
|
import type { Entitlement } from "./types/entitlements";
|
16
|
-
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 } from "./types/gateway-events";
|
15
|
+
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 } from "./types/gateway-events";
|
17
16
|
import type { Guild, GuildMember, WelcomeScreen, GuildWidgetSettings, Ban, Integration, GuildOnboarding, GuildPreview, GuildWidget, UnavailableGuild, OnboardingPrompt, WelcomeScreenChannel } from "./types/guild";
|
18
17
|
import type { GuildScheduledEvent, GuildScheduledEventUser, GuildScheduledEventEntityMetadata } from "./types/guild-scheduled-event";
|
19
18
|
import type { GuildTemplate } from "./types/guild-template";
|
@@ -29,19 +28,22 @@ import type { User, ApplicationRoleConnection, Connection } from "./types/user";
|
|
29
28
|
import type { VoiceRegion, VoiceState } from "./types/voice";
|
30
29
|
import type { Webhook } from "./types/webhook";
|
31
30
|
import type { ClientOptions as WebSocketOptions } from "ws";
|
31
|
+
export interface GatewayOptions {
|
32
|
+
properties?: IdentifyConnectionProperties;
|
33
|
+
compress?: boolean;
|
34
|
+
largeThreshold?: number;
|
35
|
+
presence?: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>;
|
36
|
+
intents?: number | Array<number>;
|
37
|
+
}
|
32
38
|
export interface ClientOptions {
|
33
39
|
shardsCount?: number | "auto";
|
34
40
|
auth?: "Bot" | "Bearer";
|
35
|
-
gateway?:
|
36
|
-
intents?: number | Array<number>;
|
37
|
-
compress?: boolean;
|
38
|
-
largeThreshold?: number;
|
39
|
-
presence?: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>;
|
40
|
-
};
|
41
|
+
gateway?: GatewayOptions;
|
41
42
|
ws?: WebSocketOptions;
|
42
43
|
}
|
43
44
|
export declare class Client extends EventEmitter {
|
44
45
|
token: string;
|
46
|
+
properties?: IdentifyConnectionProperties;
|
45
47
|
compress?: boolean;
|
46
48
|
largeThreshold?: number;
|
47
49
|
presence?: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>;
|
@@ -50,7 +52,6 @@ export declare class Client extends EventEmitter {
|
|
50
52
|
auth: "Bot" | "Bearer";
|
51
53
|
shards: ShardManager;
|
52
54
|
rest: RequestManager;
|
53
|
-
util: Util;
|
54
55
|
guildShardMap: Record<string, number>;
|
55
56
|
user: User | null;
|
56
57
|
guilds: Map<string, Guild>;
|
@@ -103,7 +104,6 @@ export declare class Client extends EventEmitter {
|
|
103
104
|
descriptionLocalizations?: LocaleMap | null;
|
104
105
|
options?: Array<ApplicationCommandOption>;
|
105
106
|
defaultMemberPermissions?: string | null;
|
106
|
-
defaultPermission?: boolean | null;
|
107
107
|
integrationTypes: Array<ApplicationIntegrationTypes>;
|
108
108
|
contexts: Array<InteractionContextTypes>;
|
109
109
|
type?: ApplicationCommandTypes;
|
@@ -118,7 +118,6 @@ export declare class Client extends EventEmitter {
|
|
118
118
|
descriptionLocalizations?: LocaleMap | null;
|
119
119
|
options?: Array<ApplicationCommandOption>;
|
120
120
|
defaultMemberPermissions?: string | null;
|
121
|
-
defaultPermission?: boolean | null;
|
122
121
|
type?: ApplicationCommandTypes;
|
123
122
|
nsfw?: boolean;
|
124
123
|
}>): Promise<Array<ApplicationCommand>>;
|
@@ -134,8 +133,8 @@ export declare class Client extends EventEmitter {
|
|
134
133
|
triggerMetadata?: TriggerMetadata;
|
135
134
|
actions: Array<AutoModerationAction>;
|
136
135
|
enabled?: boolean;
|
137
|
-
exemptRoles?: Array<
|
138
|
-
exemptChannels?: Array<
|
136
|
+
exemptRoles?: Array<snowflake>;
|
137
|
+
exemptChannels?: Array<snowflake>;
|
139
138
|
}, reason?: string): Promise<AutoModerationRule>;
|
140
139
|
/** https://discord.com/developers/docs/resources/guild#create-guild-channel */
|
141
140
|
createChannel(guildID: snowflake, options: {
|
@@ -146,7 +145,7 @@ export declare class Client extends EventEmitter {
|
|
146
145
|
userLimit?: number | null;
|
147
146
|
rateLimitPerUser?: number | null;
|
148
147
|
position?: number | null;
|
149
|
-
permissionOverwrites?: Array<Overwrite
|
148
|
+
permissionOverwrites?: Array<Pick<Overwrite, "id" | "type"> & Partial<Overwrite>> | null;
|
150
149
|
parentID?: snowflake | null;
|
151
150
|
nsfw?: boolean | null;
|
152
151
|
rtcRegion?: string | null;
|
@@ -185,14 +184,13 @@ export declare class Client extends EventEmitter {
|
|
185
184
|
descriptionLocalizations?: LocaleMap | null;
|
186
185
|
options?: Array<ApplicationCommandOption>;
|
187
186
|
defaultMemberPermissions?: string | null;
|
188
|
-
defaultPermission?: boolean | null;
|
189
187
|
integrationTypes?: Array<ApplicationIntegrationTypes>;
|
190
188
|
contexts?: Array<InteractionContextTypes>;
|
191
189
|
type?: ApplicationCommandTypes;
|
192
190
|
nsfw?: boolean;
|
193
191
|
}): Promise<ApplicationCommand>;
|
194
192
|
/** https://discord.com/developers/docs/resources/user#create-group-dm */
|
195
|
-
|
193
|
+
createGroup(options: {
|
196
194
|
accessTokens: Array<string>;
|
197
195
|
nicks: Array<string>;
|
198
196
|
}): Promise<Channel>;
|
@@ -231,7 +229,6 @@ export declare class Client extends EventEmitter {
|
|
231
229
|
descriptionLocalizations?: LocaleMap | null;
|
232
230
|
options?: Array<ApplicationCommandOption>;
|
233
231
|
defaultMemberPermissions?: string | null;
|
234
|
-
defaultPermission?: boolean | null;
|
235
232
|
type?: ApplicationCommandTypes;
|
236
233
|
nsfw?: boolean;
|
237
234
|
}): Promise<ApplicationCommand>;
|
@@ -339,15 +336,16 @@ export declare class Client extends EventEmitter {
|
|
339
336
|
autoArchiveDuration?: number;
|
340
337
|
rateLimitPerUser?: number | null;
|
341
338
|
message: {
|
342
|
-
content?: string
|
343
|
-
embeds?: Array<Embed
|
344
|
-
allowedMentions?: AllowedMentions
|
345
|
-
components?: Array<ActionRow
|
346
|
-
|
347
|
-
|
339
|
+
content?: string;
|
340
|
+
embeds?: Array<Embed>;
|
341
|
+
allowedMentions?: AllowedMentions;
|
342
|
+
components?: Array<ActionRow>;
|
343
|
+
stickerIDs?: Array<snowflake>;
|
344
|
+
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
345
|
+
flags?: MessageFlags;
|
346
|
+
files?: Array<File>;
|
348
347
|
};
|
349
|
-
appliedTags?: Array<
|
350
|
-
files?: Array<File> | null;
|
348
|
+
appliedTags?: Array<snowflake>;
|
351
349
|
}, reason?: string): Promise<Channel>;
|
352
350
|
/** https://discord.com/developers/docs/resources/channel#start-thread-from-message */
|
353
351
|
createThreadFromMessage(channelID: snowflake, messageID: snowflake, options: {
|
@@ -422,12 +420,12 @@ export declare class Client extends EventEmitter {
|
|
422
420
|
triggerMetadata?: TriggerMetadata;
|
423
421
|
actions?: Array<AutoModerationAction>;
|
424
422
|
enabled?: boolean;
|
425
|
-
exemptRoles?: Array<
|
426
|
-
exemptChannels?: Array<
|
423
|
+
exemptRoles?: Array<snowflake>;
|
424
|
+
exemptChannels?: Array<snowflake>;
|
427
425
|
}, reason?: string): Promise<AutoModerationRule>;
|
428
426
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
|
429
427
|
editApplicationCommandPermissions(applicationID: snowflake, guildID: snowflake, commandID: snowflake, options: {
|
430
|
-
permissions: Array<
|
428
|
+
permissions: Array<ApplicationCommandPermission>;
|
431
429
|
}): Promise<GuildApplicationCommandPermissions>;
|
432
430
|
/** https://discord.com/developers/docs/resources/channel#modify-channel */
|
433
431
|
editChannel(channelID: snowflake, options: {
|
@@ -440,7 +438,7 @@ export declare class Client extends EventEmitter {
|
|
440
438
|
rateLimitPerUser?: number | null;
|
441
439
|
bitrate?: number | null;
|
442
440
|
userLimit?: number | null;
|
443
|
-
permissionOverwrites?: Array<Overwrite> | null;
|
441
|
+
permissionOverwrites?: Array<Pick<Overwrite, "id" | "type"> & Partial<Overwrite>> | null;
|
444
442
|
parentID?: snowflake | null;
|
445
443
|
rtcRegion?: string | null;
|
446
444
|
videoQualityMode?: VideoQualityModes | null;
|
@@ -455,7 +453,7 @@ export declare class Client extends EventEmitter {
|
|
455
453
|
autoArchiveDuration?: number;
|
456
454
|
locked?: boolean;
|
457
455
|
invitable?: boolean;
|
458
|
-
appliedTags?: Array<
|
456
|
+
appliedTags?: Array<snowflake>;
|
459
457
|
}, reason?: string): Promise<Channel>;
|
460
458
|
/** https://discord.com/developers/docs/resources/channel#edit-channel-permissions */
|
461
459
|
editChannelPermissions(channelID: snowflake, overwriteID: snowflake, options: {
|
@@ -478,7 +476,7 @@ export declare class Client extends EventEmitter {
|
|
478
476
|
}): Promise<User>;
|
479
477
|
/** https://discord.com/developers/docs/resources/guild#modify-current-member */
|
480
478
|
editCurrentGuildMember(guildID: snowflake, options: {
|
481
|
-
nick?: string;
|
479
|
+
nick?: string | null;
|
482
480
|
}, reason?: string): Promise<GuildMember>;
|
483
481
|
/** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state */
|
484
482
|
editCurrentUserVoiceState(guildID: snowflake, options: {
|
@@ -507,7 +505,6 @@ export declare class Client extends EventEmitter {
|
|
507
505
|
descriptionLocalizations?: LocaleMap | null;
|
508
506
|
options?: Array<ApplicationCommandOption>;
|
509
507
|
defaultMemberPermissions?: string | null;
|
510
|
-
defaultPermission?: boolean | null;
|
511
508
|
integrationTypes?: Array<ApplicationIntegrationTypes>;
|
512
509
|
contexts?: Array<InteractionContextTypes>;
|
513
510
|
nsfw?: boolean;
|
@@ -515,10 +512,9 @@ export declare class Client extends EventEmitter {
|
|
515
512
|
/** https://discord.com/developers/docs/resources/guild#modify-guild */
|
516
513
|
editGuild(guildID: snowflake, options: {
|
517
514
|
name?: string;
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
explicitContentFilter?: ExplicitContentFilterLevel;
|
515
|
+
verificationLevel?: VerificationLevel | null;
|
516
|
+
defaultMessageNotifications?: DefaultMessageNotificationLevel | null;
|
517
|
+
explicitContentFilter?: ExplicitContentFilterLevel | null;
|
522
518
|
afkChannelID?: snowflake | null;
|
523
519
|
afkTimeout?: number;
|
524
520
|
icon?: string | null;
|
@@ -530,7 +526,7 @@ export declare class Client extends EventEmitter {
|
|
530
526
|
systemChannelFlags?: SystemChannelFlags;
|
531
527
|
rulesChannelID?: snowflake | null;
|
532
528
|
publicUpdatesChannelID?: snowflake | null;
|
533
|
-
preferredLocale?: string;
|
529
|
+
preferredLocale?: string | null;
|
534
530
|
features?: Array<GuildFeatures>;
|
535
531
|
description?: string | null;
|
536
532
|
premiumProgressBarEnabled?: boolean;
|
@@ -544,7 +540,6 @@ export declare class Client extends EventEmitter {
|
|
544
540
|
descriptionLocalizations?: LocaleMap | null;
|
545
541
|
options?: Array<ApplicationCommandOption>;
|
546
542
|
defaultMemberPermissions?: string | null;
|
547
|
-
defaultPermission?: boolean | null;
|
548
543
|
nsfw?: boolean;
|
549
544
|
}): Promise<ApplicationCommand>;
|
550
545
|
/** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
|
@@ -559,8 +554,8 @@ export declare class Client extends EventEmitter {
|
|
559
554
|
mute?: boolean | null;
|
560
555
|
deaf?: boolean | null;
|
561
556
|
channelID?: snowflake | null;
|
562
|
-
communicationDisabledUntil?:
|
563
|
-
flags?: GuildMemberFlags;
|
557
|
+
communicationDisabledUntil?: timestamp | null;
|
558
|
+
flags?: GuildMemberFlags | null;
|
564
559
|
}, reason?: string): Promise<GuildMember>;
|
565
560
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level */
|
566
561
|
editGuildMFALevel(guildID: snowflake, options: {
|
@@ -587,15 +582,15 @@ export declare class Client extends EventEmitter {
|
|
587
582
|
editGuildRolePositions(guildID: snowflake, options: Array<{
|
588
583
|
id: snowflake;
|
589
584
|
position?: number | null;
|
590
|
-
}
|
585
|
+
}>, reason?: string): Promise<Array<Role>>;
|
591
586
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event */
|
592
587
|
editGuildScheduledEvent(guildID: snowflake, guildScheduledEventID: snowflake, options: {
|
593
588
|
channelID?: snowflake | null;
|
594
589
|
entityMetadata?: GuildScheduledEventEntityMetadata | null;
|
595
590
|
name?: string;
|
596
591
|
privacyLevel?: GuildScheduledEventPrivacyLevel;
|
597
|
-
scheduledStartTime?:
|
598
|
-
scheduledEndTime?:
|
592
|
+
scheduledStartTime?: timestamp;
|
593
|
+
scheduledEndTime?: timestamp;
|
599
594
|
description?: string | null;
|
600
595
|
entityType?: GuildScheduledEventEntityTypes;
|
601
596
|
status?: GuildScheduledEventStatus;
|
@@ -642,29 +637,26 @@ export declare class Client extends EventEmitter {
|
|
642
637
|
editInteractionFollowupMessage(applicationID: snowflake, interactionToken: string, messageID: snowflake, options: {
|
643
638
|
content?: string | null;
|
644
639
|
embeds?: Array<Embed> | null;
|
645
|
-
flags?: MessageFlags | null;
|
646
640
|
allowedMentions?: AllowedMentions | null;
|
647
641
|
components?: Array<ActionRow> | null;
|
648
642
|
files?: Array<File> | null;
|
649
|
-
attachments?: Array<Attachment
|
650
|
-
threadID
|
643
|
+
attachments?: Array<Partial<Attachment>> | null;
|
644
|
+
threadID?: snowflake;
|
651
645
|
}): Promise<Message>;
|
652
646
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response */
|
653
647
|
editInteractionResponse(applicationID: snowflake, interactionToken: string, options: {
|
654
648
|
content?: string | null;
|
655
649
|
embeds?: Array<Embed> | null;
|
656
|
-
flags?: MessageFlags | null;
|
657
650
|
allowedMentions?: AllowedMentions | null;
|
658
651
|
components?: Array<ActionRow> | null;
|
659
652
|
files?: Array<File> | null;
|
660
|
-
attachments?: Array<Attachment
|
661
|
-
threadID
|
653
|
+
attachments?: Array<Partial<Attachment>> | null;
|
654
|
+
threadID?: snowflake;
|
662
655
|
}): Promise<Message>;
|
663
656
|
/** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
|
664
657
|
editUserVoiceState(guildID: snowflake, userID: snowflake, options: {
|
665
|
-
channelID
|
658
|
+
channelID: snowflake;
|
666
659
|
suppress?: boolean;
|
667
|
-
requestToSpeakTimestamp?: timestamp | null;
|
668
660
|
}): void;
|
669
661
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook */
|
670
662
|
editWebhook(webhookID: snowflake, options: {
|
@@ -676,12 +668,11 @@ export declare class Client extends EventEmitter {
|
|
676
668
|
editWebhookMessage(webhookID: snowflake, webhookToken: string, messageID: snowflake, options: {
|
677
669
|
content?: string | null;
|
678
670
|
embeds?: Array<Embed> | null;
|
679
|
-
flags?: MessageFlags | null;
|
680
671
|
allowedMentions?: AllowedMentions | null;
|
681
672
|
components?: Array<ActionRow> | null;
|
682
673
|
files?: Array<File> | null;
|
683
|
-
attachments?: Array<Attachment
|
684
|
-
threadID
|
674
|
+
attachments?: Array<Partial<Attachment>> | null;
|
675
|
+
threadID?: snowflake;
|
685
676
|
}): Promise<Message>;
|
686
677
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
|
687
678
|
editWebhookWithToken(webhookID: snowflake, webhookToken: string, options: {
|
@@ -728,7 +719,7 @@ export declare class Client extends EventEmitter {
|
|
728
719
|
}>;
|
729
720
|
/** https://discord.com/developers/docs/resources/channel#list-public-archived-threads */
|
730
721
|
getArchivedThreads(channelID: snowflake, archivedStatus: "public" | "private", options?: {
|
731
|
-
before?:
|
722
|
+
before?: timestamp;
|
732
723
|
limit?: number;
|
733
724
|
}): Promise<{
|
734
725
|
threads: Array<Channel>;
|
@@ -739,8 +730,8 @@ export declare class Client extends EventEmitter {
|
|
739
730
|
getAuditLog(guildID: snowflake, options?: {
|
740
731
|
userID?: snowflake;
|
741
732
|
actionType?: ActionTypes;
|
742
|
-
before?:
|
743
|
-
after?:
|
733
|
+
before?: snowflake;
|
734
|
+
after?: snowflake;
|
744
735
|
limit?: number;
|
745
736
|
}): Promise<AuditLog>;
|
746
737
|
/** https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule */
|
@@ -770,9 +761,9 @@ export declare class Client extends EventEmitter {
|
|
770
761
|
/** https://discord.com/developers/docs/monetization/entitlements#list-entitlements */
|
771
762
|
getEntitlements(applicationID: snowflake, options?: {
|
772
763
|
userID?: snowflake;
|
773
|
-
skuIDs?: Array<
|
774
|
-
before?:
|
775
|
-
after?:
|
764
|
+
skuIDs?: Array<snowflake>;
|
765
|
+
before?: snowflake;
|
766
|
+
after?: snowflake;
|
776
767
|
limit?: number;
|
777
768
|
guildID?: snowflake;
|
778
769
|
excludeEnded?: boolean;
|
@@ -804,11 +795,11 @@ export declare class Client extends EventEmitter {
|
|
804
795
|
}): Promise<Guild>;
|
805
796
|
/** https://discord.com/developers/docs/resources/user#get-current-user-guilds */
|
806
797
|
getGuilds(options?: {
|
807
|
-
before?:
|
808
|
-
after?:
|
798
|
+
before?: snowflake;
|
799
|
+
after?: snowflake;
|
809
800
|
limit?: number;
|
810
801
|
withCounts?: boolean;
|
811
|
-
}): Promise<Array<Guild
|
802
|
+
}): Promise<Array<Pick<Guild, "id" | "name" | "icon" | "owner" | "permissions" | "features" | "approximateMemberCount" | "approximatePresenceCount">>>;
|
812
803
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
|
813
804
|
getGuildApplicationCommand(applicationID: snowflake, guildID: snowflake, commandID: snowflake): Promise<ApplicationCommand>;
|
814
805
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
|
@@ -822,8 +813,8 @@ export declare class Client extends EventEmitter {
|
|
822
813
|
/** https://discord.com/developers/docs/resources/guild#get-guild-bans */
|
823
814
|
getGuildBans(guildID: snowflake, options?: {
|
824
815
|
limit?: number;
|
825
|
-
before?:
|
826
|
-
after?:
|
816
|
+
before?: snowflake;
|
817
|
+
after?: snowflake;
|
827
818
|
}): Promise<Array<Ban>>;
|
828
819
|
/** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */
|
829
820
|
getGuildEmoji(guildID: snowflake, emojiID: snowflake): Promise<Emoji>;
|
@@ -844,7 +835,7 @@ export declare class Client extends EventEmitter {
|
|
844
835
|
/** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
|
845
836
|
getGuildPruneCount(guildID: snowflake, options: {
|
846
837
|
days: number;
|
847
|
-
includeRoles: string | Array<
|
838
|
+
includeRoles: string | Array<snowflake>;
|
848
839
|
}): Promise<{
|
849
840
|
pruned: number;
|
850
841
|
}>;
|
@@ -858,8 +849,8 @@ export declare class Client extends EventEmitter {
|
|
858
849
|
getGuildScheduledEventUsers(guildID: snowflake, guildScheduledEventID: snowflake, options?: {
|
859
850
|
limit?: number;
|
860
851
|
withMember?: boolean;
|
861
|
-
before?:
|
862
|
-
after?:
|
852
|
+
before?: snowflake;
|
853
|
+
after?: snowflake;
|
863
854
|
}): Promise<Array<GuildScheduledEventUser>>;
|
864
855
|
/** https://discord.com/developers/docs/resources/sticker#get-guild-sticker */
|
865
856
|
getGuildSticker(guildID: snowflake, stickerID: snowflake): Promise<Sticker>;
|
@@ -902,7 +893,7 @@ export declare class Client extends EventEmitter {
|
|
902
893
|
}): Promise<Invite>;
|
903
894
|
/** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads */
|
904
895
|
getJoinedPrivateArchivedThreads(channelID: snowflake, options?: {
|
905
|
-
before?:
|
896
|
+
before?: snowflake;
|
906
897
|
limit?: number;
|
907
898
|
}): Promise<{
|
908
899
|
threads: Array<Channel>;
|
@@ -914,14 +905,14 @@ export declare class Client extends EventEmitter {
|
|
914
905
|
/** https://discord.com/developers/docs/resources/channel#get-reactions */
|
915
906
|
getMessageReactions(channelID: snowflake, messageID: snowflake, emoji: string, options?: {
|
916
907
|
type?: ReactionTypes;
|
917
|
-
after?:
|
908
|
+
after?: snowflake;
|
918
909
|
limit?: number;
|
919
910
|
}): Promise<Array<User>>;
|
920
911
|
/** https://discord.com/developers/docs/resources/channel#get-channel-messages */
|
921
912
|
getMessages(channelID: snowflake, options: {
|
922
|
-
around?:
|
923
|
-
before?:
|
924
|
-
after?:
|
913
|
+
around?: snowflake;
|
914
|
+
before?: snowflake;
|
915
|
+
after?: snowflake;
|
925
916
|
limit?: number;
|
926
917
|
}): Promise<Array<Message>>;
|
927
918
|
/** https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information */
|
@@ -937,7 +928,7 @@ export declare class Client extends EventEmitter {
|
|
937
928
|
getPinnedMessages(channelID: snowflake): Promise<Array<Message>>;
|
938
929
|
/** https://discord.com/developers/docs/resources/poll#get-answer-voters */
|
939
930
|
getPollAnswerVoters(channelID: snowflake, messageID: snowflake, answerID: snowflake, options?: {
|
940
|
-
after?:
|
931
|
+
after?: snowflake;
|
941
932
|
limit?: number;
|
942
933
|
}): Promise<{
|
943
934
|
users: Array<User>;
|
@@ -957,7 +948,7 @@ export declare class Client extends EventEmitter {
|
|
957
948
|
/** https://discord.com/developers/docs/resources/channel#list-thread-members */
|
958
949
|
getThreadMembers(channelID: snowflake, options?: {
|
959
950
|
withMember?: boolean;
|
960
|
-
after?:
|
951
|
+
after?: snowflake;
|
961
952
|
limit?: number;
|
962
953
|
}): Promise<Array<ThreadMember>>;
|
963
954
|
/** https://discord.com/developers/docs/resources/user#get-user */
|
@@ -1033,7 +1024,8 @@ export declare interface Client extends EventEmitter {
|
|
1033
1024
|
}
|
1034
1025
|
export interface ClientEvents {
|
1035
1026
|
dispatch: [packet: RawPayload];
|
1036
|
-
|
1027
|
+
heartbeatACK: [];
|
1028
|
+
hello: [interval: number];
|
1037
1029
|
ready: [];
|
1038
1030
|
resumed: [];
|
1039
1031
|
reconnect: [];
|