add color resolvable, and color constants from the client (#1080)

* add color resolvable, and color constants from the client

* fix up docs

* Update ClientDataResolver.js

* add easter eggs

* Update ClientDataResolver.js

* Update RESTMethods.js
This commit is contained in:
Gus Caplan
2017-01-12 12:43:22 -06:00
committed by Amish Shah
parent a3091f5262
commit 0d4eab8d24
5 changed files with 122 additions and 47 deletions

View File

@@ -459,10 +459,7 @@ class RESTMethods {
const data = {};
data.name = _data.name || role.name;
data.position = typeof _data.position !== 'undefined' ? _data.position : role.position;
data.color = _data.color || role.color;
if (typeof data.color === 'string' && data.color.startsWith('#')) {
data.color = parseInt(data.color.replace('#', ''), 16);
}
data.color = this.client.resolver.resolveColor(_data.color || role.color);
data.hoist = typeof _data.hoist !== 'undefined' ? _data.hoist : role.hoist;
data.mentionable = typeof _data.mentionable !== 'undefined' ? _data.mentionable : role.mentionable;