1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 00:23:17 +00:00

Update seek.js

This commit is contained in:
MatteZ02 2020-06-11 14:59:07 +03:00
parent 860d68162d
commit 5eb85500ed

View File

@ -7,12 +7,10 @@ module.exports = {
permission: "MANAGE_MESSAGES", permission: "MANAGE_MESSAGES",
category: "music", category: "music",
async execute(msg, args, client, Discord, command) { async execute(msg, args, client, Discord, command) {
const ytdl = require("ytdl-core");
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.nigthCore) if (queue.nigthCore)
return msg.channel.send(client.messages.disableNigthCore); return msg.channel.send(client.messages.disableNigthCore);
let data = await Promise.resolve(ytdl.getInfo(queue.songs[0].url));
if (!args[1]) if (!args[1])
return msg.channel.send( return msg.channel.send(
`${client.messages.correctUsage}\`${ `${client.messages.correctUsage}\`${
@ -26,9 +24,9 @@ module.exports = {
let message; let message;
message = client.messages.seekMax.replace( message = client.messages.seekMax.replace(
"%LENGTH%", "%LENGTH%",
data.videoDetails.lengthSeconds queue.songs[0].info.lengthSeconds
); );
if (pos > data.videoDetais.lengthSeconds) return msg.channel.send(message); if (pos > queue.songs[0].info.lengthSeconds) return msg.channel.send(message);
} }
client.funcs.end(client, msg, pos, command); client.funcs.end(client, msg, pos, command);
} }