From b4a24de8cd510228c2a22411da9a5dd3adf0cf7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sat, 11 Sep 2021 17:16:11 +0300 Subject: [PATCH] Update play command --- src/client/commands/play.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/client/commands/play.js b/src/client/commands/play.js index cdbd6b4..3184e8f 100644 --- a/src/client/commands/play.js +++ b/src/client/commands/play.js @@ -1,5 +1,4 @@ const { - createAudioPlayer, getVoiceConnection, joinVoiceChannel } = require("@discordjs/voice"); @@ -79,7 +78,6 @@ module.exports = { ephemeral: true }); } else { - url = client.stations[number].stream[client.stations[number].stream.default]; station = client.stations[number]; } } else { @@ -92,19 +90,17 @@ module.exports = { content: client.messageEmojis["error"] + client.messages.noSearchResults, ephemeral: true }); - url = sstation.stream[sstation.stream.default]; station = sstation; } if (radio) { client.funcs.statisticsUpdate(client, interaction.guild, radio); - radio.audioPlayer.stop(); let date = new Date(); radio.station = station; radio.textChannel = interaction.channel; radio.startTime = date.getTime(); - client.funcs.play(interaction, interaction.guild, client, url); + client.funcs.play(client, interaction, interaction.guild, station); return; } @@ -114,7 +110,6 @@ module.exports = { voiceChannel: voiceChannel, connection: null, message: null, - audioPlayer: createAudioPlayer(), station: station }; client.radio.set(interaction.guild.id, construct); @@ -130,7 +125,7 @@ module.exports = { construct.connection = connection; let date = new Date(); construct.startTime = date.getTime(); - client.funcs.play(interaction, interaction.guild, client, url); + client.funcs.play(client, interaction, interaction.guild, station); client.datastore.checkEntry(interaction.guild.id); construct.currentGuild = client.datastore.getEntry(interaction.guild.id);