From 09c6d5b117139a5b9ffafb2170266db2b8bb2bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Wed, 6 Mar 2024 02:32:44 +0200 Subject: [PATCH] Update --- commands/cmduses.js | 30 ------------------------------ commands/playlist/add.js | 2 +- commands/settings.js | 6 +++--- commands/status.js | 8 ++++---- funcs/handleVideo.js | 2 +- 5 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 commands/cmduses.js diff --git a/commands/cmduses.js b/commands/cmduses.js deleted file mode 100644 index bd97a0c2..00000000 --- a/commands/cmduses.js +++ /dev/null @@ -1,30 +0,0 @@ -const { EmbedBuilder } = require("discord.js"); - -module.exports = { - name: 'cmduses', - usage: '', - description: 'Command usage statistics', - uses: 0, - async execute(msg, args, client) { - const cmduses = []; - client.commands.forEach((value, key) => { - cmduses.push([key, value.uses]); - }); - cmduses.sort((a, b) => { - return b[1] - a[1]; - }); - const cmdnamelength = Math.max(...cmduses.map(x => x[0].length)) + 4; - const numberlength = Math.max(...cmduses.map(x => x[1].toString().length), 4); - const markdownrows = ['Command' + ' '.repeat(cmdnamelength - 'command'.length) + ' '.repeat(numberlength - 'uses'.length) + 'Uses']; - cmduses.forEach(x => { - if (x[1] > 0) markdownrows.push(x[0] + '.'.repeat(cmdnamelength - x[0].length) + ' '.repeat(numberlength - x[1].toString().length) + x[1].toString()); - }); - const embed = new EmbedBuilder(); - embed - .setTitle('Musix Command Usage During Current Uptime') - .setDescription('```ml\n' + markdownrows.join('\n') + '\n```') - .setFooter({ text: 'These statistics are from the current uptime.' }) - .setColor(client.config.embedColor); - msg.channel.send({ embeds: [embed] }); - }, -}; diff --git a/commands/playlist/add.js b/commands/playlist/add.js index ce871ab8..99d03546 100644 --- a/commands/playlist/add.js +++ b/commands/playlist/add.js @@ -43,7 +43,7 @@ module.exports = { } let song = { id: video.id, - title: video.title, + title: he.decode(video.title), url: `https://www.youtube.com/watch?v=${video.id}` } client.global.db.playlists[message.guild.id].songs.push(song); diff --git a/commands/settings.js b/commands/settings.js index 98ffd876..84655d09 100644 --- a/commands/settings.js +++ b/commands/settings.js @@ -17,9 +17,9 @@ module.exports = { { name: 'announcesongs', value: 'Whether to announce songs that start playing or not.' }, { name: 'songselection', value: 'Will i ask to select a song from the top 10 queries or start playing the first result instantly.' } ) - .setFooter({ text: `how to use: ${prefix}settings ` }) - .setAuthor({ name: client.user.username, iconURL: client.user.avatarURL()}) - .setColor(client.embedColor) + .setFooter({ text: `how to use: ${prefix}settings ` }) + .setAuthor({ name: client.user.username, iconURL: client.user.avatarURL() }) + .setColor(client.config.embedColor) const permissions = message.channel.permissionsFor(message.author); if (!permissions.has(PermissionFlagsBits.ManageGuild)) return message.channel.send(':x: You need the `MANAGE_SERVER` permission to change the settings!'); if (args[1]) { diff --git a/commands/status.js b/commands/status.js index 275abc6b..25719113 100644 --- a/commands/status.js +++ b/commands/status.js @@ -6,17 +6,17 @@ module.exports = { description: 'Status command.', alias: 'status', cooldown: 5, - execute(message, args, client, prefix) { + async execute(message, args, client, prefix) { const uptime = client.funcs.msToTime(client.uptime); const ping = Math.floor(client.ws.ping * 10) / 10; const embed = new EmbedBuilder() .setTitle(`Status for ${client.user.username}`) .addFields( - { name: ':signal_strength: Ping', value: ping, inline: true }, + { name: ':signal_strength: Ping', value: ping + ' ms', inline: true }, { name: ':stopwatch: Uptime', value: uptime, inline: true }, - { name: ':play_pause: Currently playing music on', value: `${getVoiceConnections.size} guild(s)`, inline: true }, - { name: '💿 Operating system', value: process.platform, inline: true } + { name: ':play_pause: Currently playing music on', value: `${getVoiceConnections.size ?? 0} guild(s)`, inline: true }, + { name: ':cd: Operating system', value: process.platform, inline: true } ) .setAuthor({ name: client.user.username, iconURL: client.user.avatarURL()}) .setColor(client.config.embedColor) diff --git a/funcs/handleVideo.js b/funcs/handleVideo.js index 1d59bc7e..ef987f94 100644 --- a/funcs/handleVideo.js +++ b/funcs/handleVideo.js @@ -3,7 +3,7 @@ const { createAudioPlayer, getVoiceConnection, joinVoiceChannel, NoSubscriberBeh module.exports = async function (video, message, voiceChannel, client, playlist = false) { let song = { id: video.id, - title: video.title, + title: he.decode(video.title), url: `https://www.youtube.com/watch?v=${video.id}`, author: message.author }