From 8c2e0d8c1faabb76f2e75cddc8b7da2caabf8da6 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 1 Jul 2025 18:54:10 +0500 Subject: feat: KICK SUPPORT RAAAAH!!!! emojiAngry --- bot/src/api/kick.hpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 bot/src/api/kick.hpp (limited to 'bot/src/api/kick.hpp') diff --git a/bot/src/api/kick.hpp b/bot/src/api/kick.hpp new file mode 100644 index 0000000..9b29b24 --- /dev/null +++ b/bot/src/api/kick.hpp @@ -0,0 +1,39 @@ +#pragma once + +#include +#include +#include + +namespace bot::api { + struct KickChannel { + int broadcaster_user_id; + std::string slug, stream_title, stream_game_name; + bool is_live; + std::chrono::system_clock::time_point start_time; + }; + + class KickAPIClient { + public: + KickAPIClient(const std::string &client_id, + const std::string &client_secret) + : client_id(client_id), client_secret(client_secret) { + this->authorize(); + }; + + ~KickAPIClient() = default; + + std::vector get_channels(const std::vector &ids) const; + std::vector get_channels(const std::string &slug) const; + + void refresh_token_thread(); + + private: + void authorize(); + + std::string authorization_key; + int expires_in; + long token_acquired_timestamp; + const std::string base_url = "https://api.kick.com", client_id, + client_secret; + }; +} \ No newline at end of file -- cgit v1.2.3