Skip to content

Commit

Permalink
Fix websocket error when intents is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
UltimateSppy765 authored Feb 27, 2023
1 parent bf56bb1 commit b7b0fd0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/dpp/discordclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ bool discord_client::handle_frame(const std::string &buffer)
std::this_thread::sleep_for(std::chrono::seconds(wait));
}
log(dpp::ll_debug, "Connecting new session...");
json obj = {
json obj = {
{ "op", 2 },
{
"d",
Expand All @@ -362,13 +362,11 @@ bool discord_client::handle_frame(const std::string &buffer)
},
{ "shard", json::array({ shard_id, max_shards }) },
{ "compress", false },
{ "large_threshold", 250 }
{ "large_threshold", 250 },
{ "intents", this->intents }
}
}
};
if (this->intents) {
obj["d"]["intents"] = this->intents;
}
this->write(jsonobj_to_string(obj));
this->connect_time = creator->last_identify = time(NULL);
reconnects++;
Expand Down

0 comments on commit b7b0fd0

Please sign in to comment.