mirror of
https://github.com/musix-org/musix-oss
synced 2025-07-07 01:20:48 +00:00
Fix code to work on this decade 1/x
This commit is contained in:
@ -1,12 +1,13 @@
|
||||
const { EmbedBuilder } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
name: "nowplaying",
|
||||
alias: ["np", "playing"],
|
||||
usage: "",
|
||||
description: "See the currently playing song position and length.",
|
||||
onlyDev: false,
|
||||
permission: "none",
|
||||
category: "info",
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
async execute(msg, args, client, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (!queue || !queue.songs[0] || !queue.connection || !queue.connection.dispatcher) return msg.channel.send(client.messages.noServerQueue);
|
||||
let songTime = (queue.songs[0].info.lengthSeconds * 1000).toFixed(0);
|
||||
@ -24,7 +25,7 @@ module.exports = {
|
||||
array.push("⎯");
|
||||
}
|
||||
const thumbnail = queue.songs[0].info.thumbnail.thumbnails[4] || queue.songs[0].info.thumbnail.thumbnails[3] || queue.songs[0].info.thumbnail.thumbnails[2] || queue.songs[0].info.thumbnail.thumbnails[1] || queue.songs[0].info.thumbnail.thumbnails[0];
|
||||
const embed = new Discord.MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(client.messages.nowPlaying)
|
||||
.setDescription(
|
||||
`${client.messages.nowPlayingDesc} ${
|
||||
@ -34,7 +35,7 @@ module.exports = {
|
||||
"hh:mm:ss"
|
||||
)} / ${client.funcs.msToTime(songTime, "hh:mm:ss")}\`\nchannel: \`${queue.songs[0].info.author.name}\``
|
||||
)
|
||||
.setFooter(`Queued by ${queue.songs[0].author.tag}`)
|
||||
.setFooter({ text: `Queued by ${queue.songs[0].author.tag}`})
|
||||
.setURL(queue.songs[0].url)
|
||||
.setThumbnail(thumbnail.url)
|
||||
.setColor(client.config.embedColor);
|
||||
@ -44,4 +45,4 @@ module.exports = {
|
||||
);
|
||||
return msg.channel.send(embed);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user