diff options
| author | ilotterytea <iltsu@alright.party> | 2025-07-01 18:54:10 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-07-01 18:54:10 +0500 |
| commit | 8c2e0d8c1faabb76f2e75cddc8b7da2caabf8da6 (patch) | |
| tree | 5d227bd7529c0fa7e248737d430212275621bb93 /bot/src/api/kick.hpp | |
| parent | 25a25a07a7b68443791974800dbfc77d223392d6 (diff) | |
feat: KICK SUPPORT RAAAAH!!!! emojiAngry
Diffstat (limited to 'bot/src/api/kick.hpp')
| -rw-r--r-- | bot/src/api/kick.hpp | 39 |
1 files changed, 39 insertions, 0 deletions
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 <chrono> +#include <string> +#include <vector> + +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<KickChannel> get_channels(const std::vector<int> &ids) const; + std::vector<KickChannel> 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 |
