Skip to content

Commit

Permalink
fix: send type when building message
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Sep 23, 2024
1 parent 78d8d11 commit 8773fee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dpp/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,7 @@ json message::to_json(bool with_id, bool is_interaction_response) const {
/* Populate message reference */
if (message_reference.channel_id || message_reference.guild_id || message_reference.message_id) {
j["message_reference"] = json::object();
j["message_reference"]["type"] = static_cast<uint32_t>(message_reference.type);
if (message_reference.channel_id) {
j["message_reference"]["channel_id"] = std::to_string(message_reference.channel_id);
}
Expand Down Expand Up @@ -1409,7 +1410,7 @@ message& message::fill_from_json(json* d, cache_policy_t cp) {
}
if (d->find("message_reference") != d->end()) {
json& mr = (*d)["message_reference"];
message_reference.type = (message_ref_type)int8_not_null(&mr, "type");
message_reference.type = static_cast<message_ref_type>(int8_not_null(&mr, "type"));
message_reference.channel_id = snowflake_not_null(&mr, "channel_id");
message_reference.guild_id = snowflake_not_null(&mr, "guild_id");
message_reference.message_id = snowflake_not_null(&mr, "message_id");
Expand Down

0 comments on commit 8773fee

Please sign in to comment.