#pragma once #include #include "common/UniqueAccess.hpp" #include "messages/Emote.hpp" #include "messages/EmoteCache.hpp" namespace chatterino { class BttvEmotes final : std::enable_shared_from_this { static constexpr const char *globalEmoteApiUrl = "https://api.betterttv.net/2/emotes"; public: // BttvEmotes(); AccessGuard accessGlobalEmotes() const; boost::optional getGlobalEmote(const EmoteName &name); boost::optional getEmote(const EmoteId &id); void loadGlobalEmotes(); private: std::pair parseGlobalEmotes( const QJsonObject &jsonRoot, const EmoteMap ¤tEmotes); UniqueAccess globalEmotes_; // UniqueAccess channelEmoteCache_; }; } // namespace chatterino