* refactor: reduced duplication in role stores
* fix docs
* fix: typo
* most of requested changes
* rest of changes
* ACTUAL rest of changes
* docs
* doooocs
* reason
* fix message embed json serialization
remove the toJSON method on message embeds so the raw data is exposed
for JSON seralization. this removes the hexColor property, but it
probably should not have been there in the first place. fixes#2419
* change api transform to tojson
Fixes#2364
Discord sends those timestamps packed as SMALL_BIG_EXT, which get converted to strings in js.
~~Maybe they are already preparing their timestamps for 2038.~~
* Prepare to work on moving all role functions to a Store
And yes, this is *another* patch branch cause I messed up my master branch to hell
* Move all emoji role related functions to its own store
Tested everything and it works! (With a reload of the client)
Also had to change a value in DataStore#holds
holds.name for GuildEmojis would return the emoji name instead of the class name
* New Line
* Thanks JS for circular dependency!
Because we can't have nice things...
* Do space's request
* Fix equals
* Fix space's point.
Raw API data has the role property as an array of IDs
* Ignore this I need a patch branch for Git
* Move all member role related stuff to a new DataStore
GuildMemberRoleStore is a new store that holds all member role related stuffs
Because its consistent!
* Minorest doc fix ever
To whoever did this object, they forgot a `{`
* Fix the spacing in the docs
* Resue the stores resolve rather than copy paste
Cause I'm dum and it overwrite resolve to the guild role stores resolve soo
* Fix some requests
- Removed the bs private functions
- Set the roles in the constructor
But, I need feedback. There is no way, that I saw, to make a member have roles whenever GuildMmber#_patch is called,
due to the roles being null on the guild. So the only way might be the for loop and getter.
* Fix an issue that I caused in #add
I was testing some other things, and changed that to test. Forgot to change it back
* Actually make the store generate just once when the member is created by first initializing the roles in the guild
Also replaces GuildMember#_roles with GuildMemberRoleStore#_roles
Tested all functions to make sure the expected result happens.
* I missed this from moving remove from GuildMember to GuildMemberRoleStore
* Fix RoleStore#create docs
For real this time
* Do all the requested changes
- Rename all `somethingRole` to `something` (hoistRole => hoist)
- Refactor add and remove to be cleaner and re-use set
* Fix a bug where the store would loose some roles due to null roles that can throw an error in the for loop after they've been deleted
* Remove the `role.id || role` part of the add and remove functions as Appel suggested
* Replace roles.resolve with roles.resolveID for GuildMemberRoleStore#remove
* Don't use Array.isArray in checks
Use instanceof instead
* Woops, I forgot to change this
Renamed colorRole to color
* The docs have dots, so we place the dots back
This leads to GuildMemberStore#_fetchMany to always reject
because it expects more member than possible.
Also no longer call the GuildMemberRemove handler locally
to not decrement twice.