1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-22 21:13:18 +00:00

Update seek.js

This commit is contained in:
MatteZ02 2020-07-19 14:37:25 +03:00
parent 4e271b107e
commit 208b535da0

View File

@ -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);
}
},