This repository has been archived by the owner on Sep 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.d.ts
2151 lines (1910 loc) · 79.1 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
// Type definitions for discord.js 12.0.0
// Project: https://github.com/hydrabolt/discord.js
// Definitions by:
// acdenisSK <[email protected]> (https://github.com/acdenisSK)
// Zack Campbell <[email protected]> (https://github.com/zajrik)
// iCrawl <[email protected]> (https://github.com/iCrawl)
// License: MIT
declare module 'discord.js' {
import { EventEmitter } from 'events';
import { Stream, Readable, Writable } from 'stream';
import { ChildProcess } from 'child_process';
export const version: string;
//#region Classes
export class Activity {
constructor(presence: Presence, data: object);
public applicationID: Snowflake;
public assets: RichPresenceAssets;
public details: string;
public name: string;
public party: {
id: string;
size: [number, number];
};
public state: string;
public timestamps: {
start: Date;
end: Date;
};
public type: ActivityType;
public url: string;
public equals(activity: Activity): boolean;
}
export class Base {
constructor (client: Client);
public readonly client: Client;
public toJSON(...props: { [key: string]: boolean | string }[]): object;
public valueOf(): string;
}
export class BaseClient extends EventEmitter {
constructor(options?: ClientOptions);
private _intervals: Set<NodeJS.Timer>;
private _timeouts: Set<NodeJS.Timer>;
private readonly api: object;
private rest: object;
public options: ClientOptions;
public clearInterval(interval: NodeJS.Timer): void;
public clearTimeout(timeout: NodeJS.Timer): void;
public destroy(): void;
public setInterval(fn: Function, delay: number, ...args: any[]): NodeJS.Timer;
public setTimeout(fn: Function, delay: number, ...args: any[]): NodeJS.Timer;
public toJSON(...props: { [key: string]: boolean | string }[]): object;
}
class BroadcastDispatcher extends VolumeMixin(StreamDispatcher) {
public broadcast: VoiceBroadcast;
}
export class CategoryChannel extends GuildChannel {
public readonly children: Collection<Snowflake, GuildChannel>;
}
export class Channel extends Base {
constructor(client: Client, data: object);
public readonly createdAt: Date;
public readonly createdTimestamp: number;
public deleted: boolean;
public id: Snowflake;
public type: 'dm' | 'group' | 'text' | 'voice' | 'category' | 'unknown';
public delete(reason?: string): Promise<Channel>;
public toString(): string;
}
export class Client extends BaseClient {
constructor(options?: ClientOptions);
private readonly _pingTimestamp: number;
private actions: object;
private manager: ClientManager;
private voice: object;
private ws: object;
private _eval(script: string): any;
private _pong(startTime: number): void;
private _validateOptions(options?: ClientOptions): void;
public broadcasts: VoiceBroadcast[];
public channels: ChannelStore;
public readonly emojis: GuildEmojiStore;
public guilds: GuildStore;
public readonly ping: number;
public pings: number[];
public presences: ClientPresenceStore;
public readyAt: Date;
public readonly readyTimestamp: number;
public shard: ShardClientUtil;
public readonly status: Status;
public token: string;
public readonly uptime: number;
public user: ClientUser;
public users: UserStore;
public readonly voiceConnections: Collection<Snowflake, VoiceConnection>;
public createVoiceBroadcast(): VoiceBroadcast;
public destroy(): Promise<void>;
public fetchApplication(id?: Snowflake): Promise<ClientApplication>;
public fetchInvite(invite: InviteResolvable): Promise<Invite>;
public fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>;
public fetchWebhook(id: Snowflake, token?: string): Promise<Webhook>;
public generateInvite(permissions?: number | PermissionResolvable[]): Promise<string>;
public login(token?: string): Promise<string>;
public sweepMessages(lifetime?: number): number;
public syncGuilds(guilds?: Guild[] | Collection<Snowflake, Guild>): void;
public toJSON(): object;
public on(event: 'channelCreate' | 'channelDelete', listener: (channel: Channel) => void): this;
public on(event: 'channelPinsUpdate', listener: (channel: Channel, time: Date) => void): this;
public on(event: 'channelUpdate', listener: (oldChannel: Channel, newChannel: Channel) => void): this;
public on(event: 'clientUserGuildSettingsUpdate', listener: (clientUserGuildSettings: ClientUserGuildSettings) => void): this;
public on(event: 'clientUserSettingsUpdate', listener: (clientUserSettings: ClientUserSettings) => void): this;
public on(event: 'clientUserGuildSettingsUpdate', listener: (clientUserGuildSettings: ClientUserGuildSettings) => void): this;
public on(event: 'debug' | 'warn', listener: (info: string) => void): this;
public on(event: 'disconnect', listener: (event: any) => void): this;
public on(event: 'emojiCreate' | 'emojiDelete', listener: (emoji: GuildEmoji) => void): this;
public on(event: 'emojiUpdate', listener: (oldEmoji: GuildEmoji, newEmoji: GuildEmoji) => void): this;
public on(event: 'error', listener: (error: Error) => void): this;
public on(event: 'guildBanAdd' | 'guildBanRemove', listener: (guild: Guild, user: User) => void): this;
public on(event: 'guildCreate' | 'guildDelete' | 'guildUnavailable', listener: (guild: Guild) => void): this;
public on(event: 'guildMemberAdd' | 'guildMemberAvailable' | 'guildMemberRemove', listener: (member: GuildMember) => void): this;
public on(event: 'guildMembersChunk', listener: (members: Collection<Snowflake, GuildMember>, guild: Guild) => void): this;
public on(event: 'guildMemberSpeaking', listener: (member: GuildMember, speaking: boolean) => void): this;
public on(event: 'guildMemberUpdate' | 'presenceUpdate' | 'voiceStateUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this;
public on(event: 'guildUpdate', listener: (oldGuild: Guild, newGuild: Guild) => void): this;
public on(event: 'message' | 'messageDelete' | 'messageReactionRemoveAll', listener: (message: Message) => void): this;
public on(event: 'messageDeleteBulk', listener: (messages: Collection<Snowflake, Message>) => void): this;
public on(event: 'messageReactionAdd' | 'messageReactionRemove', listener: (messageReaction: MessageReaction, user: User) => void): this;
public on(event: 'messageUpdate', listener: (oldMessage: Message, newMessage: Message) => void): this;
public on(event: 'rateLimit', listener: (rateLimitData: RateLimitData) => void): this;
public on(event: 'ready' | 'reconnecting', listener: () => void): this;
public on(event: 'resumed', listener: (replayed: number) => void): this;
public on(event: 'roleCreate' | 'roleDelete', listener: (role: Role) => void): this;
public on(event: 'roleUpdate', listener: (oldRole: Role, newRole: Role) => void): this;
public on(event: 'typingStart' | 'typingStop', listener: (channel: Channel, user: User) => void): this;
public on(event: 'userNoteUpdate', listener: (user: UserResolvable, oldNote: string, newNote: string) => void): this;
public on(event: 'userUpdate', listener: (oldUser: User, newUser: User) => void): this;
public on(event: string, listener: Function): this;
public once(event: 'channelCreate' | 'channelDelete', listener: (channel: Channel) => void): this;
public once(event: 'channelPinsUpdate', listener: (channel: Channel, time: Date) => void): this;
public once(event: 'channelUpdate', listener: (oldChannel: Channel, newChannel: Channel) => void): this;
public once(event: 'clientUserGuildSettingsUpdate', listener: (clientUserGuildSettings: ClientUserGuildSettings) => void): this;
public once(event: 'clientUserSettingsUpdate', listener: (clientUserSettings: ClientUserSettings) => void): this;
public once(event: 'clientUserGuildSettingsUpdate', listener: (clientUserGuildSettings: ClientUserGuildSettings) => void): this;
public once(event: 'debug' | 'warn', listener: (info: string) => void): this;
public once(event: 'disconnect', listener: (event: any) => void): this;
public once(event: 'emojiCreate' | 'emojiDelete', listener: (emoji: GuildEmoji) => void): this;
public once(event: 'emojiUpdate', listener: (oldEmoji: GuildEmoji, newEmoji: GuildEmoji) => void): this;
public once(event: 'error', listener: (error: Error) => void): this;
public once(event: 'guildBanAdd' | 'guildBanRemove', listener: (guild: Guild, user: User) => void): this;
public once(event: 'guildCreate' | 'guildDelete' | 'guildUnavailable', listener: (guild: Guild) => void): this;
public once(event: 'guildMemberAdd' | 'guildMemberAvailable' | 'guildMemberRemove', listener: (member: GuildMember) => void): this;
public once(event: 'guildMembersChunk', listener: (members: Collection<Snowflake, GuildMember>, guild: Guild) => void): this;
public once(event: 'guildMemberSpeaking', listener: (member: GuildMember, speaking: boolean) => void): this;
public once(event: 'guildMemberUpdate' | 'presenceUpdate' | 'voiceStateUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this;
public once(event: 'guildUpdate', listener: (oldGuild: Guild, newGuild: Guild) => void): this;
public once(event: 'message' | 'messageDelete' | 'messageReactionRemoveAll', listener: (message: Message) => void): this;
public once(event: 'messageDeleteBulk', listener: (messages: Collection<Snowflake, Message>) => void): this;
public once(event: 'messageReactionAdd' | 'messageReactionRemove', listener: (messageReaction: MessageReaction, user: User) => void): this;
public once(event: 'messageUpdate', listener: (oldMessage: Message, newMessage: Message) => void): this;
public once(event: 'rateLimit', listener: (rateLimitData: RateLimitData) => void): this;
public once(event: 'ready' | 'reconnecting', listener: () => void): this;
public once(event: 'resumed', listener: (replayed: number) => void): this;
public once(event: 'roleCreate' | 'roleDelete', listener: (role: Role) => void): this;
public once(event: 'roleUpdate', listener: (oldRole: Role, newRole: Role) => void): this;
public once(event: 'typingStart' | 'typingStop', listener: (channel: Channel, user: User) => void): this;
public once(event: 'userNoteUpdate', listener: (user: UserResolvable, oldNote: string, newNote: string) => void): this;
public once(event: 'userUpdate', listener: (oldUser: User, newUser: User) => void): this;
public once(event: string, listener: Function): this;
}
export class ClientApplication extends Base {
constructor(client: Client, data: object);
public bot: object;
public botPublic: boolean;
public botRequireCodeGrant: boolean;
public cover: string;
public readonly createdAt: Date;
public readonly createdTimestamp: number;
public description: string;
public icon: string;
public id: Snowflake;
public name: string;
public owner: User;
public redirectURIs: string[];
public rpcApplicationState: boolean;
public rpcOrigins: string[];
public secret: string;
public coverImage(options?: AvatarOptions): string;
public createAsset(name: string, data: Base64Resolvable, type: 'big' | 'small' | 'Big' | 'Small'): Promise<object>;
public fetchAssets(): Promise<ClientApplicationAsset>;
public iconURL(options?: AvatarOptions): string;
public resetSecret(): Promise<ClientApplication>;
public resetToken(): Promise<ClientApplication>;
public toJSON(): object;
public toString(): string;
}
class ClientManager {
constructor(client: Client);
public client: Client;
public heartbeatInterval: number;
public readonly status: number;
public connectToWebSocket(token: string, resolve: Function, reject: Function): void;
}
export class ClientUser extends User {
public blocked: Collection<Snowflake, User>;
public email: string;
public friends: Collection<Snowflake, User>;
public guildSettings: Collection<Snowflake, ClientUserGuildSettings>;
public mfaEnabled: boolean;
public mobile: boolean;
public notes: Collection<Snowflake, string>;
public premium: boolean;
public settings: ClientUserSettings;
public verified: boolean;
public createGroupDM(recipients: GroupDMRecipientOptions[]): Promise<GroupDMChannel>;
public fetchMentions(options?: { limit?: number; roles?: boolean, everyone?: boolean; guild?: Guild | Snowflake }): Promise<Message[]>;
public setActivity(name: string, options?: { url?: string, type?: ActivityType | number }): Promise<Presence>;
public setAFK(afk: boolean): Promise<Presence>;
public setAvatar(avatar: BufferResolvable | Base64Resolvable): Promise<ClientUser>;
public setEmail(email: string, password: string): Promise<ClientUser>;
public setPassword(newPassword: string, options: { oldPassword?: string, mfaCode?: string }): Promise<ClientUser>;
public setPresence(data: PresenceData): Promise<Presence>;
public setStatus(status: PresenceStatus): Promise<Presence>;
public setUsername(username: string, password?: string): Promise<ClientUser>;
public toJSON(): object;
}
export class ClientUserChannelOverride {
constructor(data: object);
private patch(data: object): void;
public messageNotifications: GuildChannelMessageNotifications;
public muted: boolean;
}
export class ClientUserGuildSettings {
constructor(client: Client, data: object);
private patch(data: object): void;
private update(name: string, value: any): Promise<object>;
public channelOverrides: Collection<Snowflake, ClientUserChannelOverride>;
public readonly client: Client;
public guildID: Snowflake;
public messageNotifications: GuildChannelMessageNotifications;
public mobilePush: boolean;
public muted: boolean;
public suppressEveryone: boolean;
}
export class ClientUserSettings {
constructor(user: User, data: object);
private update(name: string, value: any): Promise<object>;
private patch(data: object): void;
public convertEmoticons: boolean;
public defaultGuildsRestricted: boolean;
public detectPlatformAccounts: boolean;
public developerMode: boolean;
public enableTTSCommand: boolean;
public explicitContentFilter: 'DISABLED' | 'NON_FRIENDS' | 'FRIENDS_AND_NON_FRIENDS';
public friendsSources: { all: boolean, mutualGuilds: boolean, mutualFriends: boolean };
public guildsPositions: Snowflake[];
public inlineAttachmentMedia: boolean;
public inlineEmbedMedia: boolean;
public locale: string;
public messageDisplayCompact: boolean;
public renderReactions: boolean;
public restrictedGuilds: Snowflake[];
public showCurrentGame: boolean;
public status: PresenceStatus;
public theme: string;
public addRestrictedGuild(guild: Guild): Promise<Guild>;
public removeRestrictedGuild(guild: Guild): Promise<Guild>;
public setGuildPosition(guild: Guild, position: number, relative?: boolean): Promise<Guild>;
}
export class Collection<K, V> extends Map<K, V> {
private _array: V[];
private _keyArray: K[];
public array(): V[];
public clone(): Collection<K, V>;
public concat(...collections: Collection<K, V>[]): Collection<K, V>;
public each(fn: (value: V, key: K, collection: Collection<K, V>) => void, thisArg?: any): void;
public equals(collection: Collection<any, any>): boolean;
public every(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): boolean;
public filter(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): Collection<K, V>;
public find(fn: (value: V, key: K, collection: Collection<K, V>) => boolean): V;
public findKey(fn: (value: V, key: K, collection: Collection<K, V>) => boolean): K;
public first(): V | undefined;
public first(count: number): V[];
public firstKey(): K | undefined;
public firstKey(count: number): K[];
public keyArray(): K[];
public last(): V | undefined;
public last(count: number): V[];
public lastKey(): K | undefined;
public lastKey(count: number): K[];
public map<T>(fn: (value: V, key: K, collection: Collection<K, V>) => T, thisArg?: any): T[];
public partition(fn: (value: V, key: K, collection: Collection<K, V>) => boolean): [Collection<K, V>, Collection<K, V>]
public random(): V | undefined;
public random(count: number): V[];
public randomKey(): K | undefined;
public randomKey(count: number): K[];
public reduce<T>(fn: (accumulator: any, value: V, key: K, collection: Collection<K, V>) => T, initialValue?: any): T;
public some(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): boolean;
public sort(compareFunction?: (a: V, b: V, c?: K, d?: K) => number): Collection<K, V>;
public sweep(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): number;
public tap(fn: (collection: Collection<K, V>) => void, thisArg?: any): Collection<K, V>;
public toJSON(): object;
}
export abstract class Collector<K, V> extends EventEmitter {
constructor(client: Client, filter: CollectorFilter, options?: CollectorOptions);
private _timeout: NodeJS.Timer;
public readonly client: Client;
public collected: Collection<K, V>;
public ended: boolean;
public filter: CollectorFilter;
public readonly next: Promise<V>;
public options: CollectorOptions;
public checkEnd(): void;
public handleCollect(...args: any[]): void;
public handleDispose(...args: any[]): void;
public stop(reason?: string): void;
public toJSON(): object;
protected listener: Function;
public abstract collect(...args: any[]): K;
public abstract dispose(...args: any[]): K;
public abstract endReason(): void;
public on(event: 'collect', listener: (...args: any[]) => void): this;
public on(event: 'dispose', listener: (...args: any[]) => void): this;
public on(event: 'end', listener: (collected: Collection<K, V>, reason: string) => void): this;
public once(event: 'collect', listener: (...args: any[]) => void): this;
public once(event: 'dispose', listener: (...args: any[]) => void): this;
public once(event: 'end', listener: (collected: Collection<K, V>, reason: string) => void): this;
}
export class DataResolver {
public static resolveBase64(data: Base64Resolvable): string;
public static resolveFile(resource: BufferResolvable | Stream): Promise<Buffer>;
public static resolveImage(resource: BufferResolvable | Base64Resolvable): Promise<string>;
public static resolveInviteCode(data: InviteResolvable): string;
}
export class DiscordAPIError extends Error {
constructor(path: string, error: object);
private static flattenErrors(obj: object, key: string): string[];
public code: number;
public method: string;
public path: string;
}
export class DMChannel extends TextBasedChannel(Channel) {
constructor(client: Client, data: object);
public messages: MessageStore;
public recipient: User;
}
export class Emoji extends Base {
constructor(client: Client, emoji: object);
public animated: boolean;
public readonly deletable: boolean;
public id: Snowflake;
public name: string;
public readonly identifier: string;
public readonly url: string;
public toJSON(): object;
public toString(): string;
}
export class GroupDMChannel extends TextBasedChannel(Channel) {
constructor(client: Client, data: object);
public applicationID: Snowflake;
public icon: string;
public managed: boolean;
public messages: MessageStore;
public name: string;
public nicks: Collection<Snowflake, string>;
public readonly owner: User;
public ownerID: Snowflake;
public recipients: Collection<Snowflake, User>;
public addUser(options: { user: UserResolvable, accessToken?: string, nick?: string }): Promise<GroupDMChannel>
public edit (data: { icon?: string, name?: string }): Promise<GroupDMChannel>;
public equals(channel: GroupDMChannel): boolean;
public iconURL(options?: AvatarOptions): string;
public removeUser(user: UserResolvable): Promise<GroupDMChannel>;
public setIcon(icon: Base64Resolvable | BufferResolvable): Promise<GroupDMChannel>;
public setName(name: string): Promise<GroupDMChannel>;
}
export class Guild extends Base {
constructor(client: Client, data: object);
private _sortedRoles(): Collection<Snowflake, Role>;
private _sortedChannels(channel: Channel): Collection<Snowflake, GuildChannel>;
private _memberSpeakUpdate(user: Snowflake, speaking: boolean): void;
protected setup(data: any): void;
public readonly afkChannel: VoiceChannel;
public afkChannelID: Snowflake;
public afkTimeout: number;
public applicationID: Snowflake;
public available: boolean;
public channels: GuildChannelStore;
public readonly createdAt: Date;
public readonly createdTimestamp: number;
public defaultMessageNotifications: DefaultMessageNotifications | number;
public deleted: boolean;
public embedEnabled: boolean;
public emojis: GuildEmojiStore;
public explicitContentFilter: number;
public features: GuildFeatures[];
public icon: string;
public id: Snowflake;
public readonly joinedAt: Date;
public joinedTimestamp: number;
public large: boolean;
public readonly me: GuildMember;
public memberCount: number;
public members: GuildMemberStore;
public readonly messageNotifications: MessageNotifications;
public mfaLevel: number;
public readonly mobilePush: boolean;
public readonly muted: boolean;
public name: string;
public readonly nameAcronym: string;
public readonly owner: GuildMember;
public ownerID: Snowflake;
public readonly position: number;
public presences: PresenceStore;
public region: string;
public roles: RoleStore;
public splash: string;
public readonly suppressEveryone: boolean;
public readonly systemChannel: TextChannel;
public systemChannelID: Snowflake;
public verificationLevel: number;
public readonly verified: boolean;
public readonly voiceConnection: VoiceConnection;
public acknowledge(): Promise<Guild>;
public addMember(user: UserResolvable, options: AddGuildMemberOptions): Promise<GuildMember>;
public allowDMs(allow: boolean): Promise<Guild>;
public delete(): Promise<Guild>;
public edit(data: GuildEditData, reason?: string): Promise<Guild>;
public equals(guild: Guild): boolean;
public fetchAuditLogs(options?: GuildAuditLogsFetchOptions): Promise<GuildAuditLogs>;
public fetchBans(): Promise<Collection<Snowflake, { user: User, reason: string }>>;
public fetchInvites(): Promise<Collection<string, Invite>>;
public fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>;
public fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
public iconURL(options?: AvatarOptions): string;
public leave(): Promise<Guild>;
public member(user: UserResolvable): GuildMember;
public search(options?: MessageSearchOptions): Promise<MessageSearchResult>;
public setAFKChannel(afkChannel: ChannelResolvable, reason?: string): Promise<Guild>;
public setAFKTimeout(afkTimeout: number, reason?: string): Promise<Guild>;
public setChannelPositions(channelPositions: ChannelPosition[]): Promise<Guild>;
public setDefaultMessageNotifications(defaultMessageNotifications: DefaultMessageNotifications | number, reason?: string): Promise<Guild>;
public setExplicitContentFilter(explicitContentFilter: number, reason?: string): Promise<Guild>;
public setIcon(icon: Base64Resolvable, reason?: string): Promise<Guild>;
public setName(name: string, reason?: string): Promise<Guild>;
public setOwner(owner: GuildMemberResolvable, reason?: string): Promise<Guild>;
public setPosition(position: number, relative?: boolean): Promise<Guild>;
public setRegion(region: string, reason?: string): Promise<Guild>;
public setSplash(splash: Base64Resolvable, reason?: string): Promise<Guild>;
public setSystemChannel(systemChannel: ChannelResolvable, reason?: string): Promise<Guild>;
public setVerificationLevel(verificationLevel: number, reason?: string): Promise<Guild>;
public splashURL(options?: AvatarOptions): string;
public sync(): void;
public toJSON(): object;
public toString(): string;
}
export class GuildAuditLogs {
constructor(guild: Guild, data: object);
private webhooks: Collection<Snowflake, Webhook>;
public entries: Collection<Snowflake, GuildAuditLogsEntry>;
public static Actions: GuildAuditLogsActions;
public static Targets: GuildAuditLogsTargets;
public static Entry: typeof GuildAuditLogsEntry;
public static actionType(action: number): GuildAuditLogsActionType;
public static build(...args: any[]): Promise<GuildAuditLogs>;
public static targetType(target: number): GuildAuditLogsTarget;
public toJSON(): object;
}
class GuildAuditLogsEntry {
constructor(guild: Guild, data: object);
public action: GuildAuditLogsAction;
public actionType: GuildAuditLogsActionType;
public changes: AuditLogChange[];
public readonly createdAt: Date;
public readonly createdTimestamp: number;
public executor: User;
public extra: object | Role | GuildMember;
public id: Snowflake;
public reason: string;
public target: Guild | User | Role | GuildEmoji | Invite | Webhook;
public targetType: GuildAuditLogsTarget;
public toJSON(): object;
}
export class GuildChannel extends Channel {
constructor(guild: Guild, data: object);
private memberPermissions(member: GuildMember): Permissions;
private rolePermissions(role: Role): Permissions;
public readonly calculatedPosition: number;
public readonly deletable: boolean;
public guild: Guild;
public readonly messageNotifications: GuildChannelMessageNotifications;
public readonly manageable: boolean;
public readonly muted: boolean;
public name: string;
public readonly parent: CategoryChannel;
public parentID: Snowflake;
public permissionOverwrites: Collection<Snowflake, PermissionOverwrites>;
public readonly permissionsLocked: boolean;
public readonly position: number;
public rawPosition: number;
public clone(options?: GuildChannelCloneOptions): Promise<GuildChannel>;
public createInvite(options?: InviteOptions): Promise<Invite>;
public edit(data: ChannelData, reason?: string): Promise<GuildChannel>;
public equals(channel: GuildChannel): boolean;
public fetchInvites(): Promise<Collection<string, Invite>>;
public lockPermissions(): Promise<GuildChannel>;
public overwritePermissions(
options: Array<Partial<PermissionOverwrites|PermissionOverwriteOptions>> | Collection<Snowflake, Partial<PermissionOverwriteOptions>>,
reason?: string
): Promise<GuildChannel>;
public permissionsFor(memberOrRole: GuildMemberResolvable | RoleResolvable): Permissions;
public setName(name: string, reason?: string): Promise<GuildChannel>;
public setParent(channel: GuildChannel | Snowflake, options?: { lockPermissions?: boolean, reason?: string }): Promise<GuildChannel>;
public setPosition(position: number, options?: { relative?: boolean, reason?: string }): Promise<GuildChannel>;
public setTopic(topic: string, reason?: string): Promise<GuildChannel>;
public updateOverwrite(userOrRole: RoleResolvable | UserResolvable, options: Partial<PermissionObject>, reason?: string): Promise<GuildChannel>;
}
export class GuildEmoji extends Emoji {
constructor(client: Client, data: object, guild: Guild);
private _roles: string[];
public readonly createdAt: Date;
public readonly createdTimestamp: number;
public deleted: boolean;
public guild: Guild;
public managed: boolean;
public requiresColons: boolean;
public roles: GuildEmojiRoleStore;
public delete(reason?: string): Promise<GuildEmoji>;
public edit(data: GuildEmojiEditData, reason?: string): Promise<GuildEmoji>;
public equals(other: GuildEmoji | object): boolean;
public setName(name: string, reason?: string): Promise<GuildEmoji>;
}
export class GuildMember extends PartialTextBasedChannel(Base) {
constructor(client: Client, data: object, guild: Guild);
public readonly bannable: boolean;
public readonly deaf: boolean;
public deleted: boolean;
public readonly displayColor: number;
public readonly displayHexColor: string;
public readonly displayName: string;
public guild: Guild;
public readonly id: Snowflake;
public readonly joinedAt: Date;
public joinedTimestamp: number;
public readonly kickable: boolean;
public readonly manageable: boolean;
public readonly mute: boolean;
public nickname: string;
public readonly permissions: Permissions;
public readonly presence: Presence;
public roles: GuildMemberRoleStore;
public readonly selfDeaf: boolean;
public readonly selfMute: boolean;
public readonly serverDeaf: boolean;
public readonly serverMute: boolean;
public readonly speaking: boolean;
public user: User;
public readonly voiceChannel: VoiceChannel;
public readonly voiceChannelID: Snowflake;
public readonly voiceSessionID: string;
public ban(options?: BanOptions): Promise<GuildMember>;
public createDM(): Promise<DMChannel>;
public deleteDM(): Promise<DMChannel>;
public edit(data: GuildMemberEditData, reason?: string): Promise<GuildMember>;
public hasPermission(permission: PermissionResolvable, options?: { checkAdmin?: boolean; checkOwner?: boolean }): boolean;
public kick(reason?: string): Promise<GuildMember>;
public missingPermissions(permissions: PermissionResolvable, explicit?: boolean): PermissionString[];
public permissionsIn(channel: ChannelResolvable): Permissions;
public setDeaf(deaf: boolean, reason?: string): Promise<GuildMember>;
public setMute(mute: boolean, reason?: string): Promise<GuildMember>;
public setNickname(nickname: string, reason?: string): Promise<GuildMember>;
public setVoiceChannel(voiceChannel: ChannelResolvable): Promise<GuildMember>;
public toJSON(): object;
public toString(): string;
}
export class Invite extends Base {
constructor(client: Client, data: object);
public channel: GuildChannel | GroupDMChannel;
public code: string;
public readonly createdAt: Date;
public createdTimestamp: number;
public readonly expiresAt: Date;
public readonly expiresTimestamp: number;
public guild: Guild;
public inviter: User;
public maxAge: number;
public maxUses: number;
public memberCount: number;
public presenceCount: number;
public temporary: boolean;
public textChannelCount: number;
public readonly url: string;
public uses: number;
public voiceChannelCount: number;
public delete(reason?: string): Promise<Invite>;
public toJSON(): object;
public toString(): string;
}
export class Message extends Base {
constructor(client: Client, data: object, channel: TextChannel | DMChannel | GroupDMChannel);
private _edits: Message[];
private patch(data: object): void;
public activity: GroupActivity;
public application: ClientApplication;
public attachments: Collection<Snowflake, MessageAttachment>;
public author: User;
public channel: TextChannel | DMChannel | GroupDMChannel;
public readonly cleanContent: string;
public content: string;
public readonly createdAt: Date;
public createdTimestamp: number;
public readonly deletable: boolean;
public deleted: boolean;
public readonly editable: boolean;
public readonly editedAt: Date;
public editedTimestamp: number;
public readonly edits: Message[];
public embeds: MessageEmbed[];
public readonly guild: Guild;
public hit: boolean;
public id: Snowflake;
public member: GuildMember;
public mentions: MessageMentions;
public nonce: string;
public readonly pinnable: boolean;
public pinned: boolean;
public reactions: ReactionStore;
public system: boolean;
public tts: boolean;
public type: MessageType;
public webhookID: Snowflake;
public acknowledge(): Promise<Message>;
public awaitReactions(filter: CollectorFilter, options?: AwaitReactionsOptions): Promise<Collection<Snowflake, MessageReaction>>;
public createReactionCollector(filter: CollectorFilter, options?: ReactionCollectorOptions): ReactionCollector;
public delete(options?: { timeout?: number, reason?: string }): Promise<Message>;
public edit(content: StringResolvable, options?: MessageEditOptions | MessageEmbed): Promise<Message>;
public equals(message: Message, rawData: object): boolean;
public fetchWebhook(): Promise<Webhook>;
public pin(): Promise<Message>;
public react(emoji: EmojiIdentifierResolvable): Promise<MessageReaction>;
public reply(content?: StringResolvable, options?: MessageOptions): Promise<Message | Message[]>;
public reply(options?: MessageOptions): Promise<Message | Message[]>;
public toJSON(): object;
public toString(): string;
public unpin(): Promise<Message>;
}
export class MessageAttachment {
constructor(file: BufferResolvable | Stream, name?: string);
private _attach(file: BufferResolvable | Stream, name: string): void;
public readonly attachment: BufferResolvable | Stream;
public height: number;
public id: Snowflake;
public readonly name: string;
public proxyURL: string;
public url: string;
public width: number;
public setAttachment(file: BufferResolvable | Stream, name: string): this;
public setFile(attachment: BufferResolvable | Stream): this;
public setName(name: string): this;
public toJSON(): object;
}
export class MessageCollector extends Collector<Snowflake, Message> {
constructor(channel: TextChannel | DMChannel | GroupDMChannel, filter: CollectorFilter, options?: MessageCollectorOptions);
public channel: Channel;
public options: MessageCollectorOptions;
public received: number;
public collect(message: Message): Snowflake;
public dispose(message: Message): Snowflake;
public endReason(): string;
}
export class MessageEmbed {
constructor(data?: MessageEmbed | MessageEmbedOptions);
private _apiTransform(): MessageEmbedOptions;
public author: { name?: string; url?: string; iconURL?: string; proxyIconURL?: string };
public color: number;
public readonly createdAt: Date;
public description: string;
public fields: { name: string; value: string; inline?: boolean; }[];
public files: (MessageAttachment | string | FileOptions)[];
public footer: { text?: string; iconURL?: string; proxyIconURL?: string };
public readonly hexColor: string;
public image: { url: string; proxyURL?: string; height?: number; width?: number; };
public provider: { name: string; url: string; };
public thumbnail: { url: string; proxyURL?: string; height?: number; width?: number; };
public timestamp: number;
public title: string;
public type: string;
public url: string;
public readonly video: { url?: string; height?: number; width?: number };
public addBlankField(inline?: boolean): this;
public addField(name: StringResolvable, value: StringResolvable, inline?: boolean): this;
public attachFiles(file: (MessageAttachment | FileOptions | string)[]): this;
public setAuthor(name: StringResolvable, iconURL?: string, url?: string): this;
public setColor(color: ColorResolvable): this;
public setDescription(description: StringResolvable): this;
public setFooter(text: StringResolvable, iconURL?: string): this;
public setImage(url: string): this;
public setThumbnail(url: string): this;
public setTimestamp(timestamp?: Date): this;
public setTitle(title: StringResolvable): this;
public setURL(url: string): this;
public toJSON(): object;
}
export class MessageMentions {
constructor(message: Message, users: any[], roles: any[], everyone: boolean);
private _channels: Collection<Snowflake, GuildChannel>;
private readonly _content: Message;
private _members: Collection<Snowflake, GuildMember>;
public readonly channels: Collection<Snowflake, TextChannel>;
public readonly client: Client;
public everyone: boolean;
public readonly guild: Guild;
public has(data: User | GuildMember | Role | GuildChannel, options?: {
ignoreDirect?: boolean;
ignoreRoles?: boolean;
ignoreEveryone?: boolean;
}): boolean;
public readonly members: Collection<Snowflake, GuildMember>;
public roles: Collection<Snowflake, Role>;
public users: Collection<Snowflake, User>;
public toJSON(): object;
public static CHANNELS_PATTERN: RegExp;
public static EVERYONE_PATTERN: RegExp;
public static ROLES_PATTERN: RegExp;
public static USERS_PATTERN: RegExp;
}
export class MessageReaction {
constructor(client: Client, data: object, message: Message);
private _emoji: GuildEmoji | ReactionEmoji;
public count: number;
public readonly emoji: GuildEmoji | ReactionEmoji;
public me: boolean;
public message: Message;
public users: ReactionUserStore;
public toJSON(): object;
}
export class PermissionOverwrites {
constructor(guildChannel: GuildChannel, data: object);
public allowed: Permissions;
public readonly channel: GuildChannel;
public denied: Permissions;
public id: Snowflake;
public type: OverwriteType;
public delete(reason?: string): Promise<PermissionOverwrites>;
public toJSON(): object;
}
export class Permissions {
constructor(permissions: PermissionResolvable);
public bitfield: number;
public add(...permissions: PermissionResolvable[]): this;
public freeze(): this;
public has(permission: PermissionResolvable, checkAdmin?: boolean): boolean;
public missing(permissions: PermissionResolvable, checkAdmin?: boolean): PermissionString[];
public remove(...permissions: PermissionResolvable[]): this;
public serialize(checkAdmin?: boolean): PermissionObject;
public toArray(checkAdmin?: boolean): PermissionString[];
public toJSON(): object;
public valueOf(): number;
public [Symbol.iterator](): IterableIterator<PermissionString>;
public static ALL: number;
public static DEFAULT: number;
public static FLAGS: PermissionFlags;
public static resolve(permission: PermissionResolvable): number;
}
export class Presence {
constructor(client: Client, data: object);
public activity: Activity;
public status: 'online' | 'offline' | 'idle' | 'dnd';
public equals(presence: Presence): boolean;
}
export class ReactionCollector extends Collector<Snowflake, MessageReaction> {
constructor(message: Message, filter: CollectorFilter, options?: ReactionCollectorOptions);
public message: Message;
public options: ReactionCollectorOptions;
public total: number;
public users: Collection<Snowflake, User>;
public static key(reaction: MessageReaction): Snowflake | string;
public collect(reaction: MessageReaction): Snowflake | string;
public dispose(reaction: MessageReaction, user: User): Snowflake | string;
public empty(): void;
public endReason(): string;
public on(event: 'collect', listener: (reaction: MessageReaction, user: User) => void): this;
public on(event: 'dispose', listener: (reaction: MessageReaction, user: User) => void): this;
public on(event: 'end', listener: (collected: Collection<Snowflake, MessageReaction>, reason: string) => void): this;
public on(event: 'remove', listener: (reaction: MessageReaction, user: User) => void): this;
public on(event: string, listener: Function): this;
public once(event: 'collect', listener: (reaction: MessageReaction, user: User) => void): this;
public once(event: 'dispose', listener: (reaction: MessageReaction, user: User) => void): this;
public once(event: 'end', listener: (collected: Collection<Snowflake, MessageReaction>, reason: string) => void): this;
public once(event: 'remove', listener: (reaction: MessageReaction, user: User) => void): this;
public once(event: string, listener: Function): this;
}
export class ReactionEmoji extends Emoji {
constructor(reaction: MessageReaction, emoji: object);
public reaction: MessageReaction;
public toJSON(): object;
}
export class RichPresenceAssets {
constructor(activity: Activity, assets: object);
public largeImage: Snowflake;
public largeText: string;
public smallImage: Snowflake;
public smallText: string;
public largeImageURL(options: AvatarOptions): string;
public smallImageURL(options: AvatarOptions): string;
}
export class Role extends Base {
constructor(client: Client, data: object, guild: Guild);
public color: number;
public readonly createdAt: Date;
public readonly createdTimestamp: number;
public deleted: boolean;
public readonly editable: boolean;
public guild: Guild;
public readonly hexColor: string;
public hoist: boolean;
public id: Snowflake;
public managed: boolean;
public readonly members: Collection<Snowflake, GuildMember>;
public mentionable: boolean;
public name: string;
public permissions: Permissions;
public readonly position: number;
public rawPosition: number;
public comparePositionTo(role: Role): number;
public delete(reason?: string): Promise<Role>;
public edit(data: RoleData, reason?: string): Promise<Role>;
public equals(role: Role): boolean;
public permissionsIn(channel: ChannelResolvable): Permissions;
public setColor(color: ColorResolvable, reason?: string): Promise<Role>;
public setHoist(hoist: boolean, reason?: string): Promise<Role>;
public setMentionable(mentionable: boolean, reason?: string): Promise<Role>;
public setName(name: string, reason?: string): Promise<Role>;
public setPermissions(permissions: PermissionResolvable, reason?: string): Promise<Role>;
public setPosition(position: number, options?: { relative?: boolean; reason?: string }): Promise<Role>;
public toJSON(): object;
public toString(): string;
public static comparePositions(role1: Role, role2: Role): number;
}
export class Shard extends EventEmitter {
constructor(manager: ShardingManager, id: number, args?: string[]);
private _evals: Map<string, Promise<any>>;
private _exitListener: Function;
private _fetches: Map<string, Promise<any>>;
private _handleExit(respawn?: boolean): void;
private _handleMessage(message: any): void;
public args: string[];
public execArgv: string[];
public env: object;
public id: number;
public manager: ShardingManager;
public process: ChildProcess;
public ready: boolean;
public eval(script: string): Promise<any>;
public eval<T>(fn: (client: Client) => T): Promise<T[]>;
public fetchClientValue(prop: string): Promise<any>;
public kill(): void;
public respawn(delay?: number, waitForReady?: boolean): Promise<ChildProcess>;
public send(message: any): Promise<Shard>;
public spawn(waitForReady?: boolean): Promise<ChildProcess>;
public on(event: 'death', listener: (child: ChildProcess) => void): this;
public on(event: 'disconnect' | 'ready' | 'reconnecting', listener: () => void): this;
public on(event: 'error', listener: (error: Error) => void): this;
public on(event: 'message', listener: (message: any) => void): this;
public on(event: 'spawn', listener: (child: ChildProcess) => void): this;
public on(event: string, listener: Function): this;
public once(event: 'death', listener: (child: ChildProcess) => void): this;
public once(event: 'disconnect' | 'ready' | 'reconnecting', listener: () => void): this;
public once(event: 'error', listener: (error: Error) => void): this;
public once(event: 'message', listener: (message: any) => void): this;
public once(event: 'spawn', listener: (child: ChildProcess) => void): this;
public once(event: string, listener: Function): this;
}
export class ShardClientUtil {
constructor(client: Client);
private _handleMessage(message: any): void;
private _respond(type: string, message: any): void;
public readonly count: number;
public readonly id: number;
public broadcastEval(script: string): Promise<any[]>;
public broadcastEval<T>(fn: (client: Client) => T): Promise<T[]>;
public fetchClientValues(prop: string): Promise<any[]>;
public respawnAll(shardDelay?: number, respawnDelay?: number, waitForReady?: boolean): Promise<void>;
public send(message: any): Promise<void>;
public static singleton(client: Client): ShardClientUtil;
}
export class ShardingManager extends EventEmitter {
constructor(file: string, options?: {
totalShards?: number | 'auto';
respawn?: boolean;
shardArgs?: string[];
token?: string;
execArgv?: string[];
});
public file: string;
public respawn: boolean;
public shardArgs: string[];
public shards: Collection<number, Shard>;
public token: string;
public totalShards: number | 'auto';
public broadcast(message: any): Promise<Shard[]>;
public broadcastEval(script: string): Promise<any[]>;
public createShard(id: number): Shard;
public fetchClientValues(prop: string): Promise<any[]>;
public respawnAll(shardDelay?: number, respawnDelay?: number, waitForReady?: boolean): Promise<Collection<number, Shard>>;
public spawn(amount?: number | 'auto', delay?: number, waitForReady?: boolean): Promise<Collection<number, Shard>>;
public on(event: 'shardCreate', listener: (shard: Shard) => void): this;
public once(event: 'shardCreate', listener: (shard: Shard) => void): this;
}
export class SnowflakeUtil {
public static deconstruct(snowflake: Snowflake): DeconstructedSnowflake;
public static generate(): Snowflake;
}