From a61cfc3004e84738e3155dd275800d92cb1a96d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Rom=C3=A1n?= Date: Fri, 18 Oct 2019 11:32:19 +0200 Subject: [PATCH] docs: VoiceStateUpdate always sends an instance of VoiceState (#3537) * docs: VoiceStateUpdate always sends the old * typings: Update definition for voiceStateUpdate event --- src/client/actions/VoiceStateUpdate.js | 2 +- typings/index.d.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/actions/VoiceStateUpdate.js b/src/client/actions/VoiceStateUpdate.js index 14e1aa3f8..386bf7783 100644 --- a/src/client/actions/VoiceStateUpdate.js +++ b/src/client/actions/VoiceStateUpdate.js @@ -33,7 +33,7 @@ class VoiceStateUpdate extends Action { /** * Emitted whenever a member changes voice state - e.g. joins/leaves a channel, mutes/unmutes. * @event Client#voiceStateUpdate - * @param {?VoiceState} oldState The voice state before the update + * @param {VoiceState} oldState The voice state before the update * @param {VoiceState} newState The voice state after the update */ client.emit(Events.VOICE_STATE_UPDATE, oldState, newState); diff --git a/typings/index.d.ts b/typings/index.d.ts index 52a9a39eb..6ff295469 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -197,7 +197,7 @@ declare module 'discord.js' { public on(event: 'roleUpdate', listener: (oldRole: Role, newRole: Role) => void): this; public on(event: 'typingStart' | 'typingStop', listener: (channel: Channel | PartialChannel, user: User | PartialUser) => void): this; public on(event: 'userUpdate', listener: (oldUser: User | PartialUser, newUser: User | PartialUser) => void): this; - public on(event: 'voiceStateUpdate', listener: (oldState: VoiceState | undefined, newState: VoiceState) => void): this; + public on(event: 'voiceStateUpdate', listener: (oldState: VoiceState, newState: VoiceState) => void): this; public on(event: 'webhookUpdate', listener: (channel: TextChannel) => void): this; public on(event: 'invalidated', listener: () => void): this; public on(event: 'shardDisconnect', listener: (event: CloseEvent, id: number) => void): this; @@ -234,7 +234,7 @@ declare module 'discord.js' { public once(event: 'roleUpdate', listener: (oldRole: Role, newRole: Role) => void): this; public once(event: 'typingStart' | 'typingStop', listener: (channel: Channel | PartialChannel, user: User | PartialUser) => void): this; public once(event: 'userUpdate', listener: (oldUser: User | PartialUser, newUser: User | PartialUser) => void): this; - public once(event: 'voiceStateUpdate', listener: (oldState: VoiceState | undefined, newState: VoiceState) => void): this; + public once(event: 'voiceStateUpdate', listener: (oldState: VoiceState, newState: VoiceState) => void): this; public once(event: 'webhookUpdate', listener: (channel: TextChannel) => void): this; public once(event: 'invalidated', listener: () => void): this; public once(event: 'shardDisconnect', listener: (event: CloseEvent, id: number) => void): this;