1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-06-16 12:36:01 +00:00

Fix code to work on this decade 1/x

This commit is contained in:
Christer Warén
2024-02-09 11:53:30 +02:00
parent d609687957
commit 9049a5e6b8
53 changed files with 2455 additions and 1704 deletions

View File

@ -1,10 +1,11 @@
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'nowplaying',
description: 'Now playing command.',
alias: 'np',
cooldown: 5,
onlyDev: false,
async execute(message, args, client, Discord, prefix) {
async execute(message, args, client, prefix) {
const ytdl = require('ytdl-core');
const serverQueue = client.queue.get(message.guild.id);
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
@ -15,13 +16,12 @@ module.exports = {
let barlength = 30;
let completedpercent = ((completed / songtime) * barlength).toFixed(0);
let array = []; for (let i = 0; i < completedpercent - 1; i++) { array.push('⎯'); } array.push('⭗'); for (let i = 0; i < barlength - completedpercent - 1; i++) { array.push('⎯'); }
const embed = new Discord.RichEmbed()
const embed = new EmbedBuilder()
.setTitle("__Now playing__")
.setDescription(`🎶**Now playing:** ${serverQueue.songs[0].title}\n${array.join('')} | \`${client.funcs.msToTime(completed)} / ${client.funcs.msToTime(songtime)}\``)
.setFooter(`Queued by ${serverQueue.songs[0].author.tag}`)
.setFooter({ text: `Queued by ${serverQueue.songs[0].author.tag}` })
.setURL(serverQueue.songs[0].url)
.setColor(client.config.embedColor)
return message.channel.send(embed);
return message.channel.send({ embeds: [embed] });
}
};