diff --git a/include/dpp/message.h b/include/dpp/message.h index e8cbae17b9..4a593ecf7a 100644 --- a/include/dpp/message.h +++ b/include/dpp/message.h @@ -2181,6 +2181,24 @@ struct DPP_EXPORT message : public managed, json_interface { */ message& add_embed(const embed& e); + /** + * @brief Add a sticker to this message + * + * As of writing this, a message can only contain up to 3 stickers + * @param s sticker to add + * @return message& reference to self + */ + message& add_sticker(const sticker& s); + + /** + * @brief Add a sticker to this message + * + * As of writing this, a message can only contain up to 3 stickers + * @param id id of the sticker to add + * @return message& reference to self + */ + message& add_sticker(const snowflake& id); + /** * @brief Set the flags * diff --git a/src/dpp/message.cpp b/src/dpp/message.cpp index 5e74fcf083..9b304cf094 100644 --- a/src/dpp/message.cpp +++ b/src/dpp/message.cpp @@ -535,26 +535,32 @@ message::message(snowflake _channel_id, const std::string &_content, message_typ type = t; } -message& message::add_component(const component& c) -{ +message& message::add_component(const component& c) { components.emplace_back(c); return *this; } -message& message::add_embed(const embed& e) -{ +message& message::add_embed(const embed& e) { embeds.emplace_back(e); return *this; } -message& message::set_flags(uint16_t f) -{ +message& message::add_sticker(const sticker& s) { + stickers.emplace_back(s); + return *this; +} + +message& message::add_sticker(const snowflake& id) { + stickers.emplace_back().id = id; + return *this; +} + +message& message::set_flags(uint16_t f) { flags = f; return *this; } -message& message::set_type(message_type t) -{ +message& message::set_type(message_type t) { type = t; return *this; }