2020-02-05 20:02:53 +00:00
|
|
|
module.exports = {
|
2020-04-19 17:00:16 +00:00
|
|
|
name: "nowplaying",
|
2020-05-15 16:05:39 +00:00
|
|
|
alias: ["np", "playing"],
|
2020-04-19 17:00:16 +00:00
|
|
|
usage: "",
|
|
|
|
description: "See the currently playing song position and length.",
|
|
|
|
onlyDev: false,
|
|
|
|
permission: "none",
|
|
|
|
category: "music",
|
|
|
|
async execute(msg, args, client, Discord, command) {
|
|
|
|
const queue = client.queue.get(msg.guild.id);
|
|
|
|
if (!queue) return msg.channel.send(client.messages.noServerQueue);
|
2020-06-09 18:25:55 +00:00
|
|
|
let songTime = (queue.songs[0].info.lengthSeconds * 1000).toFixed(0);
|
2020-04-19 17:00:16 +00:00
|
|
|
let completed = (
|
|
|
|
queue.connection.dispatcher.streamTime + queue.time
|
|
|
|
).toFixed(0);
|
2020-06-09 18:25:55 +00:00
|
|
|
let barlength = 30;
|
2020-04-19 17:00:16 +00:00
|
|
|
let completedpercent = ((completed / songTime) * barlength).toFixed(0);
|
|
|
|
let array = [];
|
|
|
|
for (let i = 0; i < completedpercent - 1; i++) {
|
|
|
|
array.push("⎯");
|
2020-02-05 20:02:53 +00:00
|
|
|
}
|
2020-06-09 18:25:55 +00:00
|
|
|
array.push("🔘");
|
2020-04-19 17:00:16 +00:00
|
|
|
for (let i = 0; i < barlength - completedpercent - 1; i++) {
|
|
|
|
array.push("⎯");
|
|
|
|
}
|
|
|
|
const embed = new Discord.MessageEmbed()
|
|
|
|
.setTitle(client.messages.nowPlaying)
|
|
|
|
.setDescription(
|
|
|
|
`${client.messages.nowPlayingDesc} ${
|
|
|
|
queue.songs[0].title
|
2020-06-09 18:25:55 +00:00
|
|
|
}\n\`${array.join("")}\`\n\`${client.funcs.msToTime(
|
2020-04-19 17:00:16 +00:00
|
|
|
completed,
|
|
|
|
"hh:mm:ss"
|
2020-06-09 18:25:55 +00:00
|
|
|
)} / ${client.funcs.msToTime(songTime, "hh:mm:ss")}\`\nchannel: \`${queue.songs[0].info.author.name}\``
|
2020-04-19 17:00:16 +00:00
|
|
|
)
|
|
|
|
.setFooter(`Queued by ${queue.songs[0].author.tag}`)
|
|
|
|
.setURL(queue.songs[0].url)
|
2020-07-01 18:44:05 +00:00
|
|
|
.setThumbnail(queue.songs[0].info.thumbnail.thumbnails[4].url || queue.songs[0].info.thumbnail.thumbnails[3].url || queue.songs[0].info.thumbnail.thumbnails[2].url || queue.songs[0].info.thumbnail.thumbnails[1].url || queue.songs[0].info.thumbnail.thumbnails[0].url)
|
2020-04-19 17:00:16 +00:00
|
|
|
.setColor(client.config.embedColor);
|
|
|
|
if (queue.nigthCore)
|
|
|
|
embed.setDescription(
|
2020-06-09 18:25:55 +00:00
|
|
|
`${client.messages.nowPlayingDesc} ${queue.songs[0].title} \nchannel: \`${queue.songs[0].info.author.name}\``
|
2020-04-19 17:00:16 +00:00
|
|
|
);
|
|
|
|
return msg.channel.send(embed);
|
|
|
|
},
|
2020-05-15 16:05:39 +00:00
|
|
|
};
|