Base Emoji class for ReactionEmoji and renamed GuildEmoji classes (#2230)

* feat: create base Emoji class for ReactionEmoji and new GuildEmoji

* rename EmojiStore to GuildEmojiStore to account for the new class' name
This commit is contained in:
SpaceEEC
2018-01-18 09:38:45 +01:00
committed by Isabella
parent b846cbd2b3
commit aa3407f705
15 changed files with 264 additions and 278 deletions

View File

@@ -15,7 +15,7 @@ const UserStore = require('../stores/UserStore');
const ChannelStore = require('../stores/ChannelStore');
const GuildStore = require('../stores/GuildStore');
const ClientPresenceStore = require('../stores/ClientPresenceStore');
const EmojiStore = require('../stores/EmojiStore');
const GuildEmojiStore = require('../stores/GuildEmojiStore');
const { Events, browser } = require('../util/Constants');
const DataResolver = require('../util/DataResolver');
const { Error, TypeError, RangeError } = require('../errors');
@@ -208,11 +208,11 @@ class Client extends BaseClient {
/**
* All custom emojis that the client has access to, mapped by their IDs
* @type {EmojiStore<Snowflake, Emoji>}
* @type {GuildEmojiStore<Snowflake, GuildEmoji>}
* @readonly
*/
get emojis() {
const emojis = new EmojiStore({ client: this });
const emojis = new GuildEmojiStore({ client: this });
for (const guild of this.guilds.values()) {
if (guild.available) for (const emoji of guild.emojis.values()) emojis.set(emoji.id, emoji);
}