diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-02-28 02:00:15 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-02-28 02:00:15 -0500 |
commit | d6a8b8c33372fe41d9e7f8453d15f491b25680a6 (patch) | |
tree | 5510f4ae1065b55e950a013658eef336e5e876a8 /discord/discord.cpp | |
parent | 11358da24e0e73044aed389b1dbbf479808ca036 (diff) | |
download | abaddon-portaudio-d6a8b8c33372fe41d9e7f8453d15f491b25680a6.tar.gz abaddon-portaudio-d6a8b8c33372fe41d9e7f8453d15f491b25680a6.zip |
add members panel/change member roles
Diffstat (limited to 'discord/discord.cpp')
-rw-r--r-- | discord/discord.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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()) |