-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(#18, #8) reformat in ESM style, dedupe code #19
(#18, #8) reformat in ESM style, dedupe code #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @davidzwa thank you for your work!
There are some things that I think that need to be changed. Also shouldn't there be changes to the files in the database folder?
….js, JSDoc and import fix
…database discord container
…ervice as static class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@Lucxjo please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the bit of copy/paste, I'm at work at the moment and just quickly logged in. PR looks good otherwise, just could you clear some bits up?
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR approved
@davidzwa your changes have been merged, thank you for your contribution! |
@all-contributors please add @davidzwa for bug |
I've put up a pull request to add @davidzwa! 🎉 |
This reworks the bot into an ESM module instead of CJS. This was so rigorous that the rest of the code got a brush over it and tackled #18.
The new package.json now looks like:
I've installed
yargs
as a CLI parser, to be made stricter in future.Description
By converting to ESM, the bot's code is slightly more readable and modern.
Related Issues
Fixes #8 and Fixes #18
Motivation and Context
We all love clean and reusable code ready for testing.
How Has This Been Tested?
dev
(dev script): I've ran it till the TOKEN is rejected. This means the startup logic has run at least once and the database connection is established.undefined
(start script): runs same as 1)global
(commands script) runs with TOKEN rejectionpurgeCommands
(commands:purge script) runs with GUILD_ID missing rejectionguild
(commands:guild script) runs with GUILD_ID missing rejectionStartup log
Types of changes
Checklist