From 0592a2b562570bc11b80dad2ba0f8d2fc313f403 Mon Sep 17 00:00:00 2001 From: Lamp Date: Wed, 15 Aug 2018 13:10:51 -0700 Subject: [PATCH] they changed voiceStateUpdate --- src/misc.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/misc.js b/src/misc.js index 747c1d2..9d218c1 100755 --- a/src/misc.js +++ b/src/misc.js @@ -16,13 +16,13 @@ (async function(){ var vcid = config.channels.voice; var rid = config.roles.viewing_deleted_channels; - dClient.on('voiceStateUpdate', async (oldMember, newMember) => { - if (oldMember.voiceChannelID != vcid && newMember.voiceChannelID == vcid) { + dClient.on('voiceStateUpdate', async (oldState, newState) => { + if (oldState.channelID != vcid && newState.channelID == vcid) { // member joined the channel - newMember.roles.add(newMember.guild.roles.get(rid)); - } else if (oldMember.voiceChannelID == vcid && newMember.voiceChannelID != vcid) { + newState.member.roles.add(newState.member.guild.roles.get(rid)); + } else if (oldState.channelI == vcid && newState.channelID != vcid) { // member left the channel - newMember.roles.remove(newMember.guild.roles.get(rid)); + newState.member.roles.remove(newState.member.guild.roles.get(rid)); } }); })(); \ No newline at end of file