From 5f28f4275ec97c72701ed603a05d716553fb4b2a Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Sat, 6 Aug 2022 22:35:01 +0500 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=B6=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/JaBa.js | 2 +- commands/Music/play.js | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/base/JaBa.js b/base/JaBa.js index 6e6c854a..3730aa55 100644 --- a/base/JaBa.js +++ b/base/JaBa.js @@ -68,7 +68,7 @@ class JaBa extends Client { if (track.durationMS > 1) { setTimeout(() => { if (m.deletable) m.delete(); - }, track.durationMS * 1000); + }, track.durationMS); } else { setTimeout(() => { if (m.deletable) m.delete(); diff --git a/commands/Music/play.js b/commands/Music/play.js index 65e1d219..ae8497fb 100644 --- a/commands/Music/play.js +++ b/commands/Music/play.js @@ -36,10 +36,10 @@ class Play extends BaseCommand { async execute(client, interaction) { await interaction.deferReply(); const voice = interaction.member.voice.channel; - if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL"); + if (!voice) return interaction.editReply({ content: interaction.translate("music/play:NO_VOICE_CHANNEL") }); const query = interaction.options.getString("query"); const perms = voice.permissionsFor(client.user); - if (!perms.has(PermissionsBitField.Flags.Connect) || !perms.has(PermissionsBitField.Flags.Speak)) return interaction.error("music/play:VOICE_CHANNEL_CONNECT"); + if (!perms.has(PermissionsBitField.Flags.Connect) || !perms.has(PermissionsBitField.Flags.Speak)) return interaction.editReply({ content: interaction.translate("music/play:VOICE_CHANNEL_CONNECT") }); const searchResult = await client.player.search(query, { requestedBy: interaction.user, @@ -75,10 +75,12 @@ class Play extends BaseCommand { }); } catch (e) { client.player.deleteQueue(interaction.guildId); - interaction.error("music/play:ERR_OCCURRED", { - error: e - }); console.error(e); + return interaction.editReply({ + content: interaction.translate("music/play:ERR_OCCURRED", { + error: e + }) + }); } } }