Creates notes, addnote, and removenote slash-commands. It also fixes issues 196 and 164 for the slash note commands by enabling them to work with users who have left server. Moves some logic that is also shared by other commands out into separate files. Updates the db-logic for the notes commands to use async/await. Modifies db logic to use only one SQL statement per db query.
For the text commands there is currently a function called notHighRoller which many commands use to check that target user is not an admin type role. This functionality was created in a new function named isServerStaff which the slash-commands can utilize to check if the target user is staff. There was also logic selecting a random color in a few commands. This was also extracted into a new function that can be shared by several commands going forward.
Is a re-seeding of the database necessary? No
Any new dependencies to install? No
Any special requirements to test?
(e.g., admin perms, alt account, etc.)
Please make sure you've attempted to meet the following coding standards
[X] Code has been tested and does not produce errors
[X] Code is readable and formatted
[X] There isn't any unnecessary commented-out code
What issue is this solving?
Closes #295
Description
Creates notes, addnote, and removenote slash-commands. It also fixes issues 196 and 164 for the slash note commands by enabling them to work with users who have left server. Moves some logic that is also shared by other commands out into separate files. Updates the db-logic for the notes commands to use async/await. Modifies db logic to use only one SQL statement per db query.
Any helpful knowledge/context for the reviewer?
We can now more easily manage users who have left server as the .getUser method in the slash-commands gives us an instance of the User class which is documented here: https://discord.js.org/#/docs/discord.js/stable/class/User
For the text commands there is currently a function called notHighRoller which many commands use to check that target user is not an admin type role. This functionality was created in a new function named isServerStaff which the slash-commands can utilize to check if the target user is staff. There was also logic selecting a random color in a few commands. This was also extracted into a new function that can be shared by several commands going forward.
Please make sure you've attempted to meet the following coding standards