From 5fd08cc5736c979e0732fa62a873e6a16f9c41ca Mon Sep 17 00:00:00 2001 From: Amber Ehrlich Date: Sat, 6 Jan 2024 13:21:11 -0500 Subject: [PATCH] fix: send stickers in message if present --- include/dpp/message.h | 2 +- src/dpp/message.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/dpp/message.h b/include/dpp/message.h index f2b1d1b7e6..e8cbae17b9 100644 --- a/include/dpp/message.h +++ b/include/dpp/message.h @@ -1848,7 +1848,7 @@ struct DPP_EXPORT message : public managed, json_interface { snowflake webhook_id; /** - * @brief Stickers. + * @brief Partial stickers. Only id, name and format_type are filled */ std::vector stickers; diff --git a/src/dpp/message.cpp b/src/dpp/message.cpp index d4523b5ff7..5e74fcf083 100644 --- a/src/dpp/message.cpp +++ b/src/dpp/message.cpp @@ -942,6 +942,12 @@ json message::to_json(bool with_id, bool is_interaction_response) const { } } + if (stickers.size()) { + auto [it, _] = j.emplace("sticker_ids", json::array()); + for (const sticker &s : stickers) { + it->push_back(std::to_string(s.id)); + } + } j["components"] = json::array(); for (auto & component : components) {