From d6a8b8c33372fe41d9e7f8453d15f491b25680a6 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 28 Feb 2021 02:00:15 -0500 Subject: add members panel/change member roles --- discord/discord.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'discord/discord.cpp') diff --git a/discord/discord.cpp b/discord/discord.cpp index fbe6549..7cd87bc 100644 --- a/discord/discord.cpp +++ b/discord/discord.cpp @@ -1477,6 +1477,15 @@ bool DiscordClient::CheckCode(const http::response_type &r) { return true; } +bool DiscordClient::CheckCode(const http::response_type &r, int expected) { + if (!CheckCode(r)) return false; + if (r.status_code != expected) { + fprintf(stderr, "api request to %s returned %d, expected %d\n", r.url.c_str(), r.status_code, expected); + return false; + } + return true; +} + void DiscordClient::StoreMessageData(Message &msg) { const auto chan = m_store.GetChannel(msg.ChannelID); if (chan.has_value() && chan->GuildID.has_value()) -- cgit v1.2.3