Skip to content

Commit

Permalink
Merge branch 'dev' into style-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 authored Oct 31, 2023
2 parents 2a3ec75 + 3eaf668 commit f0164b0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 52 deletions.
2 changes: 1 addition & 1 deletion doxygen-awesome-css
94 changes: 43 additions & 51 deletions include/dpp/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -135,35 +172,11 @@ struct DPP_EXPORT select_option : public json_interface<select_option> {
* @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
Expand Down Expand Up @@ -340,31 +353,10 @@ class DPP_EXPORT component : public json_interface<component> {
*/
std::variant<std::monostate, std::string, int64_t, double> 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
*/
Expand Down

0 comments on commit f0164b0

Please sign in to comment.