From 1bca602663274d6c5da6d77b3eb6ff9bc9eb9bc3 Mon Sep 17 00:00:00 2001 From: Archie Jaskowicz Date: Mon, 9 Oct 2023 13:12:01 +0100 Subject: [PATCH] fix: threads now send correctly to discord. (#931) --- src/dpp/channel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/dpp/channel.cpp b/src/dpp/channel.cpp index 00a4db96a6..7f90c7eaa2 100644 --- a/src/dpp/channel.cpp +++ b/src/dpp/channel.cpp @@ -480,7 +480,14 @@ channel& channel::fill_from_json(json* j) { std::string thread::build_json(bool with_id) const { json j = json::parse(channel::build_json(with_id)); j["type"] = (flags & CHANNEL_TYPE_MASK); - j["thread_metadata"] = this->metadata; + j["archived"] = this->metadata.archived; + j["auto_archive_duration"] = this->metadata.auto_archive_duration; + j["locked"] = this->metadata.locked; + + if(this->get_type() == dpp::channel_type::CHANNEL_PRIVATE_THREAD) { + j["invitable"] = this->metadata.invitable; + } + if (!this->applied_tags.empty()) { j["applied_tags"] = json::array(); for (auto &tag_id: this->applied_tags) {