#pragma once #include #include #include #include namespace chatterino { class Channel; using ChannelPtr = std::shared_ptr; struct Message; using MessagePtr = std::shared_ptr; } // namespace chatterino namespace chatterino::recentmessages { using ResultCallback = std::function &)>; using ErrorCallback = std::function; /** * @brief Loads recent messages for a channel using the Recent Messages API * * @param channelName Name of Twitch channel * @param channelPtr Weak pointer to Channel to use to build messages * @param onLoaded Callback taking the built messages as a const std::vector & * @param onError Callback called when the network request fails */ void load(const QString &channelName, std::weak_ptr channelPtr, ResultCallback onLoaded, ErrorCallback onError); } // namespace chatterino::recentmessages