diff --git a/doxygen-awesome-css b/doxygen-awesome-css index 00a52f6c74..8cea9a073e 160000 --- a/doxygen-awesome-css +++ b/doxygen-awesome-css @@ -1 +1 @@ -Subproject commit 00a52f6c74065ffbd836cbd791ddfe8edf2836b8 +Subproject commit 8cea9a073ecd50a5b2c0958a3df100292d6c7374 diff --git a/include/dpp/message.h b/include/dpp/message.h index f877bb2db6..bd1864f4f4 100644 --- a/include/dpp/message.h +++ b/include/dpp/message.h @@ -54,6 +54,43 @@ enum component_type : uint8_t { cot_channel_selectmenu = 8, }; +/** + * @brief An emoji for a component (select menus included). + * + * To set an emoji on your button, you must set one of either the name or id fields. + * The easiest way is to use the dpp::component::set_emoji method. + * + * @note This is a **very** scaled down version of dpp::emoji, we advise that you refrain from using this. + */ +struct component_emoji { + /** + * @brief The name of the emoji. + * + * For built in unicode emojis, set this to the + * actual unicode value of the emoji e.g. "😄" + * and not for example ":smile:" + */ + std::string name{""}; + + /** + * @brief The emoji ID value for emojis that are custom + * ones belonging to a guild. + * + * The same rules apply as with other emojis, + * that the bot must be on the guild where the emoji resides + * and it must be available for use + * (e.g. not disabled due to lack of boosts, etc) + */ + dpp::snowflake id{0}; + + /** + * @brief Is the emoji animated? + * + * @note Only applies to custom emojis. + */ + bool animated{false}; +}; + /** * @brief Types of text input */ @@ -135,35 +172,11 @@ struct DPP_EXPORT select_option : public json_interface { * @brief True if option is the default option */ bool is_default; + /** - * @brief Emoji definition. To set an emoji on your button - * you must set one of either the name or id fields. - * The easiest way is to use the component::set_emoji - * method. + * @brief The emoji for the select option. */ - struct inner_select_emoji { - /** - * @brief Set the name field to the name of the emoji. - * For built in unicode emojis, set this to the - * actual unicode value of the emoji e.g. "😄" - * and not for example ":smile:" - */ - std::string name; - /** - * @brief The emoji ID value for emojis that are custom - * ones belonging to a guild. The same rules apply - * as with other emojis, that the bot must be on - * the guild where the emoji resides and it must - * be available for use (e.g. not disabled due to - * lack of boosts etc) - */ - dpp::snowflake id = 0; - /** - * @brief True if the emoji is animated. Only applies to - * custom emojis. - */ - bool animated = false; - } emoji; + component_emoji emoji; /** * @brief Construct a new select option object @@ -340,31 +353,10 @@ class DPP_EXPORT component : public json_interface { */ std::variant value; - /** Emoji definition. To set an emoji on your button - * you must set one of either the name or id fields. - * The easiest way is to use the component::set_emoji - * method. + /** + * @brief The emoji for this component. */ - struct inner_emoji { - /** Set the name field to the name of the emoji. - * For built in unicode emojis, set this to the - * actual unicode value of the emoji e.g. "😄" - * and not for example ":smile:" - */ - std::string name; - /** The emoji ID value for emojis that are custom - * ones belonging to a guild. The same rules apply - * as with other emojis, that the bot must be on - * the guild where the emoji resides and it must - * be available for use (e.g. not disabled due to - * lack of boosts etc) - */ - dpp::snowflake id; - /** True if the emoji is animated. Only applies to - * custom emojis. - */ - bool animated; - } emoji; + component_emoji emoji; /** Constructor */