From ef138fd3e9fc4f7bc393bab6a8e053d75a131e0a Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Sat, 7 Apr 2018 15:29:38 +0100 Subject: [PATCH] voice: fix #2380 (voiceSessionID null after changing server region) --- src/structures/Guild.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/structures/Guild.js b/src/structures/Guild.js index f06d1708a..a0824aabd 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -69,6 +69,7 @@ class Guild extends Base { } } + /* eslint-disable complexity */ /** * Sets up the guild. * @param {*} data The raw data of the guild @@ -210,7 +211,7 @@ class Guild extends Base { } } - this.voiceStates = new VoiceStateCollection(this); + if (!this.voiceStates) this.voiceStates = new VoiceStateCollection(this); if (data.voice_states) { for (const voiceState of data.voice_states) this.voiceStates.set(voiceState.user_id, voiceState); }