Skip to content

Commit

Permalink
fix: send stickers in message if present
Browse files Browse the repository at this point in the history
  • Loading branch information
Mishura4 committed Jan 6, 2024
1 parent 3eafd7d commit 5fd08cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/dpp/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -1848,7 +1848,7 @@ struct DPP_EXPORT message : public managed, json_interface<message> {
snowflake webhook_id;

/**
* @brief Stickers.
* @brief Partial stickers. Only id, name and format_type are filled
*/
std::vector<sticker> stickers;

Expand Down
6 changes: 6 additions & 0 deletions src/dpp/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5fd08cc

Please sign in to comment.