1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-07-06 22:10:49 +00:00

Fix code to work on this decade 1/x

This commit is contained in:
Christer Warén
2024-02-10 09:33:59 +02:00
parent 99ecd9787d
commit 86b4676159
61 changed files with 3842 additions and 471 deletions

View File

@ -1,19 +1,20 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: 'help',
alias: ["h"],
usage: '<command(opt)>',
description: 'See the help for Musix.',
onlyDev: false,
permission: 'none',
category: 'info',
execute(msg, args, client, Discord, command) {
execute(msg, args, client, command) {
if (args[1]) {
if (!client.commands.has(args[1]) || (client.commands.has(args[1]) && client.commands.get(args[1]).omitFromHelp === true && msg.guild.id !== '489083836240494593')) return msg.channel.send('That command does not exist');
const command = client.commands.get(args[1]);
const embed = new Discord.MessageEmbed()
const embed = new EmbedBuilder()
.setTitle(`${client.global.db.guilds[msg.guild.id].prefix}${command.name} ${command.usage}`)
.setDescription(command.description)
.setFooter(`${client.messages.helpCmdFooter} \`${command.alias.map(a => `${a}, `)}\``)
.setFooter({ text:`${client.messages.helpCmdFooter} \`${command.alias.map(a => `${a}, `)}\`` })
.setColor(client.config.embedColor)
msg.channel.send(embed);
} else {
@ -23,16 +24,16 @@ module.exports = {
}
let commands = '';
for (let i = 0; i < categories.length; i++) {
commands += `**» ${categories[i].toUpperCase()}**\n${client.commands.filter(x => x.category === categories[i] && !x.omitFromHelp && !x.onlyDev).map(x => `\`${x.name}\``).join(', ')}\n`;
commands += `**» ${categories[i].toUpperCase()}**\n${client.commands.filter(x => x.category === categories[i] && !x.omitFromHelp).map(x => `\`${x.name}\``).join(', ')}\n`;
}
let message;
message = client.messages.helpFooter.replace("%PREFIX%", client.global.db.guilds[msg.guild.id].prefix);
const embed = new Discord.MessageEmbed()
const embed = new EmbedBuilder()
.setTitle(`${client.user.username} ${client.messages.helpTitle}`)
.setDescription(commands)
.setFooter(message)
.setFooter({ text: message })
.setColor(client.config.embedColor)
msg.channel.send(embed);
}
}
};
};