1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 03:33:17 +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", permission: "MANAGE_MESSAGES",
category: "music control", category: "music control",
async execute(msg, args, client, Discord, command) { async execute(msg, args, client, Discord, command) {
console.log("seek")
const queue = client.queue.get(msg.guild.id); const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) { if (client.funcs.check(client, msg, command)) {
if (queue.nightCore) if (queue.nightCore)
@ -18,19 +19,19 @@ module.exports = {
}seek ${command.usage}\`` }seek ${command.usage}\``
); );
const pos = parseInt(args[1]); const pos = parseInt(args[1]);
if (isNaN(pos)) { if (isNaN(pos)) return msg.channel.send(client.messages.validNumber);
if (pos < 0) if (pos < 0)
return msg.channel.send(client.messages.seekingPointPositive); return msg.channel.send(client.messages.seekingPointPositive);
const totalLength = parseInt(queue.songs[0].info.lengthSeconds); const totalLength = parseInt(queue.songs[0].info.lengthSeconds);
let message; let message;
if (pos > totalLength) { if (pos > totalLength) {
message = client.messages.seekMax.replace( message = client.messages.seekMax.replace(
"%LENGTH%", "%LENGTH%",
queue.songs[0].info.lengthSeconds queue.songs[0].info.lengthSeconds
); );
return msg.channel.send(message); return msg.channel.send(message);
}
} }
client.funcs.end(client, msg, pos, command); client.funcs.end(client, msg, pos, command);
} }
}, },