We've used local commands so far, which has worked fine because the bot isn't in many servers. For the future and for good practice, this changes over to use global commands.
Specifics:
For compatibility reasons, if any guild has "guild commands" active, iterate through all guilds and remove all guild commands. We need to do this to avoid duplicated commands in the Apps list.
Adds automated tests for the command diffing logic used to keep commands up to date. I kept running into subtle bugs with this logic, so now there are tests with a much more exhaustive set of combinations than I could conveniently manually test
Created an API wrapper for discord's REST api, and exported it as rest
Refactored deployCommands to use the new API wrapper instead of creating its own instance of REST with discordToken directly in code (which is bad)
Moved some logic from deployCommands into two functions: one that handles production deployments, and another that handles test deployments (for development). This was done because we want to be able to run tests without deploying commands globally on all servers connected by our bot user account; this would cause problems if multiple people are running tests at once or something like that... I think? Anyway, now there's only global command deployment when actually deployed in prod! Yay! Also added logging so you can see what happened during each deployment :) (I'm not sure why deployTestCommands deletes all global commands before doing anything else though...) Oh wait yeah I know why - it ensures a consistent state between local dev environments since they're using the same application ID but different guilds/servers etc., which could get out of sync otherwise :( But maybe we should just have separate app IDs for testing vs prod?? That might make more sense than deleting everything every time lol idk ¯_(ツ)_/¯ We'll figure it out later :D For now let's keep things simple!! <3<3<3~~~~~**~~**~~~~****!!!!!!!!!!!!!!!111111111one1onwoeinwoiejnweoijfnweiofjeiwnfoiewjnfiowejoifnwojefniowenofiwoenfioewnoiefnoweinfoweinoefwinoeifnewoinfeoiwnfeionwfewoinfewoinflksdjvnlkjdsnvkljsdnvlkjsdbnlkjnsdlknvsldknvlsdkndslskdfjlksdjfslfsdmflsmfdmslfmdsfmlsdkmfmlskdmfmldsmfmsdmkfmlsdmflsdfmlksdmfflssddffffffflllllllaaaaaaaaakkkkkkkkaaaasssssooooooonnnnnneeeeeeeessssseeeeeennnttttteeeerrrrrriiiiiiinnngggggg!!!!!1111111222222244444445555556666667777788888999999000000000)))))))))()(((((((({{{{{{[[[[[]]]]]}}}}}||||||:::;;::::;;;;;;;;;;;;;;;;;;;;;;;;:::::::::::::::::::::::,,,,,,,,,,,,,,............'''''''"""""
Added a new test file
Changed the description of slashCommandC to "CHANGED" and added different default_member_permissions for it
Removed required from option in slashCommandOC3, changed name of option 2 in OC2, and changed description of first option in OC
Changed user command D's name to be different than local one (user demo)
We've used local commands so far, which has worked fine because the bot isn't in many servers. For the future and for good practice, this changes over to use global commands.
Specifics: