summaryrefslogtreecommitdiff
path: root/discord/discord.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'discord/discord.cpp')
-rw-r--r--discord/discord.cpp9
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())