xMdb / hypixel-guild-chat-bot

A simple yet modern Discord bot that allows you to bridge between Hypixel guild chat and Discord chat.
GNU General Public License v3.0
30 stars 8 forks source link

feature request: improved help command #8

Closed Miqhtiedev closed 3 years ago

Miqhtiedev commented 3 years ago

Improved Help Command

I propose that the help command lists all the commands by category when it is ran as well as allows you to view usage and description of any command by doing ${prefix}help <command>

Implementation Method

const commandFolders = fs.readdirSync('./commands');
for (const folder of commandFolders) {
  const commandFiles = fs.readdirSync(`./commands/${folder}`).filter(file => file.endsWith('.js'));
  for (const file of commandFiles) {
    const command = require(`./commands/${folder}/${file}`);
    bot.commands.set(command.name, {
      aliases: command.aliases,
      description: command.description,
      usage: command.usage,
      slowmode: command.slowmode,
      cooldown: commnad.cooldown,
      execute: command.execute, 
      category: folder // <---------
    });
  }
}

Reasons for implementation

I am offering to PR this myself, please tell me if you want me to

xMdb commented 3 years ago

Thanks for the request. I originally didn't add this because I felt it was not needed due to the limited amount of commands it has, but in the interest of improving user experience and putting categories to use, I'm looking to add it anyways. A PR would be appreciated!