From cc8b44db9bce5a67df8579b648cc0be21e1ac6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Mon, 6 Sep 2021 22:35:14 +0300 Subject: [PATCH] Fixed next command --- src/client/commands/next.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/client/commands/next.js b/src/client/commands/next.js index 94d1f51..c4ae658 100644 --- a/src/client/commands/next.js +++ b/src/client/commands/next.js @@ -16,8 +16,6 @@ module.exports = { ephemeral: true }); - interaction.deferUpdate(); - let url = station.stream[station.stream.default]; client.funcs.statisticsUpdate(client, interaction.guild, radio); @@ -27,7 +25,14 @@ module.exports = { radio.station = station; radio.textChannel = interaction.channel; radio.startTime = date.getTime(); - client.funcs.play(null, interaction.guild, client, url); + + if(interaction.isCommand()) { + client.funcs.play(interaction, interaction.guild, client, url); + } + if(interaction.isButton()) { + interaction.deferUpdate(); + client.funcs.play(null, interaction.guild, client, url); + } } }