diff --git a/include/dpp/message.h b/include/dpp/message.h index d6def6a0d0..2d11b527e2 100644 --- a/include/dpp/message.h +++ b/include/dpp/message.h @@ -2023,13 +2023,20 @@ struct DPP_EXPORT message : public managed, json_interface { */ message(snowflake channel_id, const std::string &content, message_type type = mt_default); + /** + * @brief Construct a new message object with content + * + * @param _embed An embed to send + */ + message(const embed& _embed); + /** * @brief Construct a new message object with a channel and content * * @param channel_id The channel to send the message to * @param _embed An embed to send */ - message(snowflake channel_id, const embed & _embed); + message(snowflake channel_id, const embed& _embed); /** * @brief Construct a new message object with content diff --git a/src/dpp/message.cpp b/src/dpp/message.cpp index b7da4fc5af..850a6c67ed 100644 --- a/src/dpp/message.cpp +++ b/src/dpp/message.cpp @@ -622,11 +622,14 @@ message::message(const std::string &_content, message_type t) : message() { type = t; } -message::message(snowflake _channel_id, const embed& _embed) : message() { - channel_id = _channel_id; +message::message(const embed& _embed) : message() { embeds.emplace_back(_embed); } +message::message(snowflake _channel_id, const embed& _embed) : message(_embed) { + channel_id = _channel_id; +} + embed::embed(json* j) : embed() { title = string_not_null(j, "title"); type = string_not_null(j, "type");