· 8 years ago · Aug 13, 2017, 09:10 PM
1declare module 'discord.js' {
2 import { EventEmitter } from 'events';
3 import { Readable as ReadableStream } from 'stream';
4 import { ChildProcess } from 'child_process';
5
6 export const version: string;
7
8//#region Classes
9
10 class AudioPlayer extends EventEmitter {
11 constructor(voiceConnection: VoiceConnection);
12 public readonly dispatcher: StreamDispatcher;
13 public opusEncoder: object;
14 public prism: object;
15 public readonly transcoder: object;
16 public voiceConnection: VoiceConnection;
17 public setBitrate(value: number | 'auto'): void;
18 }
19
20 class BaseOpus {
21 constructor(options?: { bitrate?: number, fec?: boolean, plp?: number });
22 public bitrate: number;
23 public options: object;
24 }
25
26 export class Channel {
27 constructor(client: Client, data: object);
28 public readonly client: Client;
29 public readonly createdAt: Date;
30 public readonly createdTimestamp: number;
31 public id: Snowflake;
32 public type: 'dm' | 'group' | 'text' | 'voice';
33 public delete(): Promise<Channel>;
34 }
35
36 export class Client extends EventEmitter {
37 constructor(options?: ClientOptions);
38 private _intervals: NodeJS.Timer;
39 private _pingTimestamp: number;
40 private _timeouts: NodeJS.Timer;
41 private dataManager: object;
42 private manager: ClientManager;
43 private resolver: ClientDataResolver;
44 private rest: object;
45 private voice: ClientVoiceManager;
46 private ws: object;
47 private _eval(script: string): any;
48 private _pong(startTime: number): void;
49 private _setPresence(id: Snowflake, presence: object): void;
50 private _validateOptions(options?: ClientOptions): void;
51
52 public broadcasts: VoiceBroadcast[];
53 public readonly browser: boolean;
54 public channels: Collection<Snowflake, Channel>;
55 public readonly emojis: Collection<Snowflake, Emoji>;
56 public guilds: Collection<Snowflake, Guild>;
57 public options: ClientOptions;
58 public readonly ping: number;
59 public pings: number[];
60 public presences: Collection<Snowflake, Presence>;
61 public readyAt: Date;
62 public readonly readyTimestamp: number;
63 public shard?: ShardClientUtil;
64 public readonly status: number;
65 public token: string;
66 public readonly uptime: number;
67 public user: ClientUser;
68 public users: Collection<Snowflake, User>;
69 public readonly voiceConnections: Collection<Snowflake, VoiceConnection>;
70 public clearInterval(interval: NodeJS.Timer): void;
71 public clearTimeout(timeout: NodeJS.Timer): void;
72 public createVoiceBroadcast(): VoiceBroadcast;
73 public destroy(): Promise<void>;
74 public fetchApplication(id?: Snowflake): Promise<ClientOAuth2Application>;
75 public fetchInvite(invite: InviteResolvable): Promise<Invite>;
76 public fetchUser(id: Snowflake, cache?: boolean): Promise<User>;
77 public fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>;
78 public fetchWebhook(id: Snowflake, token?: string): Promise<Webhook>;
79 public generateInvite(permissions?: PermissionResolvable[] | number): Promise<string>;
80 public login(token: string): Promise<string>;
81 public setInterval(fn: Function, delay: number, ...args: any[]): NodeJS.Timer;
82 public setTimeout(fn: Function, delay: number, ...args: any[]): NodeJS.Timer;
83 public sweepMessages(lifetime?: number): number;
84 public syncGuilds(guilds?: Guild[] | Collection<Snowflake, Guild>): void;
85
86 public on(event: string, listener: Function): this;
87 public on(event: 'channelCreate', listener: (channel: Channel) => void): this;
88 public on(event: 'channelDelete', listener: (channel: Channel) => void): this;
89 public on(event: 'channelPinsUpdate', listener: (channel: Channel, time: Date) => void): this;
90 public on(event: 'channelUpdate', listener: (oldChannel: Channel, newChannel: Channel) => void): this;
91 public on(event: 'clientUserSettingsUpdate', listener: (clientUserSettings: ClientUserSettings) => void): this;
92 public on(event: 'debug', listener: (info: string) => void): this;
93 public on(event: 'disconnect', listener: (event: any) => void): this;
94 public on(event: 'emojiCreate', listener: (emoji: Emoji) => void): this;
95 public on(event: 'emojiDelete', listener: (emoji: Emoji) => void): this;
96 public on(event: 'emojiUpdate', listener: (oldEmoji: Emoji, newEmoji: Emoji) => void): this;
97 public on(event: 'error', listener: (error: Error) => void): this;
98 public on(event: 'guildBanAdd', listener: (guild: Guild, user: User) => void): this;
99 public on(event: 'guildBanRemove', listener: (guild: Guild, user: User) => void): this;
100 public on(event: 'guildCreate', listener: (guild: Guild) => void): this;
101 public on(event: 'guildDelete', listener: (guild: Guild) => void): this;
102 public on(event: 'guildMemberAdd', listener: (member: GuildMember) => void): this;
103 public on(event: 'guildMemberAvailable', listener: (member: GuildMember) => void): this;
104 public on(event: 'guildMemberRemove', listener: (member: GuildMember) => void): this;
105 public on(event: 'guildMembersChunk', listener: (members: GuildMember[], guild: Guild) => void): this;
106 public on(event: 'guildMemberSpeaking', listener: (member: GuildMember, speaking: boolean) => void): this;
107 public on(event: 'guildMemberUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this;
108 public on(event: 'guildUnavailable', listener: (guild: Guild) => void): this;
109 public on(event: 'guildUpdate', listener: (oldGuild: Guild, newGuild: Guild) => void): this;
110 public on(event: 'message', listener: (message: Message) => void): this;
111 public on(event: 'messageDelete', listener: (message: Message) => void): this;
112 public on(event: 'messageDeleteBulk', listener: (messages: Collection<Snowflake, Message>) => void): this;
113 public on(event: 'messageReactionAdd', listener: (messageReaction: MessageReaction, user: User) => void): this;
114 public on(event: 'messageReactionRemove', listener: (messageReaction: MessageReaction, user: User) => void): this;
115 public on(event: 'messageReactionRemoveAll', listener: (message: Message) => void): this;
116 public on(event: 'messageUpdate', listener: (oldMessage: Message, newMessage: Message) => void): this;
117 public on(event: 'presenceUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this;
118 public on(event: 'ready', listener: () => void): this;
119 public on(event: 'reconnecting', listener: () => void): this;
120 public on(event: 'roleCreate', listener: (role: Role) => void): this;
121 public on(event: 'roleDelete', listener: (role: Role) => void): this;
122 public on(event: 'roleUpdate', listener: (oldRole: Role, newRole: Role) => void): this;
123 public on(event: 'typingStart', listener: (channel: Channel, user: User) => void): this;
124 public on(event: 'typingStop', listener: (channel: Channel, user: User) => void): this;
125 public on(event: 'userNoteUpdate', listener: (user: UserResolvable, oldNote: string, newNote: string) => void): this;
126 public on(event: 'userUpdate', listener: (oldUser: User, newUser: User) => void): this;
127 public on(event: 'voiceStateUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this;
128 public on(event: 'warn', listener: (info: string) => void): this;
129 }
130
131 class ClientDataResolver {
132 constructor(client: Client);
133 public resolveBase64(data: Base64Resolvable): string;
134 public resolveBuffer(resource: BufferResolvable): Promise<Buffer>;
135 public resolveChannel(channel: ChannelResolvable): Channel;
136 public resolveChannelID(channel: ChannelResolvable): Snowflake;
137 public resolveColor(color: ColorResolvable): number;
138 public resolveEmojiIdentifier(emoji: EmojiIdentifierResolvable): string;
139 public resolveGuild(guild: GuildResolvable): Guild;
140 public resolveGuildMember(guild: GuildResolvable, user: UserResolvable): GuildMember;
141 public resolveInviteCode(data: InviteResolvable): string;
142 public resolveString(data: StringResolvable): string;
143 public resolveUser(user: UserResolvable): User;
144 public resolveUserID(user: UserResolvable): Snowflake;
145
146 public static resolveColor(color: ColorResolvable): number;
147 }
148
149 class ClientManager {
150 constructor(client: Client);
151 public client: Client;
152 public heartbeatInterval: number;
153 public connectToWebSocket(token: string, resolve: Function, reject: Function): void;
154 public setupKeepAlive(time: number): void;
155 }
156
157 export class ClientOAuth2Application extends OAuth2Application {
158 public flags: number;
159 public owner: User;
160 }
161
162 export class ClientUser extends User {
163 public blocked: Collection<Snowflake, User>;
164 public email: string;
165 public friends: Collection<Snowflake, User>;
166 public mfaEnabled?: boolean;
167 public mobile?: boolean;
168 public note?: string;
169 public notes?: Collection<Snowflake, string>;
170 public premium?: boolean;
171 public settings?: ClientUserSettings;
172 public verified: boolean;
173 public acceptInvite(invite: Invite | string): Promise<Guild>
174 public addFriend(user?: UserResolvable): Promise<User>;
175 public createGroupDM(recipients: GroupDMRecipientOptions[]): Promise<GroupDMChannel>;
176 public createGuild(name: string, region: string, icon?: BufferResolvable | Base64Resolvable): Promise<Guild>;
177 public fetchMentions(options?: { limit?: number; roles?: boolean, everyone?: boolean; guild?: Guild | Snowflake }): Promise<Message[]>;
178 public removeFriend(user?: UserResolvable): Promise<User>;
179 public setAFK(afk: boolean): Promise<ClientUser>;
180 public setAvatar(avatar: BufferResolvable | Base64Resolvable): Promise<ClientUser>;
181 public setEmail(email: string, password: string): Promise<ClientUser>;
182 public setGame(game: string, streamingURL?: string): Promise<ClientUser>;
183 public setNote(note: string): Promise<User>;
184 public setPassword(newPassword: string, oldPassword: string): Promise<ClientUser>;
185 public setPresence(data: PresenceData): Promise<ClientUser>;
186 public setStatus(status: PresenceStatus): Promise<ClientUser>;
187 public setUsername(username: string, password?: string): Promise<ClientUser>;
188 }
189
190 export class ClientUserSettings {
191 constructor(user: User, data: object);
192 public convertEmoticons: boolean;
193 public defaultGuildsRestricted: boolean;
194 public detectPlatformAccounts: boolean;
195 public developerMode: boolean;
196 public enableTTSCommand: boolean;
197 public explicitContentFilter: 'DISABLED' | 'NON_FRIENDS' | 'FRIENDS_AND_NON_FRIENDS' | string;
198 public friendsSources: { all: boolean, mutualGuilds: boolean, mutualFriends: boolean };
199 public guildsPositions: Snowflake[];
200 public inlineAttachmentMedia: boolean;
201 public inlineEmbedMedia: boolean;
202 public locale: string;
203 public messageDisplayCompact: boolean;
204 public renderReactions: boolean;
205 public restrictedGuilds: boolean;
206 public showCurrentGame: boolean;
207 public status: PresenceStatus;
208 public theme: string;
209 public addRestrictedGuild(guild: Guild): Promise<Guild>;
210 public patch(data: object): void;
211 public removeRestrictedGuild(guild: Guild): Promise<Guild>;
212 public setGuildPosition(guild: Guild, position: number, relative?: boolean): Promise<Guild>;
213 public update(name: string, value: any): Promise<object>;
214 }
215
216 class ClientVoiceManager {
217 constructor(client: Client);
218 public client: Client;
219 public connections: Collection<Snowflake, VoiceConnection>;
220 public joinChannel(channel: VoiceChannel): Promise<VoiceConnection>;
221 }
222
223 export class Collection<K, V> extends Map<K, V> {
224 private _array: V[];
225 private _keyArray: K[];
226
227 public array(): V[];
228 public clone(): Collection<K, V>;
229 public concat(...collections: Collection<K, V>[]): Collection<K, V>;
230 public deleteAll(): Promise<V>[];
231 public equals(collection: Collection<any, any>): boolean;
232 public every(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): boolean;
233 public exists(prop: keyof V, value: any): boolean;
234 public filter(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): Collection<K, V>;
235 public filterArray(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): V[];
236 public find(prop: keyof V, value: any): V;
237 public find(fn: (value: V, key: K, collection: Collection<K, V>) => boolean): V;
238 public findAll(prop: keyof V, value: any): V[];
239 public findKey(prop: keyof V, value: any): K;
240 public findKey(fn: (value: V, key: K, collection: Collection<K, V>) => boolean): K;
241 public first(): V;
242 public first(count: number): V[];
243 public firstKey(): K;
244 public firstKey(count: number): K[];
245 public keyArray(): K[];
246 public last(): V;
247 public last(count: number): V[];
248 public lastKey(): K;
249 public lastKey(count: number): K[];
250 public map<T>(fn: (value: V, key: K, collection: Collection<K, V>) => T, thisArg?: any): T[];
251 public random(): V;
252 public random(count: number): V[];
253 public randomKey(): K;
254 public randomKey(count: number): K[];
255 public reduce<T>(fn: (accumulator: any, value: V, key: K, collection: Collection<K, V>) => T, initialValue?: any): T;
256 public some(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): boolean;
257 public sort(compareFunction?: (a: V, b: V, c?: K, d?: K) => number): Collection<K, V>;
258 }
259
260 abstract class Collector<K, V> {
261 constructor(client: Client, filter: CollectorFilter, options?: CollectorOptions);
262 private _timeout: NodeJS.Timer;
263 private _handle(...args: any[]): void;
264
265 public readonly client: Client;
266 public collected: Collection<K, V>;
267 public ended: boolean;
268 public filter: CollectorFilter;
269 public readonly next: Promise<V>;
270 public options: CollectorOptions;
271 public stop(reason?: string): void;
272
273 protected listener: Function;
274 public abstract cleanup(): void;
275 public abstract handle(...args: any[]): CollectorHandler<K, V>;
276 public abstract postCheck(...args: any[]): string | null;
277
278 public on(event: 'collect', listener: (element: V, collector: Collector<K, V>) => void): this;
279 public on(event: 'end', listener: (collected: Collection<K, V>, reason: string) => void): string;
280 }
281
282 class DiscordAPIError extends Error {
283 constructor(error: object);
284 public code: number;
285
286 public static flattenErrors(obj: object, key: string): string[];
287 }
288
289 export class DMChannel extends TextBasedChannel(Channel) {
290 constructor(client: Client, data: object);
291 public lastMessageID: Snowflake;
292 public messages: Collection<Snowflake, Message>;
293 public recipient: User;
294 public toString(): string;
295 }
296
297 export class Emoji {
298 constructor(guild: Guild, data: object);
299 public readonly client: Client;
300 public readonly createdAt: Date;
301 public readonly createdTimestamp: number;
302 public guild: Guild;
303 public id: Snowflake;
304 public readonly identifier: string;
305 public managed: boolean;
306 public name: string;
307 public requiresColons: boolean;
308 public readonly roles: Collection<Snowflake, Role>;
309 public readonly url: string;
310 public edit(data: EmojiEditData): Promise<Emoji>;
311 public setName(name: string): Promise<Emoji>;
312 public addRestrictedRole(role: Role): Promise<Emoji>;
313 public addRestrictedRoles(roles: Role[]): Promise<Emoji>;
314 public removeRestrictedRole(role: Role): Promise<Emoji>;
315 public removeRestrictedRoles(roles: Role[]): Promise<Emoji>;
316 public equals(other: Emoji | object): boolean;
317 public toString(): string;
318 }
319
320 export class Game {
321 constructor(data: object);
322 public name: string;
323 public readonly streaming: boolean;
324 public type: number;
325 public url: string;
326 public equals(game: Game): boolean;
327 }
328
329 export class GroupDMChannel extends TextBasedChannel(Channel) {
330 constructor(client: Client, data: object);
331 public applicationID: string;
332 public icon: string;
333 public lastMessageID: string;
334 public managed: boolean;
335 public messages: Collection<Snowflake, Message>;
336 public name: string;
337 public nicks: Collection<Snowflake, string>;
338 public readonly owner: User;
339 public ownerID: string;
340 public recipients: Collection<Snowflake, User>;
341 public equals(channel: GroupDMChannel): boolean;
342 public toString(): string;
343 }
344
345 export class Guild {
346 constructor(client: Client, data: object);
347 private readonly _sortedRoles: Collection<Snowflake, Role>;
348 private _sortedChannels(type: string): Collection<Snowflake, GuildChannel>
349 private _sortPositionWithID(collection: Collection<any, any>): Collection<any, any>;
350
351 protected setup(data: any): void;
352
353 public afkChannelID: string;
354 public afkTimeout: number;
355 public applicationID: string;
356 public available: boolean;
357 public channels: Collection<Snowflake, GuildChannel>;
358 public readonly client: Client;
359 public readonly createdAt: Date;
360 public readonly createdTimestamp: number;
361 public readonly defaultChannel: TextChannel;
362 public readonly defaultRole: Role;
363 public embedEnabled: boolean;
364 public emojis: Collection<Snowflake, Emoji>;
365 public explicitContentFilter: number;
366 public features: object[];
367 public icon: string;
368 public readonly iconURL: string;
369 public id: Snowflake;
370 public readonly joinedAt: Date;
371 public joinedTimestamp: number;
372 public large: boolean;
373 public readonly me: GuildMember;
374 public memberCount: number;
375 public members: Collection<Snowflake, GuildMember>;
376 public name: string;
377 public readonly nameAcronym: string;
378 public readonly owner: GuildMember;
379 public ownerID: string;
380 public presences: Collection<Snowflake, Presence>;
381 public region: string;
382 public roles: Collection<Snowflake, Role>;
383 public splash: string;
384 public readonly splashURL: string;
385 public verificationLevel: number;
386 public readonly voiceConnection: VoiceConnection;
387 public acknowledge(): Promise<Guild>;
388 public addMember(user: UserResolvable, options: AddGuildMemberOptions): Promise<GuildMember>;
389 public allowDMs(allow: boolean): Promise<Guild>;
390 public ban(user: UserResolvable, options?: BanOptions | number | string): Promise<GuildMember | User | string>;
391 public createChannel(name: string, type: 'text' | 'voice', overwrites?: PermissionOverwrites[] | object[]): Promise<TextChannel | VoiceChannel>;
392 public createEmoji(attachment: BufferResolvable | Base64Resolvable, name: string, roles?: Collection<Snowflake, Role> | Role[]): Promise<Emoji>;
393 public createRole(data?: RoleData): Promise<Role>;
394 public delete(): Promise<Guild>;
395 public deleteEmoji(emoji: Emoji | string): Promise<void>;
396 public edit(data: GuildEditData): Promise<Guild>;
397 public equals(guild: Guild): boolean;
398 public fetchAuditLogs(options?: GuildAuditLogsFetchOptions): Promise<GuildAuditLogs>;
399 public fetchBans(): Promise<Collection<Snowflake, User>>;
400 public fetchInvites(): Promise<Collection<Snowflake, Invite>>;
401 public fetchMember(user: UserResolvable, cache?: boolean): Promise<GuildMember>;
402 public fetchMembers(query?: string, limit?: number): Promise<Guild>;
403 public fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>;
404 public fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
405 public leave(): Promise<Guild>;
406 public member(user: UserResolvable): GuildMember;
407 public pruneMembers(days: number, dry?: boolean): Promise<number>;
408 public search(options?: MessageSearchOptions): Promise<Message[][]>;
409 public setAFKChannel(afkChannel: ChannelResolvable): Promise<Guild>;
410 public setAFKTimeout(afkTimeout: number): Promise<Guild>;
411 public setChannelPosition(channel: string | GuildChannel, position: number, relative?: boolean): Promise<Guild>;
412 public setChannelPositions(channelPositions: ChannelPosition[]): Promise<Guild>;
413 public setExcplicitContentFilter(explicitContentFilter: number): Promise<Guild>;
414 public setIcon(icon: Base64Resolvable): Promise<Guild>;
415 public setName(name: string): Promise<Guild>;
416 public setOwner(owner: GuildMemberResolvable): Promise<Guild>;
417 public setRegion(region: string): Promise<Guild>;
418 public setRolePosition(role: string | Role, position: number, relative?: boolean): Promise<Guild>;
419 public setSplash(splash: Base64Resolvable): Promise<Guild>;
420 public setVerificationLevel(verificationLevel: number): Promise<Guild>;
421 public sync(): void;
422 public toString(): string;
423 public unban(user: UserResolvable): Promise<User>;
424 }
425
426 export class GuildAuditLogs {
427 constructor(guild: Guild, data: object);
428 public entries: Collection<Snowflake, GuildAuditLogsEntry>;
429
430 public static Actions: GuildAuditLogsActions;
431 public static Targets: GuildAuditLogsTargets;
432 public static Entry: typeof GuildAuditLogsEntry;
433 public static actionType(action: number): GuildAuditLogsActionType;
434 public static build(...args: any[]): Promise<GuildAuditLogs>;
435 public static targetType(target: number): GuildAuditLogsTarget;
436 }
437
438 class GuildAuditLogsEntry {
439 constructor(guild: Guild, data: object);
440 public action: GuildAuditLogsAction;
441 public actionType: GuildAuditLogsActionType;
442 public changes?: AuditLogChange[];
443 public readonly createdTimestamp: number;
444 public readonly createdAt: Date;
445 public executor: User;
446 public extra?: object | Role | GuildMember;
447 public id: Snowflake;
448 public reason?: string;
449 public target?: Guild | User | Role | Emoji | Invite | Webhook;
450 public targetType: GuildAuditLogsTarget;
451 }
452
453 export class GuildChannel extends Channel {
454 constructor(guild: Guild, data: object);
455 public readonly calculatedPosition: number;
456 public readonly deletable: boolean;
457 public guild: Guild;
458 public name: string;
459 public permissionOverwrites: Collection<Snowflake, PermissionOverwrites>;
460 public position: number;
461 public clone(name?: string, withPermissions?: boolean, withTopic?: boolean): Promise<GuildChannel>;
462 public createInvite(options?: InviteOptions): Promise<Invite>;
463 public edit(data: ChannelData): Promise<GuildChannel>;
464 public equals(channel: GuildChannel): boolean;
465 public overwritePermissions(userOrRole: RoleResolvable | UserResolvable, options: PermissionOverwriteOptions): Promise<void>;
466 public permissionsFor(member: GuildMemberResolvable): Permissions;
467 public setName(name: string): Promise<GuildChannel>;
468 public setPosition(position: number, relative?: boolean): Promise<GuildChannel>;
469 public setTopic(topic: string): Promise<GuildChannel>;
470 public toString(): string;
471 }
472
473 export class GuildMember extends PartialTextBasedChannel() {
474 constructor(guild: Guild, data: object);
475 public readonly bannable: boolean;
476 public readonly client: Client;
477 public readonly colorRole: Role;
478 public readonly deaf: boolean;
479 public readonly displayColor: number;
480 public readonly displayHexColor: string;
481 public readonly displayName: string;
482 public guild: Guild;
483 public readonly highestRole: Role;
484 public readonly hoistRole: Role;
485 public readonly id: Snowflake;
486 public readonly joinedAt: Date;
487 public joinedTimestamp: number;
488 public readonly kickable: boolean;
489 public lastMessageID: string;
490 public readonly mute: boolean;
491 public nickname: string;
492 public readonly permissions: Permissions;
493 public readonly presence: Presence;
494 public readonly roles: Collection<Snowflake, Role>;
495 public selfDeaf: boolean;
496 public selfMute: boolean;
497 public serverDeaf: boolean;
498 public serverMute: boolean;
499 public speaking: boolean;
500 public user: User;
501 public readonly voiceChannel: VoiceChannel;
502 public voiceChannelID: string;
503 public voiceSessionID: string;
504 public addRole(role: Role | Snowflake): Promise<GuildMember>;
505 public addRoles(roles: Collection<Snowflake, Role> | Role[] | Snowflake[]): Promise<GuildMember>;
506 public ban(options?: BanOptions | number | string): Promise<GuildMember>;
507 public createDM(): Promise<DMChannel>;
508 public deleteDM(): Promise<DMChannel>;
509 public edit(data: object): Promise<GuildMember>;
510 public hasPermission(permission: PermissionResolvable | PermissionResolvable[], explicit?: boolean, checkAdmin?: boolean, checkOwner?: boolean): boolean;
511 public hasPermissions(permission: PermissionResolvable[], explicit?: boolean): boolean;
512 public kick(reason?: string): Promise<GuildMember>;
513 public missingPermissions(permissions: PermissionResolvable[], explicit?: boolean): PermissionResolvable[];
514 public permissionsIn(channel: ChannelResolvable): Permissions;
515 public removeRole(role: Role | Snowflake): Promise<GuildMember>;
516 public removeRoles(roles: Collection<Snowflake, Role> | Role[] | Snowflake[]): Promise<GuildMember>;
517 public setDeaf(deaf: boolean): Promise<GuildMember>;
518 public setMute(mute: boolean): Promise<GuildMember>;
519 public setNickname(nickname: string): Promise<GuildMember>;
520 public setRoles(roles: Collection<Snowflake, Role> | Role[] | Snowflake[]): Promise<GuildMember>;
521 public setVoiceChannel(voiceChannel: ChannelResolvable): Promise<GuildMember>;
522 public toString(): string;
523 }
524
525 export class Invite {
526 constructor(client: Client, data: object);
527 public channel: GuildChannel | PartialGuildChannel;
528 public readonly client: Client;
529 public code: string;
530 public readonly createdAt: Date;
531 public createdTimestamp: number;
532 public readonly expiresAt: Date;
533 public readonly expiresTimestamp: number;
534 public guild: Guild | PartialGuild;
535 public inviter: User;
536 public maxAge: number;
537 public maxUses: number;
538 public memberCount: number;
539 public presenceCount: number;
540 public temporary: boolean;
541 public textChannelCount: number;
542 public readonly url: string;
543 public uses: number;
544 public voiceChannelCount: number;
545 public delete(): Promise<Invite>;
546 public toString(): string;
547 }
548
549 export class Message {
550 constructor(channel: TextChannel | DMChannel | GroupDMChannel, data: object, client: Client);
551 private _edits: Message[];
552 private patch(data: object): void;
553
554 public attachments: Collection<Snowflake, MessageAttachment>;
555 public author: User;
556 public channel: TextChannel | DMChannel | GroupDMChannel;
557 public readonly cleanContent: string;
558 public readonly client: Client;
559 public content: string;
560 public readonly createdAt: Date;
561 public createdTimestamp: number;
562 public readonly deletable: boolean;
563 public readonly editable: boolean;
564 public readonly editedAt: Date;
565 public editedTimestamp: number;
566 public readonly edits: Message[];
567 public embeds: MessageEmbed[];
568 public readonly guild: Guild;
569 public hit: boolean;
570 public id: Snowflake;
571 public member: GuildMember;
572 public mentions: MessageMentions;
573 public nonce: string;
574 public readonly pinnable: boolean;
575 public pinned: boolean;
576 public reactions: Collection<Snowflake, MessageReaction>;
577 public system: boolean;
578 public tts: boolean;
579 public type: string;
580 public webhookID: Snowflake;
581 public acknowledge(): Promise<Message>;
582 public awaitReactions(filter: CollectorFilter, options?: AwaitReactionsOptions): Promise<Collection<Snowflake, MessageReaction>>;
583 public clearReactions(): Promise<Message>;
584 public createReactionCollector(filter: CollectorFilter, options?: ReactionCollectorOptions): ReactionCollector;
585 public delete(timeout?: number): Promise<Message>;
586 public edit(content: StringResolvable, options?: MessageEditOptions): Promise<Message>;
587 public editCode(lang: string, content: StringResolvable): Promise<Message>;
588 public equals(message: Message, rawData: object): boolean;
589 public fetchWebhook(): Promise<Webhook>;
590 public isMemberMentioned(member: GuildMember | User): boolean;
591 public isMentioned(data: GuildChannel | User | Role | Snowflake): boolean;
592 public pin(): Promise<Message>;
593 public react(emoji: string | Emoji | ReactionEmoji): Promise<MessageReaction>;
594 public reply(content?: StringResolvable, options?: MessageOptions): Promise<Message | Message[]>;
595 public reply(options?: MessageOptions): Promise<Message | Message[]>;
596 public toString(): string;
597 public unpin(): Promise<Message>;
598 }
599
600 export class MessageAttachment {
601 constructor(message: Message, data: object);
602 public readonly client: Client;
603 public filename: string;
604 public filesize: number;
605 public height: number;
606 public id: Snowflake;
607 public message: Message;
608 public proxyURL: string;
609 public url: string;
610 public width: number;
611 }
612
613 export class MessageCollector extends Collector<Snowflake, Message> {
614 constructor(channel: TextChannel | DMChannel | GroupDMChannel, filter: CollectorFilter, options?: MessageCollectorOptions);
615 public channel: Channel;
616 public options: MessageCollectorOptions;
617 public received: number;
618
619 public cleanup(): void;
620 public handle(message: Message): CollectorHandler<Snowflake, Message>;
621 public postCheck(): string;
622 }
623
624 export class MessageEmbed {
625 constructor(message: Message, data: object);
626 public author: MessageEmbedAuthor;
627 public readonly client: Client;
628 public color: number;
629 public readonly createdAt: Date;
630 public createdTimestamp: number;
631 public description: string;
632 public fields: MessageEmbedField[];
633 public footer: MessageEmbedFooter;
634 public readonly hexColor: string;
635 public image: MessageEmbedImage;
636 public message: Message;
637 public provider: MessageEmbedProvider;
638 public thumbnail: MessageEmbedThumbnail;
639 public title: string;
640 public type: string;
641 public url: string;
642 public video: MessageEmbedVideo;
643 }
644
645 export class MessageEmbedAuthor {
646 constructor(embed: MessageEmbed, data: object);
647 public embed: MessageEmbed;
648 public iconURL: string;
649 public name: string;
650 public url: string;
651 }
652
653 export class MessageEmbedField {
654 constructor(embed: MessageEmbed, data: object);
655 public embed: MessageEmbed;
656 public inline: boolean;
657 public name: string;
658 public value: string;
659 }
660
661 export class MessageEmbedFooter {
662 constructor(embed: MessageEmbed, data: object);
663 public embed: MessageEmbed;
664 public iconURL: string;
665 public proxyIconURL: string;
666 public text: string;
667 }
668
669 export class MessageEmbedImage {
670 constructor(embed: MessageEmbed, data: object);
671 public embed: MessageEmbed;
672 public height: number;
673 public proxyURL: string;
674 public url: string;
675 public width: number;
676 }
677
678 export class MessageEmbedProvider {
679 constructor(embed: MessageEmbed, data: object);
680 public embed: MessageEmbed;
681 public name: string;
682 public url: string;
683 }
684
685 export class MessageEmbedThumbnail {
686 constructor(embed: MessageEmbed, data: object);
687 public embed: MessageEmbed;
688 public height: number;
689 public proxyURL: string;
690 public url: string;
691 public width: number;
692 }
693
694 export class MessageEmbedVideo {
695 constructor(embed: MessageEmbed, data: object);
696 public embed: MessageEmbed;
697 public height: number;
698 public url: string;
699 public width: number;
700 }
701
702 export class MessageMentions {
703 private _channels: Collection<Snowflake, GuildChannel>;
704 private _content: Message;
705 private _guild: Guild;
706 private _members: Collection<Snowflake, GuildMember>;
707
708 public readonly channels: Collection<Snowflake, TextChannel>;
709 public everyone: boolean;
710 public members: Collection<Snowflake, GuildMember>;
711 public roles: Collection<Snowflake, Role>;
712 public users: Collection<Snowflake, User>;
713
714 public static CHANNELS_PATTERN: RegExp;
715 public static EVERYONE_PATTERN: RegExp;
716 public static ROLES_PATTERN: RegExp;
717 public static USERS_PATTERN: RegExp;
718 }
719
720 export class MessageReaction {
721 constructor(message: Message, emoji: object, count: number, me: boolean);
722 public count: number;
723 public readonly emoji: Emoji | ReactionEmoji;
724 public me: boolean;
725 public message: Message;
726 public users: Collection<string, User>;
727 public fetchUsers(limit?: number): Promise<Collection<Snowflake, User>>;
728 public remove(user?: UserResolvable): Promise<MessageReaction>;
729 }
730
731 export class OAuth2Application {
732 constructor(client: Client, data: object);
733 public bot: object;
734 public botPublic: boolean;
735 public botRequireCodeGrant: boolean;
736 public readonly client: Client;
737 public readonly createdAt: Date;
738 public readonly createdTimestamp: number;
739 public description: string;
740 public flags: number;
741 public icon: string;
742 public iconURL: string;
743 public id: Snowflake;
744 public name: string;
745 public owner: User;
746 public redirectURIs: string[];
747 public rpcApplicationState: boolean;
748 public rpcOrigins: string[];
749 public secret: string;
750 public reset(): OAuth2Application;
751 public toString(): string;
752 }
753
754 export class PartialGuild {
755 constructor(client: Client, data: object);
756 public readonly client: Client;
757 public icon: string;
758 public id: Snowflake;
759 public name: string;
760 public splash: string;
761 }
762
763 export class PartialGuildChannel {
764 constructor(client: Client, data: object);
765 public readonly client: Client;
766 public id: Snowflake;
767 public name: string;
768 public type: string;
769 }
770
771 export class PermissionOverwrites {
772 constructor(guildChannel: GuildChannel, data: object);
773 public allow: number;
774 public channel: GuildChannel;
775 public deny: number;
776 public id: Snowflake;
777 public type: string;
778 public delete(): Promise<PermissionOverwrites>;
779 }
780
781 export class Permissions {
782 constructor(permissions: number | PermissionResolvable[]);
783 constructor(member: GuildMember, permissions: number | PermissionResolvable[]);
784 private readonly raw: number;
785
786 public bitfield: number;
787 public member: GuildMember;
788 public add(...permissions: PermissionResolvable[]): this;
789 public has(permission: PermissionResolvable | PermissionResolvable[], checkAdmin?: boolean): boolean;
790 public hasPermission(permission: PermissionResolvable, explicit?: boolean): boolean;
791 public hasPermissions(permissions: PermissionResolvable[], explicit?: boolean): boolean;
792 public missing(permissions: PermissionResolvable[], checkAdmin?: boolean): PermissionResolvable[];
793 public missingPermissions(permissions: PermissionResolvable[], checkAdmin?: boolean): PermissionResolvable[];
794 public remove(...permissions: PermissionResolvable[]): this;
795 public serialize(checkAdmin?: boolean): PermissionObject;
796
797 public static ALL: number;
798 public static DEFAULT: number;
799 public static FLAGS: PermissionFlags;
800 public static resolve(permission: PermissionResolvable | PermissionResolvable[]): number;
801 }
802
803 export class Presence {
804 constructor(data: object);
805 public game: Game;
806 public status: 'online' | 'offline' | 'idle' | 'dnd';
807 public equals(presence: Presence): boolean;
808 }
809
810 export class ReactionCollector extends Collector<Snowflake, MessageReaction> {
811 constructor(message: Message, filter: CollectorFilter, options?: ReactionCollectorOptions);
812 public message: Message;
813 public options: ReactionCollectorOptions;
814 public total: number;
815 public users: Collection<Snowflake, User>;
816
817 public cleanup(): void;
818 public handle(reaction: MessageReaction): CollectorHandler<Snowflake, MessageReaction>;
819 public postCheck(reaction: MessageReaction, user: User): string;
820 }
821
822 export class ReactionEmoji {
823 constructor(reaction: MessageReaction, name: string, id: string);
824 public id: Snowflake;
825 public identifier: string;
826 public name: string;
827 public reaction: MessageReaction;
828 public toString(): string;
829 }
830
831 class RequestHandler {
832 constructor(restManager: object);
833 public readonly globalLimit: boolean;
834 public queue: object[];
835 public restManager: object;
836 public handle(): void;
837 public push(request: {}): void;
838 }
839
840 export class RichEmbed {
841 constructor(data?: RichEmbedOptions);
842 public author?: { name: string; url?: string; icon_url?: string; };
843 public color?: number | string;
844 public description?: string;
845 public fields?: { name: string; value: string; inline?: boolean; }[];
846 public file?: string | FileOptions;
847 public footer?: { text?: string; icon_url?: string; };
848 public image?: { url: string; proxy_url?: string; height?: number; width?: number; };
849 public thumbnail?: { url: string; height?: number; width?: number; };
850 public timestamp?: Date;
851 public title?: string;
852 public url?: string;
853 public addBlankField(inline?: boolean): this;
854 public addField(name: StringResolvable, value: StringResolvable, inline?: boolean): this;
855 public attachFile(file: FileOptions | string): this;
856 public setAuthor(name: StringResolvable, icon?: string, url?: string): this;
857 public setColor(color: ColorResolvable): this;
858 public setDescription(description: StringResolvable): this;
859 public setFooter(text: StringResolvable, icon?: string): this;
860 public setImage(url: string): this;
861 public setThumbnail(url: string): this;
862 public setTimestamp(timestamp?: Date): this;
863 public setTitle(title: StringResolvable): this;
864 public setURL(url: string): this;
865 }
866
867 export class Role {
868 constructor(guild: Guild, data: object);
869 public readonly calculatedPosition: number;
870 public readonly client: Client;
871 public color: number;
872 public readonly createdAt: Date;
873 public readonly createdTimestamp: number;
874 public readonly editable: boolean;
875 public guild: Guild;
876 public readonly hexColor: string;
877 public hoist: boolean;
878 public id: Snowflake;
879 public managed: boolean;
880 public readonly members: Collection<Snowflake, GuildMember>;
881 public mentionable: boolean;
882 public name: string;
883 public permissions: number;
884 public position: number;
885 public comparePositionTo(role: Role): number;
886 public delete(): Promise<Role>;
887 public edit(data: RoleData): Promise<Role>;
888 public equals(role: Role): boolean;
889 public hasPermission(permission: PermissionResolvable | PermissionResolvable[], explicit?: boolean, checkAdmin?: boolean): boolean;
890 public hasPermissions(permissions: PermissionResolvable[], explicit?: boolean): boolean;
891 public serialize(): PermissionObject;
892 public setColor(color: string | number): Promise<Role>;
893 public setHoist(hoist: boolean): Promise<Role>;
894 public setMentionable(mentionable: boolean): Promise<Role>;
895 public setName(name: string): Promise<Role>;
896 public setPermissions(permissions: PermissionResolvable[]): Promise<Role>;
897 public setPosition(position: number, relative?: boolean): Promise<Role>;
898 public toString(): string;
899
900 public static comparePositions(role1: Role, role2: Role): number;
901 }
902
903 class SecretKey {
904 constructor(key: Uint8Array);
905 public key: Uint8Array;
906 }
907
908 class SequentialRequestHandler extends RequestHandler {
909 constructor(restManager: object, endpoint: string);
910 public busy: boolean;
911 public endpoint: string;
912 public readonly globalLimit: boolean;
913 public queue: any[];
914 public restManager: object;
915 public timeDifference: number;
916 public execute(item: any[]): Promise<object | Error>;
917 public handle(): void;
918 public push(request: any[]): void;
919 }
920
921 export class Shard {
922 constructor(manager: ShardingManager, id: number, args?: string[]);
923 private _handleMessage(message: any): void;
924
925 public env: object;
926 public id: string;
927 public manager: ShardingManager;
928 public process: ChildProcess;
929 public eval(script: string): Promise<any>;
930 public fetchClientValue(prop: string): Promise<any>;
931 public send(message: any): Promise<Shard>;
932 }
933
934 export class ShardClientUtil {
935 constructor(client: Client);
936 private _handleMessage(message: any): void;
937 private _respond(type: string, message: any): void;
938
939 public readonly count: number;
940 public readonly id: number;
941 public broadcastEval(script: string): Promise<any[]>;
942 public fetchClientValues(prop: string): Promise<any[]>;
943 public send(message: any): Promise<void>;
944
945 public static singleton(client: Client): ShardClientUtil;
946 }
947
948 export class ShardingManager extends EventEmitter {
949 constructor(file: string, options?: {
950 totalShards?: number | 'auto';
951 respawn?: boolean;
952 shardArgs?: string[];
953 token?: string;
954 });
955 private _spawn(amount: number, delay: number): Promise<Collection<number, Shard>>;
956
957 public file: string;
958 public respawn: boolean;
959 public shardArgs: string[];
960 public shards: Collection<number, Shard>;
961 public token: string;
962 public totalShards: number | string;
963 public broadcast(message: any): Promise<Shard[]>;
964 public broadcastEval(script: string): Promise<any[]>;
965 public createShard(id: number): Promise<Shard>;
966 public fetchClientValues(prop: string): Promise<any[]>;
967 public spawn(amount?: number, delay?: number): Promise<Collection<number, Shard>>;
968
969 on(event: 'launch', listener: (shard: Shard) => void): this;
970 on(event: 'message', listener: (shard: Shard, message: any) => void): this;
971 }
972
973 export class SnowflakeUtil {
974 public static deconstruct(snowflake: Snowflake): DeconstructedSnowflake;
975 public static generate(): Snowflake;
976 }
977
978 export class StreamDispatcher extends VolumeInterface {
979 constructor(player: AudioPlayer, stream: NodeJS.ReadableStream, streamOptions: StreamOptions);
980 public destroyed: boolean;
981 public readonly passes: number;
982 public paused: boolean;
983 public player: AudioPlayer;
984 public stream: ReadableStream | VoiceBroadcast;
985 public readonly time: number;
986 public readonly totalStreamTime: number;
987 public end(reason?: string): void;
988 public pause(): void;
989 public resume(): void;
990 public setBitrate(bitrate: number | 'auto'): void;
991 }
992
993 export class TextChannel extends TextBasedChannel(GuildChannel) {
994 constructor(guild: Guild, data: object);
995 public lastMessageID: string;
996 public readonly members: Collection<Snowflake, GuildMember>;
997 public messages: Collection<Snowflake, Message>;
998 public nsfw: boolean;
999 public topic: string;
1000 public createWebhook(name: string, avatar: BufferResolvable): Promise<Webhook>;
1001 public fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
1002 }
1003
1004 export class User extends PartialTextBasedChannel() {
1005 constructor(client: Client, data: object);
1006 public avatar: string;
1007 public readonly avatarURL: string;
1008 public bot: boolean;
1009 public readonly client: Client;
1010 public readonly createdAt: Date;
1011 public readonly createdTimestamp: number;
1012 public readonly defaultAvatarURL: string;
1013 public discriminator: string;
1014 public readonly displayAvatarURL: string;
1015 public readonly dmChannel: DMChannel;
1016 public readonly id: Snowflake;
1017 public lastMessageID: string;
1018 public readonly note?: string;
1019 public readonly presence: Presence;
1020 public readonly tag: string;
1021 public username: string;
1022 public addFriend(): Promise<User>;
1023 public block(): Promise<User>;
1024 public createDM(): Promise<DMChannel>
1025 public deleteDM(): Promise<DMChannel>;
1026 public equals(user: User): boolean;
1027 public fetchProfile(): Promise<UserProfile>;
1028 public removeFriend(): Promise<User>;
1029 public setNote(note: string): Promise<User>;
1030 public toString(): string;
1031 public typingDurationIn(channel: ChannelResolvable): number;
1032 public typingIn(channel: ChannelResolvable): boolean;
1033 public typingSinceIn(channel: ChannelResolvable): Date;
1034 public unblock(): Promise<User>;
1035 }
1036
1037 export class UserConnection {
1038 constructor(user: User, data: object);
1039 public id: string;
1040 public integrations: object[];
1041 public name: string;
1042 public revoked: boolean;
1043 public type: string;
1044 public user: User;
1045 }
1046
1047 export class UserProfile {
1048 constructor(user: User, data: object);
1049 public client: Client;
1050 public connections: Collection<string, UserConnection>;
1051 public mutualGuilds: Collection<Snowflake, Guild>;
1052 public premium: boolean;
1053 public premiumSince: Date;
1054 public user: User;
1055 }
1056
1057 export class Util {
1058 public static arrayEqual(a: any[], b: any[]): boolean;
1059 public static cloneObject(obj: object): object;
1060 public static convertToBuffer(ab: ArrayBuffer | string): Buffer;
1061 public static escapeMarkdown(text: string, onlyCodeBlock?: boolean, onlyInlineCode?: boolean): string;
1062 public static fetchRecommendedShards(token: string, guildsPerShard?: number): Promise<number>;
1063 public static makeError(obj: { name: string, message: string, stack: string }): Error;
1064 public static makePlainError(err: Error): object;
1065 public static mergeDefault(def: object, given: object): object;
1066 public static moveElementInArray(array: any[], element: any, newIndex: number, offset?: boolean): number;
1067 public static parseEmoji(text: string): object;
1068 public static splitMessage(text: string, options?: SplitOptions): string | string[];
1069 public static str2ab(str: string): ArrayBuffer;
1070 }
1071
1072 export class VoiceBroadcast extends EventEmitter {
1073 constructor(client: Client);
1074 public readonly client: Client;
1075 public currentTranscoder: object;
1076 public readonly dispatchers: StreamDispatcher[];
1077 public prism: object;
1078 public destroy(): void;
1079 public end(): void;
1080 public pause(): void;
1081 public playArbitraryInput(input: string, options?: StreamOptions): VoiceBroadcast;
1082 public playConvertedStream(stream: ReadableStream, options?: StreamOptions): VoiceBroadcast;
1083 public playFile(file: string, options?: StreamOptions): StreamDispatcher;
1084 public playOpusStream(stream: ReadableStream, options?: StreamOptions): StreamDispatcher;
1085 public playStream(stream: ReadableStream, options?: StreamOptions): VoiceBroadcast;
1086 public resume(): void;
1087
1088 on(event: string, listener: Function): this;
1089 on(event: 'error', listener: (error: Error) => void): this;
1090 on(event: 'subscribe', listener: (dispatcher: StreamDispatcher) => void): this;
1091 on(event: 'unsubscribe', listener: (dispatcher: StreamDispatcher) => void): this;
1092 on(event: 'warn', listener: (warning: string | Error) => void): this;
1093 }
1094
1095 export class VoiceChannel extends GuildChannel {
1096 constructor(guild: Guild, data: object);
1097 public bitrate: number;
1098 public readonly connection: VoiceConnection;
1099 public readonly full: boolean;
1100 public readonly joinable: boolean;
1101 public members: Collection<Snowflake, GuildMember>;
1102 public readonly speakable: boolean;
1103 public userLimit: number;
1104 public join(): Promise<VoiceConnection>;
1105 public leave(): void;
1106 public setBitrate(bitrate: number): Promise<VoiceChannel>;
1107 public setUserLimit(userLimit: number): Promise<VoiceChannel>;
1108 }
1109
1110 export class VoiceConnection extends EventEmitter {
1111 constructor(voiceManager: ClientVoiceManager, channel: VoiceChannel);
1112 private authentication: object;
1113 private sockets: object;
1114 private ssrcMap: Map<number, boolean>;
1115 private authenticate(): void;
1116 private authenticateFailed(reason: string): void;
1117 private checkAuthenticated(): void;
1118 private cleanup(): void;
1119 private connect(): void;
1120 private onReady(data: object): void;
1121 private onSessionDescription(mode: string, secret: string): void;
1122 private onSpeaking(data: object): void;
1123 private reconnect(token: string, endpoint: string): void;
1124 private setSpeaking(value: boolean): void;
1125 private updateChannel(channel: VoiceChannel): void;
1126
1127 public channel: VoiceChannel;
1128 public readonly client: Client;
1129 public readonly dispatcher: StreamDispatcher;
1130 public player: AudioPlayer;
1131 public prism: object;
1132 public receivers: VoiceReceiver[];
1133 public speaking: boolean;
1134 public status: number;
1135 public voiceManager: ClientVoiceManager;
1136 public createReceiver(): VoiceReceiver;
1137 public disconnect(): void;
1138 public playArbitraryInput(input: string, options?: StreamOptions): StreamDispatcher;
1139 public playBroadcast(broadcast: VoiceBroadcast, options?: StreamOptions): StreamDispatcher;
1140 public playConvertedStream(stream: ReadableStream, options?: StreamOptions): StreamDispatcher;
1141 public playFile(file: string, options?: StreamOptions): StreamDispatcher;
1142 public playOpusStream(steam: ReadableStream, options?: StreamOptions): StreamDispatcher;
1143 public playStream(stream: ReadableStream, options?: StreamOptions): StreamDispatcher;
1144 public sendVoiceStateUpdate(options: object): void;
1145 public setSessionID(sessionID: string): void;
1146 public setTokenAndEndpoint(token: string, endpoint: string): void;
1147
1148 on(event: 'authenticated', listener: () => void): this;
1149 on(event: 'debug', listener: (message: string) => void): this;
1150 on(event: 'disconnect', listener: (error: Error) => void): this;
1151 on(event: 'error', listener: (error: Error) => void): this;
1152 on(event: 'failed', listener: (error: Error) => void): this;
1153 on(event: 'newSession', listener: () => void): this;
1154 on(event: 'ready', listener: () => void): this;
1155 on(event: 'reconnecting', listener: () => void): this;
1156 on(event: 'speaking', listener: (user: User, speaking: boolean) => void): this;
1157 on(event: 'warn', listener: (warning: string | Error) => void): this;
1158 }
1159
1160 class VoiceConnectionUDPClient extends EventEmitter {
1161 constructor(voiceConnection: VoiceConnection);
1162 public discordAddress: string;
1163 public readonly discordPort: number;
1164 public localAddress: string;
1165 public localPort: string;
1166 public socket: any;
1167 public voiceConnection: VoiceConnection;
1168 public findEndpointAddress(): Promise<string>;
1169 public send(packet: object): Promise<object>;
1170 }
1171
1172 export class VoiceReceiver extends EventEmitter {
1173 constructor(connection: VoiceConnection);
1174 private stoppedSpeaking(user: User): void;
1175
1176 public destroyed: boolean;
1177 public voiceConnection: VoiceConnection;
1178 public createOpusStream(user: UserResolvable): ReadableStream;
1179 public createPCMStream(user: UserResolvable): ReadableStream;
1180 public destroy(): void;
1181 public recreate(): void;
1182
1183 on(event: 'opus', listener: (user: User, buffer: Buffer) => void): this;
1184 on(event: 'pcm', listener: (user: User, buffer: Buffer) => void): this;
1185 on(event: 'warn', listener: (reason: string, message: string) => void): this;
1186 }
1187
1188 export class VoiceRegion {
1189 constructor(data: object);
1190 public custom: boolean;
1191 public deprecated: boolean;
1192 public id: string;
1193 public name: string;
1194 public optimal: boolean;
1195 public sampleHostname: string;
1196 public vip: boolean;
1197 }
1198
1199 class VoiceWebsocket extends EventEmitter {
1200 constructor(voiceConnection: VoiceConnection);
1201 public attempts: number;
1202 public readonly client: Client;
1203 public voiceConnection: VoiceConnection;
1204 public ws: any;
1205 public clearHeartbeat(): void;
1206 public connect(): void;
1207 public onClose(): void;
1208 public onError(error: Error): void;
1209 public onMessage(event: any): void;
1210 public onOpen(): void;
1211 public onPacket(packet: object): void;
1212 public reset(): void;
1213 public send(data: string): Promise<string>;
1214 public sendHeartbeat(): void;
1215 public sendPacket(packet: object): Promise<string>;
1216 public setHeartbeat(interval: number): void;
1217
1218 on(event: 'ready', listener: (packet: object) => void): this;
1219 on(event: 'sessionDescription', listener: (encryptionMode: string, secretKey: SecretKey) => void): this;
1220 on(event: 'speaking', listener: (data: object) => void): this;
1221 on(event: 'unknownPacket', listener: (packet: object) => void): this;
1222 on(event: 'warn', listener: (warn: string) => void): this;
1223 }
1224
1225 export class VolumeInterface extends EventEmitter {
1226 constructor(object?: { volume: number })
1227 public readonly volume: number;
1228 public readonly volumeDecibels: number;
1229 public readonly volumeLogarithmic: number;
1230 public setVolume(volume: number): void;
1231 public setVolumeDecibels(db: number): void;
1232 public setVolumeLogarithmic(value: number): void;
1233
1234 on(event: 'debug', listener: (information: string) => void): this;
1235 on(event: 'end', listener: (reason: string) => void): this;
1236 on(event: 'error', listener: (err: Error) => void): this;
1237 on(event: 'speaking', listener: (value: boolean) => void): this;
1238 on(event: 'start', listener: () => void): this;
1239 on(event: 'volumeChange', listener: (oldVolume: number, newVolume: number) => void): this;
1240 }
1241
1242 export class Webhook {
1243 constructor(client: Client, dataOrID: object | string, token: string);
1244 public avatar: string;
1245 public channelID: string;
1246 public readonly client: Client;
1247 public guildID: string;
1248 public id: Snowflake;
1249 public name: string;
1250 public owner: User | object;
1251 public token: string;
1252 public delete(): Promise<void>;
1253 public edit(name: string, avatar: BufferResolvable): Promise<Webhook>;
1254 public send(content?: StringResolvable, options?: WebhookMessageOptions): Promise<Message | Message[]>;
1255 public send(options?: WebhookMessageOptions): Promise<Message | Message[]>;
1256 public sendCode(lang: string, content: StringResolvable, options?: WebhookMessageOptions): Promise<Message | Message[]>;
1257 public sendFile(attachment: BufferResolvable, name?: string, content?: StringResolvable, options?: WebhookMessageOptions): Promise<Message>;
1258 public sendMessage(content?: StringResolvable, options?: WebhookMessageOptions): Promise<Message | Message[]>;
1259 public sendMessage(options?: WebhookMessageOptions): Promise<Message | Message[]>;
1260 public sendSlackMessage(body: object): Promise<void>;
1261 }
1262
1263 export class WebhookClient extends Webhook {
1264 constructor(id: string, token: string, options?: ClientOptions);
1265 private _intervals: NodeJS.Timer;
1266 private _timeouts: NodeJS.Timer;
1267 private resolver: ClientDataResolver;
1268 private rest: object;
1269
1270 public options: ClientOptions;
1271 public clearInterval(interval: NodeJS.Timer): void;
1272 public clearTimeout(timeout: NodeJS.Timer): void;
1273 public destroy(): void;
1274 public setInterval(fn: Function, delay: number, ...args: any[]): NodeJS.Timer;
1275 public setTimeout(fn: Function, delay: number, ...args: any[]): NodeJS.Timer;
1276 }
1277
1278//#endregion
1279
1280//#region Mixins
1281
1282 // Model the TextBasedChannel mixin system, allowing application of these fields
1283 // to the classes that use these methods without having to manually add them
1284 // to each of those classes
1285
1286 type Constructable<T> = new (...args: any[]) => T;
1287 const PartialTextBasedChannel: <T>(Base?: Constructable<T>) => Constructable<T & PartialTextBasedChannelFields>;
1288 const TextBasedChannel: <T>(Base?: Constructable<T>) => Constructable<T & TextBasedChannelFields>;
1289
1290 type PartialTextBasedChannelFields = {
1291 lastMessage?: Message;
1292 acknowledge(): Promise<DMChannel | GroupDMChannel | TextChannel>;
1293 send(content?: StringResolvable, options?: MessageOptions): Promise<Message | Message[]>;
1294 send(options?: MessageOptions): Promise<Message | Message[]>;
1295 sendCode(lang: string, content: StringResolvable, options?: MessageOptions): Promise<Message | Message[]>;
1296 sendEmbed(embed: RichEmbed | RichEmbedOptions, content?: string, options?: MessageOptions): Promise<Message>;
1297 sendEmbed(embed: RichEmbed | RichEmbedOptions, options?: MessageOptions): Promise<Message>;
1298 sendFile(attachment: BufferResolvable, name?: string, content?: StringResolvable, options?: MessageOptions): Promise<Message>;
1299 sendMessage(content?: string, options?: MessageOptions): Promise<Message | Message[]>;
1300 sendMessage(options?: MessageOptions): Promise<Message | Message[]>;
1301 };
1302
1303 type TextBasedChannelFields = {
1304 typing: boolean;
1305 typingCount: number;
1306 awaitMessages(filter: CollectorFilter, options?: AwaitMessagesOptions): Promise<Collection<string, Message>>;
1307 bulkDelete(messages: Collection<string, Message> | Message[] | number, filterOld?: boolean): Promise<Collection<string, Message>>;
1308 createCollector(filter: CollectorFilter, options?: CollectorOptions): MessageCollector;
1309 createMessageCollector(filter: CollectorFilter, options?: CollectorOptions): MessageCollector;
1310 fetchMessage(messageID: string): Promise<Message>;
1311 fetchMessages(options?: ChannelLogsQueryOptions): Promise<Collection<string, Message>>;
1312 fetchPinnedMessages(): Promise<Collection<string, Message>>;
1313 search(options?: MessageSearchOptions): Promise<Message[][]>;
1314 startTyping(count?: number): void;
1315 stopTyping(force?: boolean): void;
1316 } & PartialTextBasedChannelFields;
1317
1318//#endregion
1319
1320//#region Typedefs
1321
1322 type AddGuildMemberOptions = {
1323 accessToken: String;
1324 nick?: string;
1325 roles?: Collection<string, Role> | Role[] | string[];
1326 mute?: boolean;
1327 deaf?: boolean;
1328 }
1329
1330 type AuditLogChange = {
1331 key: string;
1332 old?: any;
1333 new?: any;
1334 };
1335
1336 type AwaitMessagesOptions = MessageCollectorOptions & { errors?: string[] };
1337
1338 type AwaitReactionsOptions = ReactionCollectorOptions & { errors?: string[] };
1339
1340 type BanOptions = {
1341 days?: number;
1342 reason?: string;
1343 };
1344
1345 type Base64Resolvable = Buffer | Base64String;
1346
1347 type Base64String = string;
1348
1349 type BufferResolvable = Buffer | string;
1350
1351 type ChannelData = {
1352 name?: string;
1353 position?: number;
1354 topic?: string;
1355 bitrate?: number;
1356 userLimit?: number;
1357 };
1358
1359 type ChannelLogsQueryOptions = {
1360 limit?: number
1361 before?: Snowflake
1362 after?: Snowflake
1363 around?: Snowflake
1364 };
1365
1366 type ChannelPosition = {
1367 channel: ChannelResolvable;
1368 position: number;
1369 };
1370
1371 type ChannelResolvable = Channel | Guild | Message | Snowflake;
1372
1373 type ClientOptions = {
1374 apiRequestMethod?: string;
1375 shardId?: number;
1376 shardCount?: number;
1377 messageCacheMaxSize?: number;
1378 messageCacheLifetime?: number;
1379 messageSweepInterval?: number;
1380 fetchAllMembers?: boolean;
1381 disableEveryone?: boolean;
1382 sync?: boolean;
1383 restWsBridgeTimeout?: number;
1384 restTimeOffset?: number;
1385 disabledEvents?: WSEventType[];
1386 ws?: WebSocketOptions;
1387 http?: HTTPOptions;
1388 };
1389
1390 type CollectorHandler<K, V> = { key: K, value: V };
1391 type CollectorFilter = (...args: any[]) => boolean;
1392 type CollectorOptions = { time?: number };
1393
1394 type ColorResolvable = ('DEFAULT'
1395 | 'AQUA'
1396 | 'GREEN'
1397 | 'BLUE'
1398 | 'PURPLE'
1399 | 'GOLD'
1400 | 'ORANGE'
1401 | 'RED'
1402 | 'GREY'
1403 | 'DARKER_GREY'
1404 | 'NAVY'
1405 | 'DARK_AQUA'
1406 | 'DARK_GREEN'
1407 | 'DARK_BLUE'
1408 | 'DARK_PURPLE'
1409 | 'DARK_GOLD'
1410 | 'DARK_ORANGE'
1411 | 'DARK_RED'
1412 | 'DARK_GREY'
1413 | 'LIGHT_GREY'
1414 | 'DARK_NAVY'
1415 | 'RANDOM')
1416 | [number, number, number]
1417 | number
1418 | string;
1419
1420 type DeconstructedSnowflake = {
1421 timestamp: number;
1422 date: Date;
1423 workerID: number;
1424 processID: number;
1425 increment: number;
1426 binary: string;
1427 };
1428
1429 type EmojiEditData = {
1430 name?: string;
1431 roles?: Collection<Snowflake, Role> | Role[] | Snowflake[];
1432 };
1433
1434 type EmojiIdentifierResolvable = string | Emoji | ReactionEmoji;
1435
1436 type FileOptions = {
1437 attachment: BufferResolvable;
1438 name?: string;
1439 };
1440
1441 type GroupDMRecipientOptions = {
1442 user?: UserResolvable | Snowflake;
1443 accessToken?: string;
1444 nick?: string;
1445 };
1446
1447 type GuildAuditLogsAction = keyof GuildAuditLogsActions;
1448
1449 type GuildAuditLogsActions = {
1450 ALL?: null,
1451 GUILD_UPDATE?: number,
1452 CHANNEL_CREATE?: number,
1453 CHANNEL_UPDATE?: number,
1454 CHANNEL_DELETE?: number,
1455 CHANNEL_OVERWRITE_CREATE?: number,
1456 CHANNEL_OVERWRITE_UPDATE?: number,
1457 CHANNEL_OVERWRITE_DELETE?: number,
1458 MEMBER_KICK?: number,
1459 MEMBER_PRUNE?: number,
1460 MEMBER_BAN_ADD?: number,
1461 MEMBER_BAN_REMOVE?: number,
1462 MEMBER_UPDATE?: number,
1463 MEMBER_ROLE_UPDATE?: number,
1464 ROLE_CREATE?: number,
1465 ROLE_UPDATE?: number,
1466 ROLE_DELETE?: number,
1467 INVITE_CREATE?: number,
1468 INVITE_UPDATE?: number,
1469 INVITE_DELETE?: number,
1470 WEBHOOK_CREATE?: number,
1471 WEBHOOK_UPDATE?: number,
1472 WEBHOOK_DELETE?: number,
1473 EMOJI_CREATE?: number,
1474 EMOJI_UPDATE?: number,
1475 EMOJI_DELETE?: number,
1476 MESSAGE_DELETE?: number,
1477 };
1478
1479 type GuildAuditLogsActionType = 'CREATE'
1480 | 'DELETE'
1481 | 'UPDATE'
1482 | 'ALL';
1483
1484 type GuildAuditLogsFetchOptions = {
1485 before?: Snowflake | GuildAuditLogsEntry;
1486 after?: Snowflake | GuildAuditLogsEntry;
1487 limit?: number;
1488 user?: UserResolvable;
1489 type?: string | number;
1490 };
1491
1492 type GuildAuditLogsTarget = keyof GuildAuditLogsTargets;
1493
1494 type GuildAuditLogsTargets = {
1495 ALL?: string;
1496 GUILD?: string;
1497 CHANNEL?: string;
1498 USER?: string;
1499 ROLE?: string;
1500 INVITE?: string;
1501 WEBHOOK?: string;
1502 EMOJI?: string;
1503 MESSAGE?: string;
1504 };
1505
1506 type GuildEditData = {
1507 name?: string;
1508 region?: string;
1509 verificationLevel?: number;
1510 explicitContentFilter?: number;
1511 afkChannel?: ChannelResolvable;
1512 afkTimeout?: number;
1513 icon?: Base64Resolvable;
1514 owner?: GuildMemberResolvable;
1515 splash?: Base64Resolvable;
1516 };
1517
1518 type GuildMemberEditData = {
1519 nick?: string;
1520 roles?: Collection<Snowflake, Role> | Role[] | Snowflake[];
1521 mute?: boolean;
1522 deaf?: boolean;
1523 channel?: ChannelResolvable;
1524 };
1525
1526 type GuildMemberResolvable = GuildMember | User;
1527
1528 type GuildResolvable = Guild | Snowflake;
1529
1530 type HTTPOptions = {
1531 version?: number,
1532 host?: string,
1533 cdn?: string,
1534 }
1535
1536 type InviteOptions = {
1537 temporary?: boolean;
1538 maxAge?: number;
1539 maxUses?: number;
1540 };
1541
1542 type InviteResolvable = string;
1543
1544 type MessageCollectorOptions = CollectorOptions & {
1545 max?: number;
1546 maxMatches?: number;
1547 };
1548
1549 type MessageEditOptions = {
1550 embed?: RichEmbedOptions;
1551 code?: string | boolean;
1552 };
1553
1554 type MessageOptions = {
1555 tts?: boolean;
1556 nonce?: string;
1557 embed?: RichEmbed | RichEmbedOptions,
1558 disableEveryone?: boolean;
1559 file?: FileOptions | string;
1560 files?: FileOptions[] | string[];
1561 code?: string | boolean;
1562 split?: boolean | SplitOptions;
1563 reply?: UserResolvable;
1564 };
1565
1566 type MessageSearchOptions = {
1567 content?: string;
1568 maxID?: Snowflake;
1569 minID?: Snowflake;
1570 has?: 'link'
1571 | 'embed'
1572 | 'file'
1573 | 'video'
1574 | 'image'
1575 | 'sound'
1576 | '-link'
1577 | '-embed'
1578 | '-file'
1579 | '-video'
1580 | '-image'
1581 | '-sound';
1582 channel?: ChannelResolvable;
1583 author?: UserResolvable;
1584 authorType?: 'user'
1585 | 'bot'
1586 | 'webhook'
1587 | '-user'
1588 | '-bot'
1589 | '-webhook';
1590 sortBy?: 'relevant' | 'recent';
1591 sortOrder?: 'asc' | 'desc';
1592 contextSize?: number;
1593 limit?: number;
1594 offset?: number;
1595 mentions?: UserResolvable;
1596 mentionsEveryone?: boolean;
1597 linkHostname?: string;
1598 embedProvider?: string;
1599 embedType?: 'image' | 'video' | 'url' | 'rich';
1600 attachmentFilename?: string;
1601 attachmentExtension?: string;
1602 before?: Date;
1603 after?: Date;
1604 during?: Date;
1605 nsfw?: boolean;
1606 };
1607
1608 type PermissionFlags = {
1609 ADMINISTRATOR?: number;
1610 CREATE_INSTANT_INVITE?: number;
1611 KICK_MEMBERS?: number;
1612 BAN_MEMBERS?: number;
1613 MANAGE_CHANNELS?: number;
1614 MANAGE_GUILD?: number;
1615 ADD_REACTIONS?: number;
1616 VIEW_AUDIT_LOG?: number;
1617 READ_MESSAGES?: number;
1618 SEND_MESSAGES?: number;
1619 SEND_TTS_MESSAGES?: number;
1620 MANAGE_MESSAGES?: number;
1621 EMBED_LINKS?: number;
1622 ATTACH_FILES?: number;
1623 READ_MESSAGE_HISTORY?: number;
1624 MENTION_EVERYONE?: number;
1625 USE_EXTERNAL_EMOJIS?: number;
1626 EXTERNAL_EMOJIS?: number;
1627 CONNECT?: number;
1628 SPEAK?: number;
1629 MUTE_MEMBERS?: number;
1630 DEAFEN_MEMBERS?: number;
1631 MOVE_MEMBERS?: number;
1632 USE_VAD?: number;
1633 CHANGE_NICKNAME?: number;
1634 MANAGE_NICKNAMES?: number;
1635 MANAGE_ROLES?: number;
1636 MANAGE_ROLES_OR_PERMISSIONS?: number;
1637 MANAGE_WEBHOOKS?: number;
1638 MANAGE_EMOJIS?: number;
1639 };
1640
1641 type PermissionObject = {
1642 ADMINISTRATOR?: boolean;
1643 CREATE_INSTANT_INVITE?: boolean;
1644 KICK_MEMBERS?: boolean;
1645 BAN_MEMBERS?: boolean;
1646 MANAGE_CHANNELS?: boolean;
1647 MANAGE_GUILD?: boolean;
1648 ADD_REACTIONS?: boolean;
1649 VIEW_AUDIT_LOG?: boolean;
1650 READ_MESSAGES?: boolean;
1651 SEND_MESSAGES?: boolean;
1652 SEND_TTS_MESSAGES?: boolean;
1653 MANAGE_MESSAGES?: boolean;
1654 EMBED_LINKS?: boolean;
1655 ATTACH_FILES?: boolean;
1656 READ_MESSAGE_HISTORY?: boolean;
1657 MENTION_EVERYONE?: boolean;
1658 USE_EXTERNAL_EMOJIS?: boolean;
1659 EXTERNAL_EMOJIS?: boolean;
1660 CONNECT?: boolean;
1661 SPEAK?: boolean;
1662 MUTE_MEMBERS?: boolean;
1663 DEAFEN_MEMBERS?: boolean;
1664 MOVE_MEMBERS?: boolean;
1665 USE_VAD?: boolean;
1666 CHANGE_NICKNAME?: boolean;
1667 MANAGE_NICKNAMES?: boolean;
1668 MANAGE_ROLES?: boolean;
1669 MANAGE_ROLES_OR_PERMISSIONS?: boolean;
1670 MANAGE_WEBHOOKS?: boolean;
1671 MANAGE_EMOJIS?: boolean;
1672 };
1673
1674 type PermissionString = 'ADMINISTRATOR'
1675 | 'CREATE_INSTANT_INVITE'
1676 | 'KICK_MEMBERS'
1677 | 'BAN_MEMBERS'
1678 | 'MANAGE_CHANNELS'
1679 | 'MANAGE_GUILD'
1680 | 'ADD_REACTIONS'
1681 | 'READ_MESSAGES'
1682 | 'SEND_MESSAGES'
1683 | 'SEND_TTS_MESSAGES'
1684 | 'MANAGE_MESSAGES'
1685 | 'EMBED_LINKS'
1686 | 'ATTACH_FILES'
1687 | 'READ_MESSAGE_HISTORY'
1688 | 'MENTION_EVERYONE'
1689 | 'USE_EXTERNAL_EMOJIS'
1690 | 'EXTERNAL_EMOJIS'
1691 | 'CONNECT'
1692 | 'SPEAK'
1693 | 'MUTE_MEMBERS'
1694 | 'DEAFEN_MEMBERS'
1695 | 'MOVE_MEMBERS'
1696 | 'USE_VAD'
1697 | 'CHANGE_NICKNAME'
1698 | 'MANAGE_NICKNAMES'
1699 | 'MANAGE_ROLES'
1700 | 'MANAGE_ROLES_OR_PERMISSIONS'
1701 | 'MANAGE_WEBHOOKS'
1702 | 'MANAGE_EMOJIS';
1703
1704 type PermissionOverwriteOptions = PermissionObject;
1705
1706 type PermissionResolvable = PermissionString | number;
1707
1708 type PresenceData = {
1709 status?: PresenceStatus;
1710 afk?: boolean;
1711 game?: {
1712 name?: string;
1713 url?: string;
1714 }
1715 }
1716
1717 type PresenceStatus = 'online' | 'idle' | 'invisible' | 'dnd';
1718
1719 type ReactionCollectorOptions = CollectorOptions & {
1720 max?: number;
1721 maxEmojis?: number;
1722 maxUsers?: number;
1723 };
1724
1725 type RichEmbedOptions = {
1726 title?: string;
1727 description?: string;
1728 url?: string;
1729 timestamp?: Date;
1730 color?: number | string;
1731 fields?: { name: string; value: string; inline?: boolean; }[];
1732 file?: string | FileOptions;
1733 author?: { name: string; url?: string; icon_url?: string; };
1734 thumbnail?: { url: string; height?: number; width?: number; };
1735 image?: { url: string; proxy_url?: string; height?: number; width?: number; };
1736 video?: { url: string; height: number; width: number; };
1737 footer?: { text?: string; icon_url?: string; };
1738 };
1739
1740 type RoleData = {
1741 name?: string;
1742 color?: ColorResolvable;
1743 hoist?: boolean;
1744 position?: number;
1745 permissions?: PermissionString[];
1746 mentionable?: boolean;
1747 };
1748
1749 type RoleResolvable = Role | string;
1750
1751 type Snowflake = string;
1752
1753 type SplitOptions = {
1754 maxLength?: number;
1755 char?: string;
1756 prepend?: string;
1757 append?: string;
1758 };
1759
1760 type Status = number;
1761
1762 type StreamOptions = {
1763 seek?: number;
1764 volume?: number;
1765 passes?: number;
1766 bitrate?: number | 'auto';
1767 };
1768
1769 type StringResolvable = string | string[] | any;
1770
1771 type UserResolvable = User | Snowflake | Message | Guild | GuildMember;
1772
1773 type VoiceStatus = number;
1774
1775 type WebhookMessageOptions = {
1776 username?: string;
1777 avatarURL?: string;
1778 tts?: boolean;
1779 nonce?: string;
1780 embeds?: object[];
1781 disableEveryone?: boolean;
1782 file?: FileOptions | string;
1783 code?: string | boolean;
1784 split?: boolean | SplitOptions;
1785 };
1786
1787 type WebSocketOptions = {
1788 large_threshold?: number;
1789 compress?: boolean;
1790 };
1791
1792 type WSEventType = 'READY'
1793 | 'GUILD_SYNC'
1794 | 'GUILD_CREATE'
1795 | 'GUILD_DELETE'
1796 | 'GUILD_UPDATE'
1797 | 'GUILD_MEMBER_ADD'
1798 | 'GUILD_MEMBER_REMOVE'
1799 | 'GUILD_MEMBER_UPDATE'
1800 | 'GUILD_MEMBERS_CHUNK'
1801 | 'GUILD_ROLE_CREATE'
1802 | 'GUILD_ROLE_DELETE'
1803 | 'GUILD_ROLE_UPDATE'
1804 | 'GUILD_BAN_ADD'
1805 | 'GUILD_BAN_REMOVE'
1806 | 'CHANNEL_CREATE'
1807 | 'CHANNEL_DELETE'
1808 | 'CHANNEL_UPDATE'
1809 | 'CHANNEL_PINS_UPDATE'
1810 | 'MESSAGE_CREATE'
1811 | 'MESSAGE_DELETE'
1812 | 'MESSAGE_UPDATE'
1813 | 'MESSAGE_DELETE_BULK'
1814 | 'MESSAGE_REACTION_ADD'
1815 | 'MESSAGE_REACTION_REMOVE'
1816 | 'MESSAGE_REACTION_REMOVE_ALL'
1817 | 'USER_UPDATE'
1818 | 'USER_NOTE_UPDATE'
1819 | 'PRESENCE_UPDATE'
1820 | 'VOICE_STATE_UPDATE'
1821 | 'TYPING_START'
1822 | 'VOICE_SERVER_UPDATE'
1823 | 'RELATIONSHIP_ADD'
1824 | 'RELATIONSHIP_REMOVE';
1825
1826//#endregion
1827}