1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-09-19 22:11:55 +00:00
This commit is contained in:
Christer Warén 2024-03-06 02:32:44 +02:00
parent 75a080a399
commit 09c6d5b117
5 changed files with 9 additions and 39 deletions

View File

@ -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] });
},
};

View File

@ -43,7 +43,7 @@ module.exports = {
} }
let song = { let song = {
id: video.id, id: video.id,
title: video.title, title: he.decode(video.title),
url: `https://www.youtube.com/watch?v=${video.id}` url: `https://www.youtube.com/watch?v=${video.id}`
} }
client.global.db.playlists[message.guild.id].songs.push(song); client.global.db.playlists[message.guild.id].songs.push(song);

View File

@ -17,9 +17,9 @@ module.exports = {
{ name: 'announcesongs', value: 'Whether to announce songs that start playing or not.' }, { 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.' } { 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 <Setting name> <value>` }) .setFooter({ text: `how to use: ${prefix}settings <name> <value>` })
.setAuthor({ name: client.user.username, iconURL: client.user.avatarURL()}) .setAuthor({ name: client.user.username, iconURL: client.user.avatarURL() })
.setColor(client.embedColor) .setColor(client.config.embedColor)
const permissions = message.channel.permissionsFor(message.author); 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 (!permissions.has(PermissionFlagsBits.ManageGuild)) return message.channel.send(':x: You need the `MANAGE_SERVER` permission to change the settings!');
if (args[1]) { if (args[1]) {

View File

@ -6,17 +6,17 @@ module.exports = {
description: 'Status command.', description: 'Status command.',
alias: 'status', alias: 'status',
cooldown: 5, cooldown: 5,
execute(message, args, client, prefix) { async execute(message, args, client, prefix) {
const uptime = client.funcs.msToTime(client.uptime); const uptime = client.funcs.msToTime(client.uptime);
const ping = Math.floor(client.ws.ping * 10) / 10; const ping = Math.floor(client.ws.ping * 10) / 10;
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setTitle(`Status for ${client.user.username}`) .setTitle(`Status for ${client.user.username}`)
.addFields( .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: ':stopwatch: Uptime', value: uptime, inline: true },
{ name: ':play_pause: Currently playing music on', value: `${getVoiceConnections.size} guild(s)`, inline: true }, { name: ':play_pause: Currently playing music on', value: `${getVoiceConnections.size ?? 0} guild(s)`, inline: true },
{ name: '💿 Operating system', value: process.platform, inline: true } { name: ':cd: Operating system', value: process.platform, inline: true }
) )
.setAuthor({ name: client.user.username, iconURL: client.user.avatarURL()}) .setAuthor({ name: client.user.username, iconURL: client.user.avatarURL()})
.setColor(client.config.embedColor) .setColor(client.config.embedColor)

View File

@ -3,7 +3,7 @@ const { createAudioPlayer, getVoiceConnection, joinVoiceChannel, NoSubscriberBeh
module.exports = async function (video, message, voiceChannel, client, playlist = false) { module.exports = async function (video, message, voiceChannel, client, playlist = false) {
let song = { let song = {
id: video.id, id: video.id,
title: video.title, title: he.decode(video.title),
url: `https://www.youtube.com/watch?v=${video.id}`, url: `https://www.youtube.com/watch?v=${video.id}`,
author: message.author author: message.author
} }