Compare commits
2 Commits
9a8c889234
...
83a9a1f65c
Author | SHA1 | Date |
---|---|---|
Emily | 83a9a1f65c | |
Emily | f2aadf4953 |
|
@ -9,8 +9,7 @@ module.exports = class About extends Command {
|
||||||
super (name, category);
|
super (name, category);
|
||||||
this.name = name,
|
this.name = name,
|
||||||
this.description = 'Bot information and statistics',
|
this.description = 'Bot information and statistics',
|
||||||
this.category = category,
|
this.category = category;
|
||||||
this.usage = '/about';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async run (client, interaction, data) { //eslint-disable-line no-unused-vars
|
async run (client, interaction, data) { //eslint-disable-line no-unused-vars
|
||||||
|
@ -42,12 +41,12 @@ module.exports = class About extends Command {
|
||||||
.addFields([
|
.addFields([
|
||||||
{
|
{
|
||||||
name: 'General',
|
name: 'General',
|
||||||
value: `• Users: \`${userCount}\`\n• Servers: \`${client.guilds.cache.size}\`\n• Commands: \`${client.commands.size}\`\n• Uptime: \`${uptime}\``,
|
value: `» Users: \`${userCount}\`\n» Servers: \`${client.guilds.cache.size}\`\n» Commands: \`${client.commands.size}\`\n» Uptime: \`${uptime}\``,
|
||||||
inline: true
|
inline: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Technical',
|
name: 'Technical',
|
||||||
value: `• RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n• Woomy version: \`v${client.version} ${build}\`\n• discord.js version: \`v${version}\`\n• node.js version: \`${process.version}\``,
|
value: `» RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n» Woomy version: \`v${client.version} ${build}\`\n» discord.js version: \`v${version}\`\n» node.js version: \`${process.version}\``,
|
||||||
inline: true
|
inline: true
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
|
@ -0,0 +1,87 @@
|
||||||
|
const Command = require('../../base/Command.js');
|
||||||
|
|
||||||
|
module.exports = class Help extends Command {
|
||||||
|
constructor (name, category) {
|
||||||
|
super (name, category);
|
||||||
|
this.name = name,
|
||||||
|
this.description = 'Lists all the commands you can use',
|
||||||
|
this.options = [
|
||||||
|
{
|
||||||
|
type: 3,
|
||||||
|
name: 'command',
|
||||||
|
description: 'The command to get information on'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
this.usage = '/help [command]',
|
||||||
|
this.friendlyOptions = '`command` - The command to get information on',
|
||||||
|
this.category = category;
|
||||||
|
}
|
||||||
|
|
||||||
|
async run (client, interaction, data) { //eslint-disable-line no-unused-vars
|
||||||
|
const input = await interaction.options.get('command');
|
||||||
|
const bot = await interaction.guild.members.fetch(client.user.id, {force: true});
|
||||||
|
const categories = [];
|
||||||
|
|
||||||
|
client.commands.forEach(cmd => {
|
||||||
|
if (!categories.includes(cmd.category)) {
|
||||||
|
if (cmd.category === 'Developer' && !client.config.devIds.includes(interaction.user.id)) return;
|
||||||
|
categories.push(cmd.category);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (!input) {
|
||||||
|
const fields = [];
|
||||||
|
const embed = new client.EmbedBuilder()
|
||||||
|
.setTitle('Command list')
|
||||||
|
.setColor(bot.displayHexColor)
|
||||||
|
.setDescription(
|
||||||
|
`
|
||||||
|
» Use \`/help [command]\` to get full information on a specific command.
|
||||||
|
» [Click here](https://discord.gg/HCF8mdv) to join my support server if you need help!
|
||||||
|
» [Click here](https://discord.com/oauth2/authorize?client_id=${client.user.id}&permissions=2134240503&scope=bot) to invite me to your server!
|
||||||
|
`
|
||||||
|
)
|
||||||
|
.setFooter({text: 'Thank you for using Woomy! 🦑'});
|
||||||
|
|
||||||
|
categories.forEach(cat => {
|
||||||
|
let cmds = '`';
|
||||||
|
const filteredCmds = client.commands.filter(cmd => cmd.category === cat);
|
||||||
|
filteredCmds.forEach(cmd => {
|
||||||
|
cmds += (cmd.name + '`, `');
|
||||||
|
});
|
||||||
|
|
||||||
|
cmds = cmds.substr(0, cmds.length - 3);
|
||||||
|
|
||||||
|
fields.push({name: cat.toProperCase() + ':', value: cmds});
|
||||||
|
});
|
||||||
|
|
||||||
|
embed.addFields(fields);
|
||||||
|
|
||||||
|
return interaction.reply({ embeds: [embed] });
|
||||||
|
} else if (client.commands.has(input.value)) {
|
||||||
|
const command = await client.commands.get(input.value);
|
||||||
|
const embed = new client.EmbedBuilder()
|
||||||
|
.setTitle(`${command.category} -> ${command.name.toProperCase()}`)
|
||||||
|
.setColor(bot.user.hexAccentColor ?? bot.displayHexColor)
|
||||||
|
.setDescription(command.description)
|
||||||
|
.setFooter({ text: '<> = required, / = either/or, [] = optional'});
|
||||||
|
|
||||||
|
const fields = [];
|
||||||
|
|
||||||
|
if (command.usage !== 'No usage information provided.') {
|
||||||
|
fields.push({name: 'Usage:', value: command.usage});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (command.friendlyOptions !== 'No options provided.') {
|
||||||
|
fields.push({name: 'Options', value: command.friendlyOptions});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fields.length > 0) embed.addFields(fields);
|
||||||
|
|
||||||
|
return interaction.reply({ embeds: [embed] });
|
||||||
|
}
|
||||||
|
return interaction.reply(`${client.config.emojis.userError} A command of that name could not be found.`);
|
||||||
|
}
|
||||||
|
};
|
|
@ -6,7 +6,6 @@ module.exports = class Avatar extends Command {
|
||||||
super (name, category);
|
super (name, category);
|
||||||
this.name = name,
|
this.name = name,
|
||||||
this.description = 'View information on this server.',
|
this.description = 'View information on this server.',
|
||||||
this.usage = '/server',
|
|
||||||
this.category = category;
|
this.category = category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue