mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 12:23:38 +00:00
Some changes
This commit is contained in:
@ -15,7 +15,7 @@ module.exports = class extends Client {
|
||||
this.radio = new Map();
|
||||
this.funcs = {};
|
||||
this.dispatcher = {};
|
||||
this.config = require('./config/config.js');
|
||||
this.config = require('../config.js');
|
||||
|
||||
fs.readdirSync(path.join(__dirname, 'funcs')).forEach(filename => {
|
||||
this.funcs[filename.slice(0, -3)] = require(`./funcs/${filename}`);
|
||||
|
@ -1,22 +0,0 @@
|
||||
require('dotenv/config');
|
||||
|
||||
module.exports = {
|
||||
//credentials
|
||||
token: process.env.TOKEN,
|
||||
devToken: process.env.DEVTOKEN,
|
||||
//support guild
|
||||
supportGuild: "https://discord.gg/rRA65Mn",
|
||||
//channels
|
||||
debug_channel: "634718645188034560",
|
||||
primary_test_channel: "617633098296721409",
|
||||
secondary_test_channel: "570531724002328577",
|
||||
devId: "360363051792203779",
|
||||
//misc
|
||||
embedColor: "",
|
||||
invite: "https://discordapp.com/api/oauth2/authorize?client_id=684109535312609409&permissions=3427328&scope=bot",
|
||||
//Settings
|
||||
devMode: false,
|
||||
prefix: "rx>",
|
||||
devPrefix: "-",
|
||||
volume: 5,
|
||||
}
|
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