From 792ea6bbbe044b4a58a1303f3b86082a35a0e81c Mon Sep 17 00:00:00 2001 From: KebsCS Date: Sun, 26 Nov 2023 00:18:14 +0100 Subject: [PATCH] stop checking version when rate limited --- KBotExt/Misc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/KBotExt/Misc.h b/KBotExt/Misc.h index 25c4209..184aacb 100644 --- a/KBotExt/Misc.h +++ b/KBotExt/Misc.h @@ -75,6 +75,9 @@ class Misc { const std::string getLatest = cpr::Get(cpr::Url{ "https://api.github.com/repos/KebsCS/KBotExt/releases/latest" }).text; + if (getLatest.contains("API rate limit")) + return; + const Json::CharReaderBuilder builder; const std::unique_ptr reader(builder.newCharReader()); JSONCPP_STRING err; @@ -118,6 +121,9 @@ class Misc { const std::string getPrerelease = cpr::Get(cpr::Url{ "https://api.github.com/repos/KebsCS/KBotExt/releases/tags/prerelease" }).text; + if (getPrerelease.contains("API rate limit")) + return; + const Json::CharReaderBuilder builder; const std::unique_ptr reader(builder.newCharReader()); JSONCPP_STRING err;