From 2d9b0ce732ff2a9e1f756ba21b556ca26bd07518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sun, 5 Sep 2021 23:42:17 +0300 Subject: [PATCH] Updated restoreradio.js --- src/client/restoreradio.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/restoreradio.js b/src/client/restoreradio.js index 4916bbc..0bde4c3 100644 --- a/src/client/restoreradio.js +++ b/src/client/restoreradio.js @@ -13,6 +13,10 @@ module.exports = { let state = client.funcs.loadState(client, guild); if(!state) return; if(!state.station || !state.channels.voice || !state.channels.text) return; + let voiceChannel = client.channels.cache.get(state.channels.voice); + if(!voiceChannel) return; + if(voiceChannel.members.size === 0) return; + const sstation = await client.funcs.searchStation(state.station.name, client); let url = sstation.stream[sstation.stream.default]; @@ -29,7 +33,6 @@ module.exports = { client.radio.set(guild.id, construct); try { - let voiceChannel = client.channels.cache.get(state.channels.voice); const connection = getVoiceConnection(guild.id) ?? joinVoiceChannel({