refactor: role stores (#2478)

* refactor: reduced duplication in role stores

* fix docs

* fix: typo

* most of requested changes

* rest of changes

* ACTUAL rest of changes

* docs

* doooocs

* reason
This commit is contained in:
Isabella
2018-04-24 15:52:00 -05:00
committed by GitHub
parent e12ab7428f
commit 8b83553462
5 changed files with 183 additions and 144 deletions

View File

@@ -16,12 +16,7 @@ class GuildEmoji extends Emoji {
*/
this.guild = guild;
/**
* A collection of roles this emoji is active for (empty if all), mapped by role ID
* @type {GuildEmojiRoleStore<Snowflake, Role>}
*/
this.roles = new GuildEmojiRoleStore(this);
this._roles = [];
this._patch(data);
}
@@ -49,6 +44,14 @@ class GuildEmoji extends Emoji {
return clone;
}
/**
* A collection of roles this emoji is active for (empty if all), mapped by role ID
* @type {GuildEmojiRoleStore<Snowflake, Role>}
*/
get roles() {
return new GuildEmojiRoleStore(this);
}
/**
* The timestamp the emoji was created at
* @type {number}