diff options
| author | ilotterytea <iltsu@alright.party> | 2025-04-17 21:05:53 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-04-17 21:05:53 +0500 |
| commit | 1f2ec5f6fea9beaf237ee2971dd9a4289fb8192c (patch) | |
| tree | efaf5fb54774e2de3aa6917033928c2ce2ac57d0 /bot/src/stream.hpp | |
| parent | b1a2e8a26cd08545ef93192b465b68c81bbc582b (diff) | |
feat: title and game support for stream events
Diffstat (limited to 'bot/src/stream.hpp')
| -rw-r--r-- | bot/src/stream.hpp | 19 |
1 files changed, 14 insertions, 5 deletions
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<int> ids; - - std::set<int> online_ids; + std::vector<StreamerData> streamers; }; } |
