discord.js/src
Frangu Vlad 00172e6c7d refactor: Move member role-related functions to a special store (#2242)
* 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
2018-01-24 08:12:58 +01:00
..
client fix: require discordjserror to throw meaningful errors where necessary 2018-01-22 20:23:36 +01:00
errors Improve docs, allow for webm/opus demuxing and playing broadcasts without specifying a type 2018-01-20 13:01:48 +00:00
rest Fix query string on requests after ratelimited (#2215) 2018-01-04 01:17:15 +01:00
sharding Fix ShardClientUtil#broadcastEval - now really accepting functions (#2248) 2018-01-14 20:46:08 +01:00
stores refactor: Move member role-related functions to a special store (#2242) 2018-01-24 08:12:58 +01:00
structures refactor: Move member role-related functions to a special store (#2242) 2018-01-24 08:12:58 +01:00
util fix: require discordjserror to throw meaningful errors where necessary 2018-01-22 20:23:36 +01:00
index.js refactor: Move member role-related functions to a special store (#2242) 2018-01-24 08:12:58 +01:00
WebSocket.js zlib stream compression (#2028) 2017-10-25 17:30:03 +01:00