28 lines
1.2 KiB
JavaScript
28 lines
1.2 KiB
JavaScript
const Revolt = require('revolt.js');
|
|
const { client, logger, config } = require('..');
|
|
|
|
module.exports.meta = {
|
|
name: 'help',
|
|
aliases: [ 'commands' ],
|
|
description: 'List all commands.'
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @param { Revolt.Message } message
|
|
* @param { string[] } args
|
|
*/
|
|
module.exports.run = async (message, args) => new Promise(async (resolve, reject) => {
|
|
let msgContent = `My current prefix is \`${config.prefix}\`. To add me to a group, hit me up with a friend request first.\n\u200b\n* * *\n\u200b\n`
|
|
+ `| Name | Aliases | Description |\n`
|
|
+ `| ---- | ------- | ----------- |\n`;
|
|
let userDevLvl = require('../util/dev').getDevLevel(message.author);
|
|
require('../util/command_loader').commands
|
|
.forEach(command => {
|
|
if (!command.meta.devLevel || command.meta.devLevel <= userDevLvl) // Ensure normal users don't see dev commands
|
|
msgContent += `| ${userDevLvl > 0 ? `\`[${command.meta.devLevel || 0}]\` ` : ''}${config.prefix}${command.meta.name}`
|
|
+ `| ${command.meta.aliases?.join(', ') || 'None'} | ${command.meta.description || 'None'}\n`;
|
|
});
|
|
|
|
await client.channels.sendMessage(message.channel, msgContent);
|
|
}); |