-
Notifications
You must be signed in to change notification settings - Fork 417
/
index.d.ts
3615 lines (3503 loc) · 149 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { EventEmitter } from "events";
import { Duplex, Readable as ReadableStream, Stream } from "stream";
import { Agent as HTTPSAgent } from "https";
import { IncomingMessage, ClientRequest, IncomingHttpHeaders } from "http";
import OpusScript = require("opusscript"); // Thanks TypeScript
import { URL } from "url";
import { Socket as DgramSocket } from "dgram";
import * as WebSocket from "ws";
import type Constants from "./lib/Constants.d.ts";
declare function Eris(token: string, options?: Eris.ClientOptions): Eris.Client;
declare namespace Eris {
export const Constants: Constants;
export const VERSION: string;
/** @deprecated */
export const PrivateChannel: typeof DMChannel;
// TYPES
// Application Commands
type ApplicationCommandOptions = ApplicationCommandOptionsSubCommand | ApplicationCommandOptionsSubCommandGroup | ApplicationCommandOptionsWithValue;
type ApplicationCommandOptionsBoolean = ApplicationCommandOption<Constants["ApplicationCommandOptionTypes"]["BOOLEAN"]>;
type ApplicationCommandOptionsChannel = ApplicationCommandOption<Constants["ApplicationCommandOptionTypes"]["CHANNEL"]>;
type ApplicationCommandOptionsInteger = ApplicationCommandOptionsIntegerWithAutocomplete | ApplicationCommandOptionsIntegerWithoutAutocomplete | ApplicationCommandOptionsIntegerWithMinMax;
type ApplicationCommandOptionsIntegerWithAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["INTEGER"]>, "choices" | "min_value" | "max_value"> & AutocompleteEnabled;
type ApplicationCommandOptionsIntegerWithoutAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["INTEGER"]>, "autocomplete" | "min_value" | "max_value"> & AutocompleteDisabledInteger;
type ApplicationCommandOptionsIntegerWithMinMax = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["INTEGER"]>, "choices" | "autocomplete"> & AutocompleteDisabledIntegerMinMax;
type ApplicationCommandOptionsMentionable = ApplicationCommandOption<Constants["ApplicationCommandOptionTypes"]["MENTIONABLE"]>;
type ApplicationCommandOptionsNumber = ApplicationCommandOptionsNumberWithAutocomplete | ApplicationCommandOptionsNumberWithoutAutocomplete | ApplicationCommandOptionsNumberWithMinMax;
type ApplicationCommandOptionsNumberWithAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["NUMBER"]>, "choices" | "min_value" | "max_value"> & AutocompleteEnabled;
type ApplicationCommandOptionsNumberWithoutAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["NUMBER"]>, "autocomplete" | "min_value" | "max_value"> & AutocompleteDisabledInteger;
type ApplicationCommandOptionsNumberWithMinMax = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["NUMBER"]>, "choices" | "autocomplete"> & AutocompleteDisabledIntegerMinMax;
type ApplicationCommandOptionsRole = ApplicationCommandOption<Constants["ApplicationCommandOptionTypes"]["ROLE"]>;
type ApplicationCommandOptionsString = ApplicationCommandOptionsStringWithAutocomplete | ApplicationCommandOptionsStringWithoutAutocomplete;
type ApplicationCommandOptionsStringWithAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["STRING"]>, "choices"> & AutocompleteEnabled;
type ApplicationCommandOptionsStringWithoutAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["STRING"]>, "autocomplete"> & AutocompleteDisabled;
type ApplicationCommandOptionsUser = ApplicationCommandOption<Constants["ApplicationCommandOptionTypes"]["USER"]>;
type ApplicationCommandOptionsWithValue = ApplicationCommandOptionsString | ApplicationCommandOptionsInteger | ApplicationCommandOptionsBoolean | ApplicationCommandOptionsUser | ApplicationCommandOptionsChannel | ApplicationCommandOptionsRole | ApplicationCommandOptionsMentionable | ApplicationCommandOptionsNumber;
type ApplicationCommandPermissionTypes = Constants["ApplicationCommandPermissionTypes"][keyof Constants["ApplicationCommandPermissionTypes"]];
type ApplicationCommandTypes = Constants["ApplicationCommandTypes"][keyof Constants["ApplicationCommandTypes"]];
type ModalSubmitInteractionDataComponent = ModalSubmitInteractionDataTextInputComponent;
// Auto Moderation
type AutoModerationActionType = Constants["AutoModerationActionTypes"][keyof Constants["AutoModerationActionTypes"]];
type AutoModerationEventType = Constants["AutoModerationEventTypes"][keyof Constants["AutoModerationEventTypes"]];
type AutoModerationKeywordPresetType = Constants["AutoModerationKeywordPresetTypes"][keyof Constants["AutoModerationKeywordPresetTypes"]];
type AutoModerationTriggerType = Constants["AutoModerationTriggerTypes"][keyof Constants["AutoModerationTriggerTypes"]];
type EditAutoModerationRuleOptions = Partial<CreateAutoModerationRuleOptions>;
// Cache
interface Uncached { id: string }
// Channel
type AnyChannel = AnyGuildChannel | AnyThreadChannel | DMChannel | GroupChannel;
type AnyGuildChannel = AnyGuildTextableChannel | AnyThreadChannel | CategoryChannel | ForumChannel | MediaChannel;
type AnyGuildTextableChannel = TextChannel | VoiceChannel | NewsChannel | StageChannel;
type AnyThreadChannel = NewsThreadChannel | PrivateThreadChannel | PublicThreadChannel | ThreadChannel;
type AnyVoiceChannel = VoiceChannel | StageChannel;
type ChannelTypeConversion<T extends GuildChannelTypes> =
T extends Constants["ChannelTypes"]["GUILD_TEXT"] ? TextChannel :
T extends Constants["ChannelTypes"]["GUILD_VOICE"] ? VoiceChannel :
T extends Constants["ChannelTypes"]["GUILD_CATEGORY"] ? CategoryChannel :
T extends Constants["ChannelTypes"]["GUILD_NEWS"] ? NewsChannel :
T extends Constants["ChannelTypes"]["GUILD_STAGE_VOICE"] ? StageChannel :
T extends Constants["ChannelTypes"]["GUILD_FORUM"] ? ForumChannel :
T extends Constants["ChannelTypes"]["GUILD_MEDIA"] ? MediaChannel :
never;
type EditGuildChannelOptions = EditForumChannelOptions | EditMediaChannelOptions | EditGuildTextableChannelOptions;
type EditGuildTextableChannelOptions = EditNewsChannelOptions | EditTextChannelOptions | EditThreadChannelOptions | EditVoiceChannelOptions;
type GuildTextableWithThreads = AnyGuildTextableChannel | GuildTextableChannel | AnyThreadChannel;
type InviteChannel = InvitePartialChannel | Exclude<AnyGuildChannel, CategoryChannel | AnyThreadChannel>;
type PossiblyUncachedSpeakableChannel = AnyVoiceChannel | Uncached;
type PossiblyUncachedTextableChannel = TextableChannel | Uncached;
type TextableChannel = GuildTextableWithThreads | DMChannel;
type VideoQualityMode = Constants["VideoQualityModes"][keyof Constants["VideoQualityModes"]];
// Channel Types
type ChannelTypes = GuildChannelTypes | PrivateChannelTypes;
type GuildChannelTypes = Exclude<Constants["ChannelTypes"][keyof Constants["ChannelTypes"]], PrivateChannelTypes>;
type GuildTextChannelTypes = Constants["ChannelTypes"][keyof Pick<Constants["ChannelTypes"], "GUILD_TEXT" | "GUILD_NEWS">];
type GuildVoiceChannelTypes = Constants["ChannelTypes"][keyof Pick<Constants["ChannelTypes"], "GUILD_VOICE" | "GUILD_STAGE_VOICE">];
type GuildThreadChannelTypes = Constants["ChannelTypes"][keyof Pick<Constants["ChannelTypes"], "GUILD_NEWS_THREAD" | "GUILD_PRIVATE_THREAD" | "GUILD_PUBLIC_THREAD">];
type GuildPublicThreadChannelTypes = Exclude<GuildThreadChannelTypes, Constants["ChannelTypes"]["GUILD_PRIVATE_THREAD"]>;
type PrivateChannelTypes = Constants["ChannelTypes"][keyof Pick<Constants["ChannelTypes"], "DM" | "GROUP_DM">];
type TextChannelTypes = GuildTextChannelTypes | PrivateChannelTypes;
type TextVoiceChannelTypes = Constants["ChannelTypes"][keyof Pick<Constants["ChannelTypes"], "GUILD_VOICE">];
// Client
type ApplicationRoleConnectionMetadataTypes = Constants["RoleConnectionMetadataTypes"][keyof Constants["RoleConnectionMetadataTypes"]];
type MembershipStates = Constants["MembershipState"][keyof Constants["MembershipState"]];
type OAuthTeamMemberRoleTypes = Constants["OAuthTeamMemberRoleTypes"][keyof Constants["OAuthTeamMemberRoleTypes"]];
// Command
type CommandGenerator = CommandGeneratorFunction | MessageContent | MessageContent[] | CommandGeneratorFunction[];
type CommandGeneratorFunction = (msg: Message, args: string[]) => GeneratorFunctionReturn;
type GeneratorFunctionReturn = Promise<MessageContent> | Promise<void> | MessageContent | void;
type GenericCheckFunction<T> = (msg: Message) => T | Promise<T>;
type ReactionButtonsFilterFunction = (msg: Message, emoji: Emoji, userID: string) => boolean;
type ReactionButtonsGenerator = ReactionButtonsGeneratorFunction | MessageContent | MessageContent[] | ReactionButtonsGeneratorFunction[];
type ReactionButtonsGeneratorFunction = (msg: Message, args: string[], userID: string) => GeneratorFunctionReturn;
// Gateway/REST
type IntentStrings = keyof Constants["Intents"];
type ReconnectDelayFunction = (lastDelay: number, attempts: number) => number;
type RequestMethod = "GET" | "PATCH" | "DELETE" | "POST" | "PUT";
// Guild
type DefaultNotifications = Constants["DefaultMessageNotificationLevels"][keyof Constants["DefaultMessageNotificationLevels"]];
type ExplicitContentFilter = Constants["ExplicitContentFilterLevels"][keyof Constants["ExplicitContentFilterLevels"]];
type GuildFeatures = Constants["GuildFeatures"][number];
type GuildIntegrationExpireBehavior = Constants["GuildIntegrationExpireBehavior"][keyof Constants["GuildIntegrationExpireBehavior"]];
type GuildIntegrationTypes = Constants["GuildIntegrationTypes"][number];
type GuildScheduledEventEditOptions<T extends GuildScheduledEventEntityTypes> = GuildScheduledEventEditOptionsExternal | GuildScheduledEventEditOptionsDiscord | GuildScheduledEventEditOptionsBase<T>;
type GuildScheduledEventEntityTypes = Constants["GuildScheduledEventEntityTypes"][keyof Constants["GuildScheduledEventEntityTypes"]];
type GuildScheduledEventOptions<T extends GuildScheduledEventEntityTypes> = GuildScheduledEventOptionsExternal | GuildScheduledEventOptionsDiscord | GuildScheduledEventOptionsBase<T>;
type GuildScheduledEventPrivacyLevel = Constants["GuildScheduledEventPrivacyLevel"][keyof Constants["GuildScheduledEventPrivacyLevel"]];
type GuildScheduledEventStatus = Constants["GuildScheduledEventStatus"][keyof Constants["GuildScheduledEventStatus"]];
type GuildWidgetStyles = Constants["GuildWidgetStyles"][keyof Constants["GuildWidgetStyles"]];
type MFALevel = Constants["MFALevels"][keyof Constants["MFALevels"]];
type NSFWLevel = Constants["GuildNSFWLevels"][keyof Constants["GuildNSFWLevels"]];
type OnboardingModes = Constants["GuildOnboardingModes"][keyof Constants["GuildOnboardingModes"]];
type OnboardingPromptTypes = Constants["GuildOnboardingPromptTypes"][keyof Constants["GuildOnboardingPromptTypes"]];
type PermissionValueTypes = bigint | number | string;
type PossiblyUncachedGuild = Guild | Uncached;
type PossiblyUncachedGuildScheduledEvent = GuildScheduledEvent | Uncached;
type PossiblyUncachedGuildSoundboardSound = SoundboardSound | { id: string; guild: PossiblyUncachedGuild };
type PremiumTier = Constants["PremiumTiers"][keyof Constants["PremiumTiers"]];
type SystemChannelFlags = Constants["SystemChannelFlags"][keyof Constants["SystemChannelFlags"]];
type VerificationLevel = Constants["VerificationLevels"][keyof Constants["VerificationLevels"]];
// Interaction
type AnyInteraction = PingInteraction | CommandInteraction | ComponentInteraction | AutocompleteInteraction | ModalSubmitInteraction;
type InteractionCallbackData = InteractionAutocomplete | InteractionContent | InteractionModal;
type InteractionContent = Pick<WebhookPayload, "content" | "embeds" | "allowedMentions" | "tts" | "flags" | "components" | "poll">;
type InteractionContentEdit = Pick<WebhookPayload, "content" | "embeds" | "allowedMentions" | "components">;
type InteractionDataOptions = InteractionDataOptionsSubCommand | InteractionDataOptionsSubCommandGroup | InteractionDataOptionsWithValue;
type InteractionDataOptionsBoolean = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["BOOLEAN"], boolean>;
type InteractionDataOptionsChannel = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["CHANNEL"], string>;
type InteractionDataOptionsInteger = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["INTEGER"], number>;
type InteractionDataOptionsMentionable = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["MENTIONABLE"], string>;
type InteractionDataOptionsNumber = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["NUMBER"], number>;
type InteractionDataOptionsRole = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["ROLE"], string>;
type InteractionDataOptionsString = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["STRING"], string>;
type InteractionDataOptionsUser = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["USER"], string>;
type InteractionDataOptionsWithValue = InteractionDataOptionsString | InteractionDataOptionsInteger | InteractionDataOptionsBoolean | InteractionDataOptionsUser | InteractionDataOptionsChannel | InteractionDataOptionsRole | InteractionDataOptionsMentionable | InteractionDataOptionsNumber;
type InteractionResponseTypes = Constants["InteractionResponseTypes"][keyof Constants["InteractionResponseTypes"]];
type InteractionTypes = Constants["InteractionTypes"][keyof Constants["InteractionTypes"]];
type LocaleStrings = Constants["Locales"][keyof Constants["Locales"]];
// Invite
type InviteTargetTypes = Constants["InviteTargetTypes"][keyof Constants["InviteTargetTypes"]];
// Message
type ActionRowComponents = Button | SelectMenu;
type Button = InteractionButton | URLButton;
type ButtonStyles = Constants["ButtonStyles"][keyof Constants["ButtonStyles"]];
type Component = ActionRow | ActionRowComponents;
type ImageFormat = Constants["ImageFormats"][number];
type MessageActivityTypes = Constants["MessageActivityTypes"][keyof Constants["MessageActivityTypes"]];
type MessageContent = string | AdvancedMessageContent;
type MessageContentEdit = string | AdvancedMessageContentEdit;
type MessageReferenceTypes = Constants["MessageReferenceTypes"][keyof Constants["MessageReferenceTypes"]];
type PollLayoutTypes = Constants["PollLayoutTypes"][keyof Constants["PollLayoutTypes"]];
type PossiblyUncachedMessage = Message | { channel: TextableChannel | { id: string; guild?: Uncached }; guildID?: string; id: string };
type ReactionTypes = Constants["ReactionTypes"][keyof Constants["ReactionTypes"]];
type SelectMenu = StringSelectMenu | ChannelSelectMenu | ResolvedSelectMenus;
type SelectMenuNonResolvedTypes = Constants["ComponentTypes"][keyof Pick<Constants["ComponentTypes"], "STRING_SELECT">];
type SelectMenuResolvedTypes = Constants["ComponentTypes"][keyof Pick<Constants["ComponentTypes"], "USER_SELECT" | "ROLE_SELECT" | "MENTIONABLE_SELECT" | "CHANNEL_SELECT">];
type SelectMenuTypes = SelectMenuNonResolvedTypes | SelectMenuResolvedTypes;
// Permission
type PermissionType = Constants["PermissionOverwriteTypes"][keyof Constants["PermissionOverwriteTypes"]];
// Presence
type ActivityFlags = Constants["ActivityFlags"][keyof Constants["ActivityFlags"]];
type ActivityType = Constants["ActivityTypes"][keyof Constants["ActivityTypes"]];
type SelfStatus = Status | "invisible";
type Status = "online" | "idle" | "dnd";
type UserStatus = Status | "offline";
// Sticker
type StickerFormats = Constants["StickerFormats"][keyof Constants["StickerFormats"]];
type StickerTypes = Constants["StickerTypes"][keyof Constants["StickerTypes"]];
// Thread/Forum
type AutoArchiveDuration = 60 | 1440 | 4320 | 10080;
type ChannelFlags = Constants["ChannelFlags"][keyof Constants["ChannelFlags"]];
type ForumLayoutTypes = Constants["ForumLayoutTypes"][keyof Constants["ForumLayoutTypes"]];
type SortOrderTypes = Constants["SortOrderTypes"][keyof Constants["SortOrderTypes"]];
// User
type PremiumTypes = Constants["PremiumTypes"][keyof Constants["PremiumTypes"]];
// Voice
type ConverterCommand = "./ffmpeg" | "./avconv" | "ffmpeg" | "avconv";
type StageInstancePrivacyLevel = Constants["StageInstancePrivacyLevel"][keyof Constants["StageInstancePrivacyLevel"]];
type VoiceChannelEffectAnimationType = Constants["VoiceChannelEffectAnimationTypes"][keyof Constants["VoiceChannelEffectAnimationTypes"]];
// Webhook
type WebhookPayloadEdit = Pick<WebhookPayload, "attachments" | "content" | "embed" | "embeds" | "file" | "allowedMentions" | "components">;
type WebhookTypes = Constants["WebhookTypes"][keyof Constants["WebhookTypes"]];
// INTERFACES
// Internals
type JSONCache = Record<string, unknown>;
interface NestedJSON {
toJSON(arg?: unknown, cache?: (string | unknown)[]): JSONCache;
}
interface SimpleJSON {
toJSON(props?: string[]): JSONCache;
}
// Application Commands
/** Generic T is `true` if editing Guild scoped commands, and `false` if not */
interface ApplicationCommandEditOptions<T extends boolean, U = ApplicationCommandTypes> {
defaultMemberPermissions?: bigint | number | string | Permission | null;
/** @deprecated */
defaultPermission?: boolean;
description?: U extends Constants["ApplicationCommandTypes"]["CHAT_INPUT"] ? string : "" | void;
descriptionLocalizations?: U extends Constants["ApplicationCommandTypes"]["CHAT_INPUT"] ? Record<LocaleStrings, string> | null : null;
dmPermission?: T extends true ? never : boolean | null;
name?: string;
nameLocalizations?: Record<LocaleStrings, string> | null;
nsfw?: boolean;
options?: ApplicationCommandOptions[];
}
/** Generic T is `true` if creating Guild scoped commands, and `false` if not */
interface ApplicationCommandCreateOptions<T extends boolean, U = ApplicationCommandTypes> extends ApplicationCommandEditOptions<T, U> {
description: U extends Constants["ApplicationCommandTypes"]["CHAT_INPUT"] ? string : "" | void;
name: string;
type?: U;
}
/** Generic T is `true` if editing Guild scoped commands, and `false` if not */
interface ApplicationCommandBulkEditOptions<T extends boolean, U = ApplicationCommandTypes> extends ApplicationCommandCreateOptions<T, U> {
id?: string;
}
interface ApplicationCommandOption<T extends Constants["ApplicationCommandOptionTypes"][Exclude<keyof Constants["ApplicationCommandOptionTypes"], "SUB_COMMAND" | "SUB_COMMAND_GROUP">]> {
channel_types: T extends Constants["ApplicationCommandOptionTypes"]["CHANNEL"] ? ChannelTypes[] | undefined : never;
description: string;
descriptionLocalizations?: Record<LocaleStrings, string> | null;
name: string;
nameLocalizations?: Record<LocaleStrings, string> | null;
required?: boolean;
type: T;
}
interface ApplicationCommandOptionChoice<T extends Constants["ApplicationCommandOptionTypes"][keyof Pick<Constants["ApplicationCommandOptionTypes"], "STRING" | "INTEGER" | "NUMBER">] | unknown = unknown> {
name: string;
value: T extends Constants["ApplicationCommandOptionTypes"]["STRING"]
? string
: T extends Constants["ApplicationCommandOptionTypes"]["NUMBER"]
? number
: T extends Constants["ApplicationCommandOptionTypes"]["INTEGER"]
? number
: number | string;
}
interface ApplicationCommandOptionsSubCommand {
description: string;
descriptionLocalizations?: Record<LocaleStrings, string> | null;
name: string;
nameLocalizations?: Record<LocaleStrings, string> | null;
options?: ApplicationCommandOptionsWithValue[];
type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND"];
}
interface ApplicationCommandOptionsSubCommandGroup {
description: string;
descriptionLocalizations?: Record<LocaleStrings, string> | null;
name: string;
nameLocalizations?: Record<LocaleStrings, string> | null;
options?: (ApplicationCommandOptionsSubCommand | ApplicationCommandOptionsWithValue)[];
type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND_GROUP"];
}
interface ApplicationCommandOptionWithChoices<T extends Constants["ApplicationCommandOptionTypes"][keyof Pick<Constants["ApplicationCommandOptionTypes"], "STRING" | "INTEGER" | "NUMBER">] = Constants["ApplicationCommandOptionTypes"][keyof Pick<Constants["ApplicationCommandOptionTypes"], "STRING" | "INTEGER" | "NUMBER">]> {
autocomplete?: boolean;
choices?: ApplicationCommandOptionChoice<T>[];
description: string;
descriptionLocalizations?: Record<LocaleStrings, string> | null;
name: string;
nameLocalizations?: Record<LocaleStrings, string> | null;
required?: boolean;
type: T;
}
interface ApplicationCommandOptionWithMinMax<T extends Constants["ApplicationCommandOptionTypes"][keyof Pick<Constants["ApplicationCommandOptionTypes"], "INTEGER" | "NUMBER">] = Constants["ApplicationCommandOptionTypes"][keyof Pick<Constants["ApplicationCommandOptionTypes"], "INTEGER" | "NUMBER">]> {
autocomplete?: boolean;
choices?: ApplicationCommandOptionChoice<T>[];
description: string;
descriptionLocalizations?: Record<LocaleStrings, string> | null;
max_value?: number;
min_value?: number;
name: string;
nameLocalizations?: Record<LocaleStrings, string> | null;
required?: boolean;
type: T;
}
interface ApplicationCommandPermissions {
id: string;
permission: boolean;
type: ApplicationCommandPermissionTypes;
}
interface AutocompleteEnabled {
autocomplete: true;
}
interface AutocompleteDisabled {
autocomplete?: false;
}
interface AutocompleteDisabledInteger extends AutocompleteDisabled {
min_value?: null;
max_value?: null;
}
interface AutocompleteDisabledIntegerMinMax extends AutocompleteDisabled {
choices?: null;
}
interface GuildApplicationCommandPermissions {
application_id: string;
guild_id: string;
id: string;
permissions: ApplicationCommandPermissions[];
}
// Auto Moderation
interface AutoModerationAction {
metadata?: AutoModerationActionMetadata;
type: AutoModerationActionType;
}
interface AutoModerationActionExecution {
action: AutoModerationAction;
alertSystemMessageID?: string;
channelID?: string;
content?: string;
guildID: string;
matchedContent?: string | null;
matchedKeyword: string | null;
messageID?: string;
ruleID: string;
ruleTriggerType: AutoModerationTriggerType;
userID: string;
}
interface AutoModerationActionMetadata {
/** valid for SEND_ALERT_MESSAGE */
channelID?: string;
/** valid for TIMEOUT */
durationSeconds?: number;
}
interface AutoModerationRule {
actions: AutoModerationAction[];
creatorID: string;
enabled: boolean;
eventType: AutoModerationEventType;
exemptRoles: string[];
exemptUsers: string[];
guildID: string;
id: string;
name: string;
triggerMetadata: AutoModerationTriggerMetadata;
triggerType: AutoModerationTriggerType;
}
interface CreateAutoModerationRuleOptions {
actions: AutoModerationAction[];
enabled?: boolean;
eventType: AutoModerationActionType;
exemptChannels?: string[];
exemptRoles?: string[];
name: string;
reason?: string;
triggerMetadata?: AutoModerationTriggerMetadata;
triggerType: AutoModerationTriggerType;
}
interface AutoModerationTriggerMetadata {
/** valid for KEYWORD */
keywordFilter: string[];
/** valid for KEYWORD_PRESET */
presets: AutoModerationKeywordPresetType[];
}
// Channel
interface ChannelFollow {
channel_id: string;
webhook_id: string;
}
interface ChannelPosition extends EditChannelPositionOptions {
id: string;
position?: number;
}
interface CreateChannelOptions {
availableTags?: ForumTag[];
bitrate?: number;
defaultAutoArchiveDuration?: AutoArchiveDuration;
defaultForumLayout?: ForumLayoutTypes;
defaultReactionEmoji?: DefaultReactionEmoji;
defaultSortOrder?: SortOrderTypes;
defaultThreadRateLimitPerUser?: number;
nsfw?: boolean;
parentID?: string;
permissionOverwrites?: Overwrite[];
position?: number;
rateLimitPerUser?: number;
reason?: string;
topic?: string;
userLimit?: number;
}
interface EditChannelOptionsBase {
name?: string;
position?: number;
permissionOverwrites?: Overwrite[];
}
interface EditNewsChannelOptions extends EditChannelOptionsBase {
defaultAutoArchiveDuration?: AutoArchiveDuration | null;
nsfw?: boolean | null;
parentID?: string | null;
topic?: string | null;
type?: GuildTextChannelTypes;
}
interface EditTextChannelOptions extends EditNewsChannelOptions {
defaultThreadRateLimitPerUser?: number | null;
rateLimitPerUser?: number | null;
}
interface EditVoiceChannelOptions extends EditChannelOptionsBase {
bitrate?: number | null;
nsfw?: boolean | null;
parentID?: string | null;
rateLimitPerUser?: number | null;
rtcRegion?: string | null;
userLimit?: number | null;
videoQualityMode?: VideoQualityMode | null;
}
interface EditMediaChannelOptions extends EditChannelOptionsBase {
availableTags?: ForumTag[];
defaultAutoArchiveDuration?: AutoArchiveDuration | null;
defaultReactionEmoji?: DefaultReactionEmoji | null;
defaultSortOrder?: SortOrderTypes | null;
defaultThreadRateLimitPerUser?: number;
flags?: ChannelFlags;
nsfw?: boolean | null;
parentID?: string | null;
rateLimitPerUser?: number | null;
topic?: string | null;
}
interface EditForumChannelOptions extends EditMediaChannelOptions {
defaultForumLayout?: ForumLayoutTypes | null;
}
interface EditThreadChannelOptions {
appliedTags?: string[];
archived?: boolean;
autoArchiveDuration?: AutoArchiveDuration;
flags?: ChannelFlags;
invitable?: boolean;
locked?: boolean;
name?: string;
rateLimitPerUser?: number | null;
}
interface EditChannelPositionOptions {
lockPermissions?: boolean;
parentID?: string;
}
interface EditGroupChannelOptions {
icon?: string | null;
name?: string;
}
interface GetMessagesOptions {
after?: string;
around?: string;
before?: string;
limit?: number;
}
interface GroupRecipientOptions {
accessToken: string;
nick?: string;
}
interface PartialChannel {
bitrate?: number;
id: string;
name?: string;
nsfw?: boolean;
parent_id?: number;
permission_overwrites?: Overwrite[];
rate_limit_per_user?: number;
topic?: string | null;
type: number;
user_limit?: number;
}
interface Permissionable {
permissionOverwrites: Collection<PermissionOverwrite>;
position: number;
deletePermission(overwriteID: string, reason?: string): Promise<void>;
editPermission(overwriteID: string, allow: PermissionValueTypes, deny: PermissionValueTypes, type: PermissionType, reason?: string): Promise<PermissionOverwrite>;
}
interface Pinnable {
lastPinTimestamp: number | null;
getPins(): Promise<Message[]>;
pinMessage(messageID: string): Promise<void>;
unpinMessage(messageID: string): Promise<void>;
}
interface PurgeChannelOptions {
after?: string;
before?: string;
filter?: (m: Message<AnyGuildTextableChannel>) => boolean;
limit: number;
reason?: string;
}
interface WebhookData {
channelID: string;
guildID: string;
}
// Client
interface ApplicationRoleConnectionMetadata {
description: string;
description_localizations?: Record<LocaleStrings, string>;
key: string;
name: string;
name_localizations?: Record<LocaleStrings, string>;
type: ApplicationRoleConnectionMetadataTypes;
}
interface ClientOptions {
/** @deprecated */
agent?: HTTPSAgent;
allowedMentions?: AllowedMentions;
autoreconnect?: boolean;
compress?: boolean;
connectionTimeout?: number;
defaultImageFormat?: string;
defaultImageSize?: number;
disableEvents?: Record<string, boolean>;
firstShardID?: number;
getAllUsers?: boolean;
guildCreateTimeout?: number;
intents: number | (IntentStrings | number)[];
largeThreshold?: number;
lastShardID?: number;
/** @deprecated */
latencyThreshold?: number;
maxReconnectAttempts?: number;
maxResumeAttempts?: number;
maxShards?: number | "auto";
messageLimit?: number;
opusOnly?: boolean;
/** @deprecated */
ratelimiterOffset?: number;
reconnectDelay?: ReconnectDelayFunction;
requestTimeout?: number;
rest?: RequestHandlerOptions;
restMode?: boolean;
seedVoiceConnections?: boolean;
shardConcurrency?: number | "auto";
ws?: unknown;
}
interface CommandClientOptions {
argsSplitter?: (str: string) => string[];
defaultCommandOptions?: CommandOptions;
defaultHelpCommand?: boolean;
description?: string;
ignoreBots?: boolean;
ignoreSelf?: boolean;
name?: string;
owner?: string;
prefix?: string | string[];
}
interface EditSelfOptions {
avatar?: string | null;
banner?: string | null;
username?: string;
}
interface RequestHandlerOptions {
agent?: HTTPSAgent;
baseURL?: string;
decodeReasons?: boolean;
disableLatencyCompensation?: boolean;
domain?: string;
latencyThreshold?: number;
ratelimiterOffset?: number;
requestTimeout?: number;
}
// Command
interface CommandCooldownExclusions {
channelIDs?: string[];
guildIDs?: string[];
userIDs?: string[];
}
interface CommandOptions {
aliases?: string[];
argsRequired?: boolean;
caseInsensitive?: boolean;
cooldown?: number;
cooldownExclusions?: CommandCooldownExclusions;
cooldownMessage?: MessageContent | GenericCheckFunction<MessageContent> | false;
cooldownReturns?: number;
defaultSubcommandOptions?: CommandOptions;
deleteCommand?: boolean;
description?: string;
dmOnly?: boolean;
errorMessage?: MessageContent | GenericCheckFunction<MessageContent>;
fullDescription?: string;
guildOnly?: boolean;
hidden?: boolean;
hooks?: Hooks;
invalidUsageMessage?: MessageContent | GenericCheckFunction<MessageContent> | false;
permissionMessage?: MessageContent | GenericCheckFunction<MessageContent> | false;
reactionButtons?: CommandReactionButtonsOptions[] | null;
reactionButtonTimeout?: number;
requirements?: CommandRequirements;
restartCooldown?: boolean;
usage?: string;
}
interface CommandReactionButtons extends CommandReactionButtonsOptions {
execute: (msg: Message, args: string[], userID: string) => string | GeneratorFunctionReturn;
responses: ((() => string) | ReactionButtonsGeneratorFunction)[];
}
interface CommandReactionButtonsOptions {
emoji: string;
filter: ReactionButtonsFilterFunction;
response: string | ReactionButtonsGeneratorFunction;
type: "edit" | "cancel";
}
interface CommandRequirements {
custom?: GenericCheckFunction<boolean>;
permissions?: Record<string, boolean> | GenericCheckFunction<Record<string, boolean>>;
roleIDs?: string[] | GenericCheckFunction<string[]>;
roleNames?: string[] | GenericCheckFunction<string[]>;
userIDs?: string[] | GenericCheckFunction<string[]>;
}
interface Hooks {
postCheck?: (msg: Message, args: string[], checksPassed: boolean) => void;
postCommand?: (msg: Message, args: string[], sent?: Message) => void;
postExecution?: (msg: Message, args: string[], executionSuccess: boolean) => void;
preCommand?: (msg: Message, args: string[]) => void;
}
// Embed
// Omit<T, K> used to override
interface Embed extends Omit<EmbedOptions, "footer" | "image" | "thumbnail" | "author"> {
author?: EmbedAuthor;
footer?: EmbedFooter;
image?: EmbedImage;
provider?: EmbedProvider;
thumbnail?: EmbedImage;
type: string;
video?: EmbedVideo;
}
interface EmbedAuthor extends EmbedAuthorOptions {
proxy_icon_url?: string;
}
interface EmbedAuthorOptions {
icon_url?: string;
name: string;
url?: string;
}
interface EmbedField {
inline?: boolean;
name: string;
value: string;
}
interface EmbedFooter extends EmbedFooterOptions {
proxy_icon_url?: string;
}
interface EmbedFooterOptions {
icon_url?: string;
text: string;
}
interface EmbedImage extends EmbedImageOptions {
height?: number;
proxy_url?: string;
width?: number;
}
interface EmbedImageOptions {
url?: string;
}
interface EmbedOptions {
author?: EmbedAuthorOptions;
color?: number;
description?: string;
fields?: EmbedField[];
footer?: EmbedFooterOptions;
image?: EmbedImageOptions;
thumbnail?: EmbedImageOptions;
timestamp?: Date | string;
title?: string;
url?: string;
}
interface EmbedProvider {
name?: string;
url?: string;
}
interface EmbedVideo {
height?: number;
proxy_url?: string;
url?: string;
width?: number;
}
// Emoji
interface Emoji extends EmojiBase {
animated: boolean;
available: boolean;
id: string;
managed: boolean;
require_colons: boolean;
roles: string[];
user?: PartialUser;
}
interface EmojiBase {
icon?: string;
name: string;
}
interface EmojiOptions extends Exclude<EmojiBase, "icon"> {
image: string;
roles?: string[];
}
interface PartialEmoji {
id: string | null;
name: string;
animated?: boolean;
}
// Events
interface OldCall {
endedTimestamp?: number;
participants: string[];
region: string;
ringing: string[];
unavailable: boolean;
}
interface OldForumChannel extends OldGuildChannel {
availableTags: ForumTag[];
defaultAutoArchiveDuration: AutoArchiveDuration;
defaultForumLayout: ForumLayoutTypes;
defaultReactionEmoji: DefaultReactionEmoji;
defaultSortOrder: SortOrderTypes;
defaultThreadRateLimitPerUser: number;
}
interface OldGroupChannel {
icon: string;
name: string;
ownerID: string;
type: Constants["ChannelTypes"]["GROUP_DM"];
}
interface OldGuild {
afkChannelID: string | null;
afkTimeout: number;
autoRemoved: boolean | null;
banner: string | null;
defaultNotifications: DefaultNotifications;
description: string | null;
discoverySplash: string | null;
emojiCount: number | null;
emojis: Omit<Emoji, "user" | "icon">[];
explicitContentFilter: ExplicitContentFilter;
features: GuildFeatures[];
icon: string | null;
keywords: string[] | null;
large: boolean;
maxMembers?: number;
maxVideoChannelUsers?: number;
mfaLevel: MFALevel;
name: string;
/** @deprecated */
nsfw: boolean;
nsfwLevel: NSFWLevel;
ownerID: string;
preferredLocale?: LocaleStrings;
premiumProgressBarEnabled: boolean;
premiumSubscriptionCount?: number;
premiumTier: PremiumTier;
primaryCategory?: DiscoveryCategory;
primaryCategoryID: number | null;
publicUpdatesChannelID: string | null;
rulesChannelID: string | null;
splash: string | null;
stickers?: Sticker[];
systemChannelFlags: number;
systemChannelID: string | null;
vanityURL: string | null;
verificationLevel: VerificationLevel;
welcomeScreen?: WelcomeScreen;
}
interface OldGuildChannel {
bitrate?: number;
flags?: number;
name: string;
nsfw?: boolean;
parentID: string | null;
permissionOverwrites: Collection<PermissionOverwrite>;
position: number;
rateLimitPerUser?: number;
rtcRegion?: string | null;
topic?: string | null;
type: GuildChannelTypes;
}
interface OldGuildScheduledEvent {
channel: PossiblyUncachedSpeakableChannel | null;
description?: string | null;
entityID: string | null;
entityMetadata: GuildScheduledEventMetadata | null;
entityType: GuildScheduledEventEntityTypes;
image?: string;
name: string;
privacyLevel: GuildScheduledEventPrivacyLevel;
scheduledEndTime: number | null;
scheduledStartTime: number;
status: GuildScheduledEventStatus;
}
interface OldGuildSoundboardSound {
available: boolean;
emojiID: string | null;
emojiName: string | null;
name: string;
volume: number;
}
interface OldGuildTextChannel extends OldGuildChannel {
nsfw: boolean;
rateLimitPerUser: number;
topic?: string | null;
type: GuildTextChannelTypes;
}
interface OldMember {
avatar: string | null;
avatarDecorationData?: AvatarDecorationData | null;
communicationDisabledUntil?: number | null;
flags?: number;
nick: string | null;
pending?: boolean;
premiumSince?: number | null;
roles: string[];
}
interface OldMessage {
attachments: Attachment[];
channelMentions: string[];
content: string;
editedTimestamp?: number;
embeds: Embed[];
flags: number;
mentionedBy?: unknown;
mentions: User[];
pinned: boolean;
poll?: Poll;
roleMentions: string[];
tts: boolean;
}
interface OldRole {
color: number;
flags: number;
hoist: boolean;
icon: string | null;
managed: boolean;
mentionable: boolean;
name: string;
permissions: Permission;
position: number;
unicodeEmoji: string | null;
}
interface OldStageInstance {
discoverableDisabled: boolean;
privacyLevel: StageInstancePrivacyLevel;
topic: string;
}
interface OldVoiceChannel extends OldGuildChannel {
bitrate: number;
rtcRegion: string | null;
type: GuildVoiceChannelTypes;
userLimit: number;
videoQualityMode: VideoQualityMode;
}
interface OldThread {
appliedTags: string[];
autoArchiveDuration: number;
name: string;
rateLimitPerUser: number;
threadMetadata: ThreadMetadata;
}
interface OldThreadMember {
flags: number;
}
interface OldVoiceState {
deaf: boolean;
mute: boolean;
selfDeaf: boolean;
selfMute: boolean;
selfStream: boolean;
selfVideo: boolean;
}
interface EventListeners {
applicationCommandPermissionsUpdate: [applicationCommandPermissions: GuildApplicationCommandPermissions];
autoModerationActionExecution: [guild: Guild, action: AutoModerationActionExecution];
autoModerationRuleCreate: [guild: Guild, rule: AutoModerationRule];
autoModerationRuleDelete: [guild: Guild, rule: AutoModerationRule];
autoModerationRuleUpdate: [guild: Guild, rule: AutoModerationRule | null, newRule: AutoModerationRule];
channelCreate: [channel: AnyGuildChannel];
channelDelete: [channel: Exclude<AnyChannel, GroupChannel>];
channelPinUpdate: [channel: TextableChannel, timestamp: number, oldTimestamp: number];
channelUpdate: [channel: AnyGuildChannel, oldChannel: OldGuildChannel | OldForumChannel | OldGuildTextChannel | OldVoiceChannel]
| [channel: GroupChannel, oldChannel: OldGroupChannel];
connect: [id: number];
debug: [message: string, id?: number];
disconnect: [];
error: [err: Error, id?: number];
guildAuditLogEntryCreate: [guildAuditLogEntry: GuildAuditLogEntry];
guildAvailable: [guild: Guild];
guildBanAdd: [guild: Guild, user: User];
guildBanRemove: [guild: Guild, user: User];
guildCreate: [guild: Guild];
guildDelete: [guild: PossiblyUncachedGuild];
guildEmojisUpdate: [guild: PossiblyUncachedGuild, emojis: Emoji[], oldEmojis: Emoji[] | null];
guildIntegrationsUpdate: [guild: PossiblyUncachedGuild];
guildMemberAdd: [guild: Guild, member: Member];
guildMemberChunk: [guild: Guild, member: Member[]];
guildMemberRemove: [guild: Guild, member: Member | MemberPartial];
guildMemberUpdate: [guild: Guild, member: Member, oldMember: OldMember | null];
guildRoleCreate: [guild: Guild, role: Role];
guildRoleDelete: [guild: Guild, role: Role];
guildRoleUpdate: [guild: Guild, role: Role, oldRole: OldRole];
guildScheduledEventCreate: [event: GuildScheduledEvent];
guildScheduledEventDelete: [event: GuildScheduledEvent];
guildScheduledEventUpdate: [event: GuildScheduledEvent, oldEvent: OldGuildScheduledEvent | null];
guildScheduledEventUserAdd: [event: PossiblyUncachedGuildScheduledEvent, user: User | Uncached];
guildScheduledEventUserRemove: [event: PossiblyUncachedGuildScheduledEvent, user: User | Uncached];
guildSoundboardSoundCreate: [sound: SoundboardSound];
guildSoundboardSoundDelete: [sound: PossiblyUncachedGuildSoundboardSound];
guildSoundboardSoundUpdate: [sound: SoundboardSound, oldSound: OldGuildSoundboardSound | null];
guildSoundboardSoundsUpdate: [guild: PossiblyUncachedGuild, sounds: SoundboardSound[], oldSounds: (OldGuildSoundboardSound | null)[]];
guildStickersUpdate: [guild: PossiblyUncachedGuild, stickers: Sticker[], oldStickers: Sticker[] | null];
guildUnavailable: [guild: UnavailableGuild];
guildUpdate: [guild: Guild, oldGuild: OldGuild];
hello: [trace: string[], id: number];
interactionCreate: [interaction: PingInteraction | CommandInteraction | ComponentInteraction | AutocompleteInteraction | ModalSubmitInteraction | UnknownInteraction];
inviteCreate: [guild: Guild, invite: Invite];
inviteDelete: [guild: Guild, invite: Invite];
messageCreate: [message: Message<PossiblyUncachedTextableChannel>];
messageDelete: [message: PossiblyUncachedMessage];
messageDeleteBulk: [messages: PossiblyUncachedMessage[]];
messagePollVoteAdd: [message: PossiblyUncachedMessage, user: User | Uncached, answerID: number];
messagePollVoteRemove: [message: PossiblyUncachedMessage, user: User | Uncached, answerID: number];
messageReactionAdd: [message: PossiblyUncachedMessage, emoji: PartialEmoji, reactor: Member | Uncached, burst: boolean];
messageReactionRemove: [message: PossiblyUncachedMessage, emoji: PartialEmoji, userID: string, burst: boolean];
messageReactionRemoveAll: [message: PossiblyUncachedMessage];
messageReactionRemoveEmoji: [message: PossiblyUncachedMessage, emoji: PartialEmoji];
messageUpdate: [message: Message<PossiblyUncachedTextableChannel>, oldMessage: OldMessage | null];
presenceUpdate: [other: Member, oldPresence: Presence | null];
rawREST: [request: RawRESTRequest];
rawWS: [packet: RawPacket, id: number];
ready: [];
shardPreReady: [id: number];
soundboardSounds: [guild: PossiblyUncachedGuild, sounds: SoundboardSound[]];
stageInstanceCreate: [stageInstance: StageInstance];
stageInstanceDelete: [stageInstance: StageInstance];
stageInstanceUpdate: [stageInstance: StageInstance, oldStageInstance: OldStageInstance | null];
threadCreate: [channel: AnyThreadChannel];
threadDelete: [channel: AnyThreadChannel];
threadListSync: [guild: Guild, deletedThreads: (AnyThreadChannel | Uncached)[], activeThreads: AnyThreadChannel[], joinedThreadsMember: ThreadMember[]];
threadMembersUpdate: [channel: AnyThreadChannel, addedMembers: ThreadMember[], removedMembers: (ThreadMember | Uncached)[]];
threadMemberUpdate: [channel: AnyThreadChannel, member: ThreadMember, oldMember: OldThreadMember];
threadUpdate: [channel: AnyThreadChannel, oldChannel: OldThread | null];
typingStart: [channel: AnyGuildTextableChannel | Uncached, user: User | Uncached, member: Member]
| [channel: DMChannel | Uncached, user: User | Uncached, member: null];
unavailableGuildCreate: [guild: UnavailableGuild];
unknown: [packet: RawPacket, id?: number];
userUpdate: [user: User, oldUser: PartialUser | null];
voiceChannelEffectSend: [effect: VoiceChannelEffect];
voiceChannelJoin: [member: Member, channel: AnyVoiceChannel];
voiceChannelLeave: [member: Member, channel: AnyVoiceChannel];
voiceChannelStatusUpdate: [channel: AnyVoiceChannel, oldChannel: VoiceStatus];
voiceChannelSwitch: [member: Member, newChannel: AnyVoiceChannel, oldChannel: AnyVoiceChannel];
voiceStateUpdate: [member: Member, oldState: OldVoiceState];
warn: [message: string, id?: number];
webhooksUpdate: [data: WebhookData];
}
interface ClientEvents extends EventListeners {
shardDisconnect: [err: Error | undefined, id: number];
shardReady: [id: number];
shardResume: [id: number];
}
interface ShardEvents extends EventListeners {
resume: [];
}
interface StreamEvents {
end: [];
error: [err: Error];
start: [];
}
interface VoiceEvents {
connect: [];
debug: [message: string];
disconnect: [err?: Error];
end: [];
error: [err: Error];
pong: [latency: number];
ready: [];
speakingStart: [userID: string];
speakingStop: [userID: string];
start: [];
unknown: [packet: RawPacket];
usersConnect: [userIDs: string[]];
userDisconnect: [userID: string];
warn: [message: string];
}
// Gateway/REST
interface HTTPResponse {
code: number;