From 1af1e0cbb8ef2f433054e2d16cb760e503cd5458 Mon Sep 17 00:00:00 2001 From: Sugden <28943913+NotSugden@users.noreply.github.com> Date: Fri, 28 Feb 2020 17:02:51 +0000 Subject: [PATCH] refactor: add some more consistency (#3842) * cleanup(StreamDispatcher): remove old 'end' event * fix(StreamDispatcher): only listen to finish event once * refactor(VoiceWebSocket): use `connection.client` in favour of `connection.voiceManager.client` * fix(VoiceWebSocket): use `client.clearInterval` in favour of `clearInterval` * refactor: destructure EventEmitter * refactor: destructure EventEmitter from events * refactor: use EventEmitter.off in favour of EventEmitter.removeListener * style: order typings alphabetically * oops * fix indent * style: alphabetically organize imports * style: remove extra line * Revert "style: remove extra line" This reverts commit 96e182ed69cfba159ef69aba1d0b218002af67c6. * Revert "style: alphabetically organize imports" This reverts commit 02aee9b06d991731d08d552cf661c5e01343ec6a. * Revert "refactor: destructure EventEmitter from events" This reverts commit 9953b4d267b183e12dee52b284ce7188d67381f6. * Revert "refactor: destructure EventEmitter" This reverts commit 930d7751ab2ee902c8a80559ae9976f67ef6efb0. * Revert "fix(StreamDispatcher): only listen to finish event once" This reverts commit 485a6430a804aba7368e105e9f8bd0c093d7491d. * refactor: use .removeListener instead of .off --- src/client/voice/networking/VoiceWebSocket.js | 6 +- src/client/websocket/WebSocketShard.js | 10 +- src/structures/interfaces/Collector.js | 6 +- typings/index.d.ts | 464 +++++++++--------- 4 files changed, 243 insertions(+), 243 deletions(-) diff --git a/src/client/voice/networking/VoiceWebSocket.js b/src/client/voice/networking/VoiceWebSocket.js index ac6405e14..c6ad45e56 100644 --- a/src/client/voice/networking/VoiceWebSocket.js +++ b/src/client/voice/networking/VoiceWebSocket.js @@ -35,7 +35,7 @@ class VoiceWebSocket extends EventEmitter { * @readonly */ get client() { - return this.connection.voiceManager.client; + return this.connection.client; } shutdown() { @@ -232,7 +232,7 @@ class VoiceWebSocket extends EventEmitter { * @event VoiceWebSocket#warn */ this.emit('warn', 'A voice heartbeat interval is being overwritten'); - clearInterval(this.heartbeatInterval); + this.client.clearInterval(this.heartbeatInterval); } this.heartbeatInterval = this.client.setInterval(this.sendHeartbeat.bind(this), interval); } @@ -245,7 +245,7 @@ class VoiceWebSocket extends EventEmitter { this.emit('warn', 'Tried to clear a heartbeat interval that does not exist'); return; } - clearInterval(this.heartbeatInterval); + this.client.clearInterval(this.heartbeatInterval); this.heartbeatInterval = null; } diff --git a/src/client/websocket/WebSocketShard.js b/src/client/websocket/WebSocketShard.js index b313c751a..6fd38a639 100644 --- a/src/client/websocket/WebSocketShard.js +++ b/src/client/websocket/WebSocketShard.js @@ -175,11 +175,11 @@ class WebSocketShard extends EventEmitter { return new Promise((resolve, reject) => { const cleanup = () => { - this.off(ShardEvents.CLOSE, onClose); - this.off(ShardEvents.READY, onReady); - this.off(ShardEvents.RESUMED, onResumed); - this.off(ShardEvents.INVALID_SESSION, onInvalidOrDestroyed); - this.off(ShardEvents.DESTROYED, onInvalidOrDestroyed); + this.removeListener(ShardEvents.CLOSE, onClose); + this.removeListener(ShardEvents.READY, onReady); + this.removeListener(ShardEvents.RESUMED, onResumed); + this.removeListener(ShardEvents.INVALID_SESSION, onInvalidOrDestroyed); + this.removeListener(ShardEvents.DESTROYED, onInvalidOrDestroyed); }; const onReady = () => { diff --git a/src/structures/interfaces/Collector.js b/src/structures/interfaces/Collector.js index 6231605e7..2ca7fd09a 100644 --- a/src/structures/interfaces/Collector.js +++ b/src/structures/interfaces/Collector.js @@ -230,8 +230,8 @@ class Collector extends EventEmitter { // eslint-disable-next-line no-await-in-loop await new Promise(resolve => { const tick = () => { - this.off('collect', tick); - this.off('end', tick); + this.removeListener('collect', tick); + this.removeListener('end', tick); return resolve(); }; this.on('collect', tick); @@ -240,7 +240,7 @@ class Collector extends EventEmitter { } } } finally { - this.off('collect', onCollect); + this.removeListener('collect', onCollect); } } diff --git a/typings/index.d.ts b/typings/index.d.ts index 55dc94eba..bed7fa219 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -244,17 +244,6 @@ declare module 'discord.js' { public once(event: string, listener: (...args: any[]) => void): this; } - export class ClientVoiceManager { - constructor(client: Client); - public readonly client: Client; - public connections: Collection; - public broadcasts: VoiceBroadcast[]; - - private joinChannel(channel: VoiceChannel): Promise; - - public createBroadcast(): VoiceBroadcast; - } - export class ClientApplication extends Base { constructor(client: Client, data: object); public botPublic: boolean | null; @@ -275,34 +264,6 @@ declare module 'discord.js' { public toString(): string; } - export class Team extends Base { - constructor(client: Client, data: object); - public id: Snowflake; - public name: string; - public icon: string | null; - public ownerID: Snowflake | null; - public members: Collection; - - public readonly owner: TeamMember; - public readonly createdAt: Date; - public readonly createdTimestamp: number; - - public iconURL(options?: ImageURLOptions): string; - public toJSON(): object; - public toString(): string; - } - - export class TeamMember extends Base { - constructor(team: Team, data: object); - public team: Team; - public readonly id: Snowflake; - public permissions: string[]; - public membershipState: MembershipStates; - public user: User; - - public toString(): string; - } - export class ClientUser extends User { public mfaEnabled: boolean; public verified: boolean; @@ -315,6 +276,17 @@ declare module 'discord.js' { public setUsername(username: string): Promise; } + export class ClientVoiceManager { + constructor(client: Client); + public readonly client: Client; + public connections: Collection; + public broadcasts: VoiceBroadcast[]; + + private joinChannel(channel: VoiceChannel): Promise; + + public createBroadcast(): VoiceBroadcast; + } + export abstract class Collector extends EventEmitter { constructor(client: Client, filter: CollectorFilter, options?: CollectorOptions); private _timeout: NodeJS.Timer | null; @@ -822,18 +794,6 @@ declare module 'discord.js' { public updateOverwrite(userOrRole: RoleResolvable | UserResolvable, options: PermissionOverwriteOption, reason?: string): Promise; } - export class StoreChannel extends GuildChannel { - constructor(guild: Guild, data?: object); - public nsfw: boolean; - } - - export class PartialGroupDMChannel extends Channel { - constructor(client: Client, data: object); - public name: string; - public icon: string | null; - public iconURL(options?: ImageURLOptions): string | null; - } - export class GuildEmoji extends Emoji { constructor(client: Client, data: object, guild: Guild); private _roles: string[]; @@ -889,6 +849,14 @@ declare module 'discord.js' { public valueOf(): string; } + export class HTTPError extends Error { + constructor(message: string, name: string, code: number, method: string, path: string); + public code: number; + public method: string; + public name: string; + public path: string; + } + export class Integration extends Base { constructor(client: Client, data: object, guild: Guild); public account: IntegrationAccount; @@ -908,14 +876,6 @@ declare module 'discord.js' { public sync(): Promise; } - export class HTTPError extends Error { - constructor(message: string, name: string, code: number, method: string, path: string); - public code: number; - public method: string; - public name: string; - public path: string; - } - export class Invite extends Base { constructor(client: Client, data: object); public channel: GuildChannel | PartialGroupDMChannel; @@ -941,11 +901,6 @@ declare module 'discord.js' { public toString(): string; } - export class MessageFlags extends BitField { - public static FLAGS: Record; - public static resolve(bit?: BitFieldResolvable): number; - } - export class Message extends Base { constructor(client: Client, data: object, channel: TextChannel | DMChannel); private _edits: Message[]; @@ -1072,6 +1027,11 @@ declare module 'discord.js' { public static normalizeFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): Required[]; } + export class MessageFlags extends BitField { + public static FLAGS: Record; + public static resolve(bit?: BitFieldResolvable): number; + } + export class MessageMentions { constructor(message: Message, users: object[] | Collection, roles: Snowflake[] | Collection, everyone: boolean); private _channels: Collection | null; @@ -1114,6 +1074,23 @@ declare module 'discord.js' { public toJSON(): object; } + export class NewsChannel extends TextBasedChannel(GuildChannel) { + constructor(guild: Guild, data?: object); + public messages: MessageManager; + public nsfw: boolean; + public topic: string | null; + public createWebhook(name: string, options?: { avatar?: BufferResolvable | Base64Resolvable; reason?: string; }): Promise; + public setNSFW(nsfw: boolean, reason?: string): Promise; + public fetchWebhooks(): Promise>; + } + + export class PartialGroupDMChannel extends Channel { + constructor(client: Client, data: object); + public name: string; + public icon: string | null; + public iconURL(options?: ImageURLOptions): string | null; + } + export class PermissionOverwrites { constructor(guildChannel: GuildChannel, data?: object); public allow: Readonly; @@ -1321,7 +1298,15 @@ declare module 'discord.js' { public static generate(timestamp?: number | Date): Snowflake; } - function VolumeMixin(base: Constructable): Constructable; + export class Speaking extends BitField { + public static FLAGS: Record; + public static resolve(bit?: BitFieldResolvable): number; + } + + export class StoreChannel extends GuildChannel { + constructor(guild: Guild, data?: object); + public nsfw: boolean; + } class StreamDispatcher extends VolumeMixin(Writable) { constructor(player: object, options?: StreamOptions, streams?: object); @@ -1357,11 +1342,6 @@ declare module 'discord.js' { public once(event: string, listener: (...args: any[]) => void): this; } - export class Speaking extends BitField { - public static FLAGS: Record; - public static resolve(bit?: BitFieldResolvable): number; - } - export class Structures { public static get(structure: K): Extendable[K]; public static get(structure: string): (...args: any[]) => void; @@ -1374,6 +1354,34 @@ declare module 'discord.js' { public static resolve(bit?: BitFieldResolvable): number; } + export class Team extends Base { + constructor(client: Client, data: object); + public id: Snowflake; + public name: string; + public icon: string | null; + public ownerID: Snowflake | null; + public members: Collection; + + public readonly owner: TeamMember; + public readonly createdAt: Date; + public readonly createdTimestamp: number; + + public iconURL(options?: ImageURLOptions): string; + public toJSON(): object; + public toString(): string; + } + + export class TeamMember extends Base { + constructor(team: Team, data: object); + public team: Team; + public readonly id: Snowflake; + public permissions: string[]; + public membershipState: MembershipStates; + public user: User; + + public toString(): string; + } + export class TextChannel extends TextBasedChannel(GuildChannel) { constructor(guild: Guild, data?: object); public messages: MessageManager; @@ -1386,16 +1394,6 @@ declare module 'discord.js' { public fetchWebhooks(): Promise>; } - export class NewsChannel extends TextBasedChannel(GuildChannel) { - constructor(guild: Guild, data?: object); - public messages: MessageManager; - public nsfw: boolean; - public topic: string | null; - public createWebhook(name: string, options?: { avatar?: BufferResolvable | Base64Resolvable; reason?: string; }): Promise; - public setNSFW(nsfw: boolean, reason?: string): Promise; - public fetchWebhooks(): Promise>; - } - export class User extends PartialTextBasedChannel(Base) { constructor(client: Client, data: object); public avatar: string | null; @@ -1749,6 +1747,22 @@ declare module 'discord.js' { public resolveID(resolvable: R): K | null; } + export class GuildChannelManager extends BaseManager { + constructor(guild: Guild, iterable?: Iterable); + public guild: Guild; + public create(name: string, options: GuildCreateChannelOptions & { type: 'voice'; }): Promise; + public create(name: string, options: GuildCreateChannelOptions & { type: 'category'; }): Promise; + public create(name: string, options?: GuildCreateChannelOptions & { type?: 'text'; }): Promise; + public create(name: string, options: GuildCreateChannelOptions): Promise; + } + + export class GuildEmojiManager extends BaseManager { + constructor(guild: Guild, iterable?: Iterable); + public guild: Guild; + public create(attachment: BufferResolvable | Base64Resolvable, name: string, options?: GuildEmojiCreateOptions): Promise; + public resolveIdentifier(emoji: EmojiIdentifierResolvable): string | null; + } + export class GuildEmojiRoleManager { constructor(emoji: GuildEmoji); public emoji: GuildEmoji; @@ -1759,26 +1773,20 @@ declare module 'discord.js' { public remove(roleOrRoles: RoleResolvable | RoleResolvable[] | Collection): Promise; } - export class GuildEmojiManager extends BaseManager { - constructor(guild: Guild, iterable?: Iterable); - public guild: Guild; - public create(attachment: BufferResolvable | Base64Resolvable, name: string, options?: GuildEmojiCreateOptions): Promise; - public resolveIdentifier(emoji: EmojiIdentifierResolvable): string | null; + export class GuildManager extends BaseManager { + constructor(client: Client, iterable?: Iterable); + public create(name: string, options?: { region?: string; icon: BufferResolvable | Base64Resolvable | null; }): Promise; } - export class GuildChannelManager extends BaseManager { + export class GuildMemberManager extends BaseManager { constructor(guild: Guild, iterable?: Iterable); public guild: Guild; - public create(name: string, options: GuildCreateChannelOptions & { type: 'voice'; }): Promise; - public create(name: string, options: GuildCreateChannelOptions & { type: 'category'; }): Promise; - public create(name: string, options?: GuildCreateChannelOptions & { type?: 'text'; }): Promise; - public create(name: string, options: GuildCreateChannelOptions): Promise; - } - - // Hacky workaround because changing the signature of an overridden method errors - class OverridableManager extends BaseManager { - public add(data: any, cache: any): any; - public set(key: any): any; + public ban(user: UserResolvable, options?: BanOptions): Promise; + public fetch(options: UserResolvable | FetchMemberOptions): Promise; + public fetch(options?: FetchMembersOptions): Promise>; + public prune(options: GuildPruneMembersOptions & { dry?: false; count: false; }): Promise; + public prune(options?: GuildPruneMembersOptions): Promise; + public unban(user: UserResolvable, reason?: string): Promise; } export class GuildMemberRoleManager extends OverridableManager { @@ -1794,22 +1802,6 @@ declare module 'discord.js' { public remove(roleOrRoles: RoleResolvable | RoleResolvable[] | Collection, reason?: string): Promise; } - export class GuildMemberManager extends BaseManager { - constructor(guild: Guild, iterable?: Iterable); - public guild: Guild; - public ban(user: UserResolvable, options?: BanOptions): Promise; - public fetch(options: UserResolvable | FetchMemberOptions): Promise; - public fetch(options?: FetchMembersOptions): Promise>; - public prune(options: GuildPruneMembersOptions & { dry?: false; count: false; }): Promise; - public prune(options?: GuildPruneMembersOptions): Promise; - public unban(user: UserResolvable, reason?: string): Promise; - } - - export class GuildManager extends BaseManager { - constructor(client: Client, iterable?: Iterable); - public create(name: string, options?: { region?: string; icon: BufferResolvable | Base64Resolvable | null; }): Promise; - } - export class MessageManager extends BaseManager { constructor(channel: TextChannel | DMChannel, iterable?: Iterable); public channel: TextBasedChannelFields; @@ -1820,6 +1812,12 @@ declare module 'discord.js' { public delete(message: MessageResolvable, reason?: string): Promise; } + // Hacky workaround because changing the signature of an overridden method errors + class OverridableManager extends BaseManager { + public add(data: any, cache: any): any; + public set(key: any): any; + } + export class PresenceManager extends BaseManager { constructor(client: Client, iterable?: Iterable); } @@ -1894,6 +1892,8 @@ declare module 'discord.js' { function WebhookMixin(Base?: Constructable): Constructable; + function VolumeMixin(base: Constructable): Constructable; + interface WebhookFields { id: Snowflake; readonly createdAt: Date; @@ -1932,11 +1932,13 @@ declare module 'discord.js' { | 'WATCHING' | 'CUSTOM_STATUS'; - type MessageFlagsString = 'CROSSPOSTED' - | 'IS_CROSSPOST' - | 'SUPPRESS_EMBEDS' - | 'SOURCE_MESSAGE_DELETED' - | 'URGENT'; + interface AddGuildMemberOptions { + accessToken: string; + nick?: string; + roles?: Collection | RoleResolvable[]; + mute?: boolean; + deaf?: boolean; + } interface APIErrror { UNKNOWN_ACCOUNT: number; @@ -1985,25 +1987,12 @@ declare module 'discord.js' { REACTION_BLOCKED: number; } - interface AddGuildMemberOptions { - accessToken: string; - nick?: string; - roles?: Collection | RoleResolvable[]; - mute?: boolean; - deaf?: boolean; - } - interface AuditLogChange { key: string; old?: any; new?: any; } - interface ImageURLOptions { - format?: ImageExt; - size?: ImageSize; - } - interface AwaitMessagesOptions extends MessageCollectorOptions { errors?: string[]; } @@ -2084,6 +2073,21 @@ declare module 'discord.js' { http?: HTTPOptions; } + type ClientPresenceStatus = 'online' | 'idle' | 'dnd'; + + interface ClientPresenceStatusData { + web?: ClientPresenceStatus; + mobile?: ClientPresenceStatus; + desktop?: ClientPresenceStatus; + } + + interface CloseEvent { + wasClean: boolean; + code: number; + reason: string; + target: WebSocket; + } + type CollectorFilter = (...args: any[]) => boolean; interface CollectorOptions { @@ -2122,6 +2126,13 @@ declare module 'discord.js' { | number | string; + interface CrosspostedChannel { + channelID: Snowflake; + guildID: Snowflake; + type: keyof typeof ChannelType; + name: string; + } + interface DeconstructedSnowflake { timestamp: number; readonly date: Date; @@ -2133,11 +2144,6 @@ declare module 'discord.js' { type DefaultMessageNotifications = 'ALL' | 'MENTIONS'; - interface GuildEmojiEditData { - name?: string; - roles?: Collection | RoleResolvable[]; - } - interface EmbedField { name: string; value: string; @@ -2154,6 +2160,25 @@ declare module 'discord.js' { type EmojiResolvable = Snowflake | GuildEmoji | ReactionEmoji; + interface ErrorEvent { + error: any; + message: string; + type: string; + target: WebSocket; + } + + interface EscapeMarkdownOptions { + codeBlock?: boolean; + inlineCode?: boolean; + bold?: boolean; + italic?: boolean; + underline?: boolean; + strikethrough?: boolean; + spoiler?: boolean; + inlineCodeContent?: boolean; + codeBlockContent?: boolean; + } + interface Extendable { GuildEmoji: typeof GuildEmoji; DMChannel: typeof DMChannel; @@ -2187,17 +2212,6 @@ declare module 'discord.js' { name?: string; } - interface MessageActivity { - partyID: string; - type: number; - } - - interface MessageReference { - channelID: string; - guildID: string; - messageID: string | null; - } - type GuildAuditLogsAction = keyof GuildAuditLogsActions; interface GuildAuditLogsActions { @@ -2286,11 +2300,6 @@ declare module 'discord.js' { name?: string; } - interface GuildEmojiCreateOptions { - roles?: Collection | RoleResolvable[]; - reason?: string; - } - interface GuildEditData { name?: string; region?: string; @@ -2312,6 +2321,16 @@ declare module 'discord.js' { channel: GuildChannelResolvable | null; } + interface GuildEmojiCreateOptions { + roles?: Collection | RoleResolvable[]; + reason?: string; + } + + interface GuildEmojiEditData { + name?: string; + roles?: Collection | RoleResolvable[]; + } + type GuildFeatures = 'ANIMATED_ICON' | 'BANNER' | 'COMMERCE' @@ -2366,6 +2385,11 @@ declare module 'discord.js' { | 1024 | 2048; + interface ImageURLOptions { + format?: ImageExt; + size?: ImageSize; + } + interface IntegrationData { id: string; type: string; @@ -2394,13 +2418,18 @@ declare module 'discord.js' { type MembershipStates = 'INVITED' | 'ACCEPTED'; + type MessageAdditions = MessageEmbed | MessageAttachment | (MessageEmbed | MessageAttachment)[]; + + interface MessageActivity { + partyID: string; + type: number; + } + interface MessageCollectorOptions extends CollectorOptions { max?: number; maxProcessed?: number; } - type MessageAdditions = MessageEmbed | MessageAttachment | (MessageEmbed | MessageAttachment)[]; - interface MessageEditOptions { content?: string; embed?: MessageEmbedOptions | null; @@ -2408,6 +2437,26 @@ declare module 'discord.js' { flags?: BitFieldResolvable; } + interface MessageEmbedAuthor { + name?: string; + url?: string; + iconURL?: string; + proxyIconURL?: string; + } + + interface MessageEmbedFooter { + text?: string; + iconURL?: string; + proxyIconURL?: string; + } + + interface MessageEmbedImage { + url: string; + proxyURL?: string; + height?: number; + width?: number; + } + interface MessageEmbedOptions { title?: string; description?: string; @@ -2423,11 +2472,9 @@ declare module 'discord.js' { footer?: Partial & { icon_url?: string; proxy_icon_url?: string; }; } - interface MessageEmbedAuthor { - name?: string; - url?: string; - iconURL?: string; - proxyIconURL?: string; + interface MessageEmbedProvider { + name: string; + url: string; } interface MessageEmbedThumbnail { @@ -2437,24 +2484,6 @@ declare module 'discord.js' { width?: number; } - interface MessageEmbedFooter { - text?: string; - iconURL?: string; - proxyIconURL?: string; - } - - interface MessageEmbedImage { - url: string; - proxyURL?: string; - height?: number; - width?: number; - } - - interface MessageEmbedProvider { - name: string; - url: string; - } - interface MessageEmbedVideo { url?: string; proxyURL?: string; @@ -2462,6 +2491,18 @@ declare module 'discord.js' { width?: number; } + interface MessageEvent { + data: WebSocket.Data; + type: string; + target: WebSocket; + } + + type MessageFlagsString = 'CROSSPOSTED' + | 'IS_CROSSPOST' + | 'SUPPRESS_EMBEDS' + | 'SOURCE_MESSAGE_DELETED' + | 'URGENT'; + interface MessageOptions { tts?: boolean; nonce?: string; @@ -2476,6 +2517,12 @@ declare module 'discord.js' { type MessageReactionResolvable = MessageReaction | Snowflake; + interface MessageReference { + channelID: string; + guildID: string; + messageID: string | null; + } + type MessageResolvable = Message | Snowflake; type MessageTarget = TextChannel | DMChannel | User | GuildMember | Webhook | WebhookClient; @@ -2513,6 +2560,8 @@ declare module 'discord.js' { interface PermissionOverwriteOption extends Partial> { } + type PermissionResolvable = BitFieldResolvable; + type PermissionString = 'CREATE_INSTANT_INVITE' | 'KICK_MEMBERS' | 'BAN_MEMBERS' @@ -2546,8 +2595,6 @@ declare module 'discord.js' { interface RecursiveArray extends Array> { } - type PermissionResolvable = BitFieldResolvable; - interface PermissionOverwriteOptions { allow: PermissionResolvable; deny: PermissionResolvable; @@ -2569,20 +2616,6 @@ declare module 'discord.js' { type PresenceResolvable = Presence | UserResolvable | Snowflake; - type ClientPresenceStatus = 'online' | 'idle' | 'dnd'; - - interface ClientPresenceStatusData { - web?: ClientPresenceStatus; - mobile?: ClientPresenceStatus; - desktop?: ClientPresenceStatus; - } - - type PartialTypes = 'USER' - | 'CHANNEL' - | 'GUILD_MEMBER' - | 'MESSAGE' - | 'REACTION'; - type Partialize = { id: string; partial: true; @@ -2591,11 +2624,17 @@ declare module 'discord.js' { [K in keyof Omit]: T[K] | null; }; - interface PartialMessage extends Partialize {} interface PartialChannel extends Partialize {} interface PartialGuildMember extends Partialize {} + interface PartialMessage extends Partialize {} interface PartialUser extends Partialize {} + type PartialTypes = 'USER' + | 'CHANNEL' + | 'GUILD_MEMBER' + | 'MESSAGE' + | 'REACTION'; + type PresenceStatus = ClientPresenceStatus | 'offline'; type PresenceStatusData = ClientPresenceStatus | 'invisible'; @@ -2746,44 +2785,5 @@ declare module 'discord.js' { | 'VOICE_SERVER_UPDATE' | 'WEBHOOKS_UPDATE'; - interface MessageEvent { - data: WebSocket.Data; - type: string; - target: WebSocket; - } - - interface CloseEvent { - wasClean: boolean; - code: number; - reason: string; - target: WebSocket; - } - - interface ErrorEvent { - error: any; - message: string; - type: string; - target: WebSocket; - } - - interface CrosspostedChannel { - channelID: Snowflake; - guildID: Snowflake; - type: keyof typeof ChannelType; - name: string; - } - - interface EscapeMarkdownOptions { - codeBlock?: boolean; - inlineCode?: boolean; - bold?: boolean; - italic?: boolean; - underline?: boolean; - strikethrough?: boolean; - spoiler?: boolean; - inlineCodeContent?: boolean; - codeBlockContent?: boolean; - } - //#endregion }