From 208b535da060516aa8f5ab89c3d3abfcabadfd6e Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Sun, 19 Jul 2020 14:37:25 +0300 Subject: [PATCH] Update seek.js --- src/commands/seek.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/commands/seek.js b/src/commands/seek.js index 71da4b08..56420c96 100644 --- a/src/commands/seek.js +++ b/src/commands/seek.js @@ -7,6 +7,7 @@ module.exports = { permission: "MANAGE_MESSAGES", category: "music control", async execute(msg, args, client, Discord, command) { + console.log("seek") const queue = client.queue.get(msg.guild.id); if (client.funcs.check(client, msg, command)) { if (queue.nightCore) @@ -18,19 +19,19 @@ module.exports = { }seek ${command.usage}\`` ); const pos = parseInt(args[1]); - if (isNaN(pos)) { - if (pos < 0) - return msg.channel.send(client.messages.seekingPointPositive); - const totalLength = parseInt(queue.songs[0].info.lengthSeconds); - let message; - if (pos > totalLength) { - message = client.messages.seekMax.replace( - "%LENGTH%", - queue.songs[0].info.lengthSeconds - ); - return msg.channel.send(message); - } + if (isNaN(pos)) return msg.channel.send(client.messages.validNumber); + if (pos < 0) + return msg.channel.send(client.messages.seekingPointPositive); + const totalLength = parseInt(queue.songs[0].info.lengthSeconds); + let message; + if (pos > totalLength) { + message = client.messages.seekMax.replace( + "%LENGTH%", + queue.songs[0].info.lengthSeconds + ); + return msg.channel.send(message); } + client.funcs.end(client, msg, pos, command); } },