Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WS error when intents is 0 #623

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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