#pragma once #include #include "boost/optional.hpp" #include "common/Aliases.hpp" #include "common/Atomic.hpp" #include "providers/twitch/TwitchChannel.hpp" namespace chatterino { struct Emote; using EmotePtr = std::shared_ptr; class EmoteMap; class BttvEmotes final { static constexpr const char *globalEmoteApiUrl = "https://api.betterttv.net/3/cached/emotes/global"; static constexpr const char *bttvChannelEmoteApiUrl = "https://api.betterttv.net/3/cached/users/twitch/"; public: BttvEmotes(); std::shared_ptr emotes() const; boost::optional emote(const EmoteName &name) const; void loadEmotes(); static void loadChannel(std::weak_ptr channel, const QString &channelId, const QString &userName, std::function callback, bool manualRefresh); private: Atomic> global_; }; } // namespace chatterino