Updated code

This commit is contained in:
Christer Warén
2021-08-22 18:48:40 +03:00
parent 606dcc0ab3
commit 2fec81e84d
4 changed files with 20 additions and 11 deletions

View File

@ -7,6 +7,7 @@ module.exports = {
console.log('RadioX ' + client.config.version);
console.log('Internet Radio to your Discord guild');
console.log('(c)2020-2021 EximiaBots by Warén Group');
console.log('');
client.developers = "";
let user = "";
@ -24,7 +25,7 @@ module.exports = {
.then(client.funcs.checkFetchStatus)
.then(response => response.json());
} catch (error) {
console.error(error);
//console.error(error);
}
setInterval(async () => {
@ -33,7 +34,7 @@ module.exports = {
.then(client.funcs.checkFetchStatus)
.then(response => response.json());
} catch (error) {
console.error(error);
//console.error(error);
}
}, 3600000);

View File

@ -16,8 +16,9 @@ module.exports = {
if (newState.channel === null) {
client.funcs.statisticsUpdate(client, newState.guild, radio);
radio.connection = null;
radio.connection?.destroy();
radio.audioPlayer?.stop();
console.log("[Radio] Stream stopped" + " / " + newState.guild.id);
return client.radio.delete(newState.guild.id);
}
@ -39,6 +40,7 @@ module.exports = {
client.funcs.statisticsUpdate(client, newState.guild, radio);
radio.connection?.destroy();
radio.audioPlayer?.stop();
console.log("[Radio] Stream stopped" + " / " + newState.guild.id);
client.radio.delete(oldState.guild.id);
}
return;
@ -57,9 +59,10 @@ module.exports = {
client.funcs.statisticsUpdate(client, newState.guild, radio);
radio.connection?.destroy();
radio.audioPlayer?.stop();
console.log("[Radio] Stream stopped" + " / " + newState.guild.id);
client.radio.delete(newState.guild.id);
}
}, 120000);
}, 60000);
}
},
};