mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-02 05:43:37 +00:00
Updated code
This commit is contained in:
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user