From f4cc50762138e97712e2af71c4ed11abc261500c Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Sun, 8 Mar 2020 17:03:39 +0200 Subject: [PATCH] updastye --- commands/nowplaying.js | 3 +-- commands/play.js | 3 ++- commands/stop.js | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/commands/nowplaying.js b/commands/nowplaying.js index 44112b2..9339a85 100644 --- a/commands/nowplaying.js +++ b/commands/nowplaying.js @@ -10,11 +10,10 @@ module.exports = { if (!radio) return msg.channel.send('<:redx:674263474704220182> There is nothing playing.'); if (!radio.playing) return msg.channel.send('<:redx:674263474704220182> There is nothing playing.'); radio.time = radio.connection.dispatcher.streamTime; - let completed = (radio.time.toFixed(0)); + const completed = (radio.time.toFixed(0)); const embed = new Discord.MessageEmbed() .setTitle("__Now playing__") .setDescription(`**Now playing:** ${radio.url}\n\`${client.funcs.msToTime(completed, "hh:mm:ss")}\``) - /*.setThumbnail(thumbnail._rejectionHandler0)*/ .setColor(client.config.embedColor) return msg.channel.send(embed); } diff --git a/commands/play.js b/commands/play.js index 66bdaf0..4b91928 100644 --- a/commands/play.js +++ b/commands/play.js @@ -24,7 +24,8 @@ module.exports = { } if (radio) { - radio.connection.dispatcher.end(); + radio.connection.dispatcher.destroy(); + client.funcs.play(msg.guild, client, url); } const construct = { diff --git a/commands/stop.js b/commands/stop.js index da2c970..f2d3dd6 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -7,7 +7,9 @@ module.exports = { category: 'music', execute(msg, args, client, Discord, prefix, command) { const radio = client.radio.get(msg.guild.id); - radio.connection.dispatcher.end(); + radio.connection.dispatcher.destroy(); + radio.voiceChannel.leave(); + client.radio.delete(guild.id); msg.channel.send('<:stop:674685626108477519> Stopped the music!'); } }; \ No newline at end of file