NamVr / DiscordBot-Template

A boilerplate / template for discord.js v14 bots with 100% coverage of Discord API, command handler, error handler based on https://discordjs.guide/
https://djs.docs.namanvrati.me/
Apache License 2.0
322 stars 75 forks source link

feat(bot): add function to unregister commands after stop #20

Closed FlyingGorro closed 2 years ago

FlyingGorro commented 2 years ago
NamVr commented 2 years ago

Hey, thank you for the contribution. However on looking into your PR, I recognise the PR is changing the entire structure of bot.js which is not possible for me because the aim of the template is to be most flexible and simple to understand for everyone from beginners to professionals. In regards to that, I can not accept your PR. (You can still introduce new features into template, it is a possibility, but you can't change existing template core code as it is highly based on official discord guide (discordjs.guide). I hope you understand!)

FlyingGorro commented 2 years ago

I understand you don't want to change the structure but making clean code (aka packing code in functions) makes actually everyone's life easier (including beginners)

With the changes in this PR it's easier for everyone to understand what the bot does and registers, plus disabling any functionality (like legacy commands) is as easy as commenting 1 line of code. I would understand that's the definition of being most flexible and simple to understand.

Having a huge piece of code with different functionalities separated by comments instead of functions is quite a bad practice that makes newbies need to spend more time than necessary trying to understand what the bot does and where it does it.

NamVr commented 2 years ago

I actually believe the current code is the cleanest possible to me and the discordjs community, and since the beginning of the template, I'm following simplicity and standards of discordjs official guide.

Following parts of the guide explains the code in this template: https://discordjs.guide/creating-your-bot/command-handling.html#individual-command-files

What you are suggesting is actually, reducing the flexibility of the code. No one needs to spend time in understanding what bot does, since the official guide clearly explains every single line. I believe even if someone doesn't know javascript, human brain's pattern recognition skills can guide them to understand what is similar between multiple pieces of code seperated by comments and how they are actually different by their features.

I honestly believe that if anyone wants to, they are welcome to expand their code since this is open source, they can do whatever they want in their own bot/code.