Updated restoreradio.js

This commit is contained in:
Christer Warén 2021-09-05 23:42:17 +03:00
parent 3b0f8068c1
commit 2d9b0ce732

View File

@ -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({