Closed mcmcford closed 2 months ago
Hey , I am really interested to work in this problem , @mcmcford can you please allow me ...
@prithu7872 Of course, njmango is using the repo as a way to get familiar with git and js so can you do me a favour - create a branch or a fork depending on what permissions you have, comment it well and then go head with the pull request so OP can see how they work
Fixed in current version.
Currently all commands are handled in the
client.on('messageCreate')
event. This works perfectly fine but the method is nearly 300 lines long making it hard to quickly glance at or make modifications to.A solution to this is having it check the msg for a given string
if (content.startsWith('!edit'))
then rather than having all the processing directly below that if/else statement, move it over to its own function. To clean this up even further, functions can be moved to their own files but for a simple bot like this, that is a bit excessive.it should result in the messageCreate event looking something like this:
With all the appropriate async calls as needed etc. This will also make moving each command over to slash commands a little easier as they'll be split up into their own methods already