mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 17:43:38 +00:00
Some changes
This commit is contained in:
17
struct/funcs/msToTime.js
Normal file
17
struct/funcs/msToTime.js
Normal file
@ -0,0 +1,17 @@
|
||||
module.exports = function msToTime(duration, format) {
|
||||
var seconds = Math.floor((duration / 1000) % 60),
|
||||
minutes = Math.floor((duration / (1000 * 60)) % 60),
|
||||
hours = Math.floor((duration / (1000 * 60 * 60)) % 24);
|
||||
days = Math.floor((duration / (1000 * 60 * 60 * 24)) % 24);
|
||||
|
||||
days = (days < 10) ? "0" + days : days;
|
||||
hours = (hours < 10) ? "0" + hours : hours;
|
||||
minutes = (minutes < 10) ? "0" + minutes : minutes;
|
||||
seconds = (seconds < 10) ? "0" + seconds : seconds;
|
||||
|
||||
if (format === "hh:mm:ss") {
|
||||
return `${hours}:${minutes}:${seconds}`;
|
||||
} else if (format === "dd:hh:mm:ss") {
|
||||
return `${days}:${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
}
|
@ -13,7 +13,6 @@ module.exports = async function (guild, client, url) {
|
||||
});
|
||||
dispatcher.on('error', error => {
|
||||
console.error(error);
|
||||
client.channels.fetch(client.config.debug_channel).send('Error with the dispatcher: ' + error);
|
||||
radio.voiceChannel.leave();
|
||||
client.radio.delete(guild.id);
|
||||
return radio.textChannel.send('<:redx:674263474704220182> An error has occured while playing radio!');
|
||||
|
Reference in New Issue
Block a user