From 1f2ec5f6fea9beaf237ee2971dd9a4289fb8192c Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 17 Apr 2025 21:05:53 +0500 Subject: feat: title and game support for stream events --- bot/src/stream.hpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'bot/src/stream.hpp') diff --git a/bot/src/stream.hpp b/bot/src/stream.hpp index 73313ed..3ac71e3 100644 --- a/bot/src/stream.hpp +++ b/bot/src/stream.hpp @@ -10,6 +10,16 @@ #include "schemas/stream.hpp" namespace bot::stream { + enum StreamerType { TWITCH }; + + struct StreamerData { + int id; + StreamerType type; + bool is_live; + std::string title; + std::string game; + }; + class StreamListenerClient { public: StreamListenerClient(const api::twitch::HelixClient &helix_client, @@ -17,7 +27,7 @@ namespace bot::stream { const Configuration &configuration) : helix_client(helix_client), irc_client(irc_client), - configuration(configuration){}; + configuration(configuration) {}; ~StreamListenerClient() = default; void run(); @@ -27,15 +37,14 @@ namespace bot::stream { private: void check(); void handler(const schemas::EventType &type, - const api::twitch::schemas::Stream &stream); + const api::twitch::schemas::Stream &stream, + const StreamerData &data); void update_channel_ids(); const api::twitch::HelixClient &helix_client; irc::Client &irc_client; const Configuration &configuration; - std::vector ids; - - std::set online_ids; + std::vector streamers; }; } -- cgit v1.2.3