From 64ee8f8e7639c1e84a7e68d45e2aceec5299a4d6 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 2 May 2024 00:05:53 +0500 Subject: feat: client for twitch api --- src/api/twitch/helix_client.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/api/twitch/helix_client.hpp (limited to 'src/api/twitch/helix_client.hpp') diff --git a/src/api/twitch/helix_client.hpp b/src/api/twitch/helix_client.hpp new file mode 100644 index 0000000..fedec7f --- /dev/null +++ b/src/api/twitch/helix_client.hpp @@ -0,0 +1,24 @@ +#pragma once + +#include +#include + +#include "schemas/user.hpp" + +namespace bot::api::twitch { + class HelixClient { + public: + HelixClient(const std::string &token, const std::string &client_id); + ~HelixClient() = default; + + std::vector get_users( + const std::vector &logins) const; + std::vector get_users(const std::vector &ids) const; + + private: + std::vector get_users_by_query( + const std::string &query) const; + std::string token, client_id; + const std::string base_url = "https://api.twitch.tv/helix"; + }; +} -- cgit v1.2.3