mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 15:43:38 +00:00
Large update
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
module.exports = function (msg, args, client, Discord, prefix, command) {
|
||||
const permissions = msg.channel.permissionsFor(msg.client.user);
|
||||
if (!permissions.has('EMBED_LINKS')) return msg.channel.send('<:redx:674263474704220182> I cannot send embeds (Embed links), make sure I have the proper permissions!');
|
||||
//if (!permissions.has('EXTERNAL_EMOJIS')) return msg.channel.send('<:redx:674263474704220182> I cannot use external emojis, make sure I have the proper permissions!'); DEPRACATED!
|
||||
try {
|
||||
command.uses++;
|
||||
command.execute(msg, args, client, Discord, prefix, command);
|
||||
@ -11,7 +10,7 @@ module.exports = function (msg, args, client, Discord, prefix, command) {
|
||||
.setTitle(`Musix ${error.toString()}`)
|
||||
.setDescription(error.stack.replace(/at /g, '**at **'))
|
||||
.setColor('#b50002');
|
||||
//client.channels.fetch(client.config.debug_channel).send(embed);
|
||||
client.debug_channel.send(embed);
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
@ -1,8 +0,0 @@
|
||||
module.exports = async function (client) {
|
||||
try {
|
||||
await client.channels.fetch(client.config.secondary_test_channel)
|
||||
.then(x => x.join());
|
||||
} catch (error) {
|
||||
client.channels.fetch(client.config.debug_channel).send("Error detected: " + error);
|
||||
}
|
||||
};
|
@ -1,29 +0,0 @@
|
||||
module.exports = async function (msg, voiceChannel, client, url) {
|
||||
const radio = client.radio.get(msg.guild.id);
|
||||
|
||||
if (radio) {
|
||||
radio.connection.dispatcher.end('Stopped');
|
||||
}
|
||||
|
||||
const construct = {
|
||||
textChannel: msg.channel,
|
||||
voiceChannel: voiceChannel,
|
||||
connection: null,
|
||||
playing: false,
|
||||
url: url,
|
||||
name: null,
|
||||
volume: client.config.volume,
|
||||
};
|
||||
client.radio.set(msg.guild.id, construct);
|
||||
|
||||
try {
|
||||
const connection = await voiceChannel.join();
|
||||
construct.connection = connection;
|
||||
client.funcs.play(msg.guild, client, url);
|
||||
} catch (error) {
|
||||
client.radio.delete(msg.guild.id);
|
||||
//client.channels.fetch(client.config.debug_channel).send("Error with connecting to voice channel: " + error);
|
||||
return msg.channel.send(`<:redx:674263474704220182> An error occured: ${error}`);
|
||||
}
|
||||
return;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
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}`;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user