![]() |
D++ (DPP)
C++ Discord API Bot Library
|
Represents messages sent and received on Discord. More...
#include <message.h>
Collaboration diagram for dpp::message:Public Member Functions | |
| message () | |
| Construct a new message object. More... | |
| message (const std::string &content, message_type type=mt_default) | |
| Construct a new message object with content. More... | |
| message (snowflake channel_id, const embed &_embed) | |
| Construct a new message object with a channel and content. More... | |
| message (snowflake channel_id, const std::string &content, message_type type=mt_default) | |
| Construct a new message object with a channel and content. More... | |
| message & | add_component (const component &c) |
| message & | add_embed (const embed &e) |
| std::string | build_json (bool with_id=false) const |
| message & | fill_from_json (nlohmann::json *j) |
| bool | is_crosspost () const |
| bool | is_crossposted () const |
| bool | is_ephemeral () const |
| bool | is_loading () const |
| bool | is_source_message_deleted () const |
| bool | is_urgent () const |
| bool | supress_embeds () const |
Public Attributes | |
| std::vector< attachment > | attachments |
| user * | author |
| snowflake | channel_id |
| std::vector< dpp::component > | components |
| std::string | content |
| time_t | edited |
| std::vector< embed > | embeds |
| std::string | filecontent |
| std::string | filename |
| uint8_t | flags |
| snowflake | guild_id |
| snowflake | id |
| guild_member * | member |
| std::vector< snowflake > | mention_channels |
| bool | mention_everyone |
| std::vector< snowflake > | mention_roles |
| std::vector< snowflake > | mentions |
| std::string | nonce |
| bool | pinned |
| std::vector< reaction > | reactions |
| time_t | sent |
| bool | tts |
| uint8_t | type |
| snowflake | webhook_id |
Represents messages sent and received on Discord.
| dpp::message::message | ( | ) |
Construct a new message object.
| dpp::message::message | ( | snowflake | channel_id, |
| const std::string & | content, | ||
| message_type | type = mt_default |
||
| ) |
Construct a new message object with a channel and content.
| channel_id | The channel to send the message to |
| content | The content of the message |
| type | The message type to create |
Construct a new message object with a channel and content.
| channel_id | The channel to send the message to |
| _embed | An embed to send |
| dpp::message::message | ( | const std::string & | content, |
| message_type | type = mt_default |
||
| ) |
Construct a new message object with content.
| content | The content of the message |
| type | The message type to create |
| std::string dpp::message::build_json | ( | bool | with_id = false | ) | const |
Build JSON from this object.
| with_id | True if the ID is to be included in the built JSON |
| message & dpp::message::fill_from_json | ( | nlohmann::json * | j | ) |
Fill this object from json.
| j | JSON object to fill from |
| bool dpp::message::is_crosspost | ( | ) | const |
| bool dpp::message::is_crossposted | ( | ) | const |
| bool dpp::message::is_ephemeral | ( | ) | const |
| bool dpp::message::is_loading | ( | ) | const |
| bool dpp::message::is_source_message_deleted | ( | ) | const |
| bool dpp::message::is_urgent | ( | ) | const |
| bool dpp::message::supress_embeds | ( | ) | const |
| std::vector<attachment> dpp::message::attachments |
any attached files
| user* dpp::message::author |
the author of this message (not guaranteed to be a valid user)
| snowflake dpp::message::channel_id |
id of the channel the message was sent in
| std::vector<dpp::component> dpp::message::components |
message components
| std::string dpp::message::content |
contents of the message
| time_t dpp::message::edited |
when this message was edited (may be 0 if never edited)
| std::vector<embed> dpp::message::embeds |
zero or more dpp::embed objects
| std::string dpp::message::filecontent |
File content to upload (raw binary)
| std::string dpp::message::filename |
Name of file to upload (for use server-side in discord's url)
| uint8_t dpp::message::flags |
Flags
| snowflake dpp::message::guild_id |
Optional: id of the guild the message was sent in
| snowflake dpp::message::id |
id of the message
| guild_member* dpp::message::member |
Optional: member properties for this message's author
| std::vector<snowflake> dpp::message::mention_channels |
Optional: channels specifically mentioned in this message
| bool dpp::message::mention_everyone |
whether this message mentions everyone
| std::vector<snowflake> dpp::message::mention_roles |
roles specifically mentioned in this message
| std::vector<snowflake> dpp::message::mentions |
users specifically mentioned in the message
| std::string dpp::message::nonce |
Optional: used for validating a message was sent
| bool dpp::message::pinned |
whether this message is pinned
| std::vector<reaction> dpp::message::reactions |
Optional: reactions to the message
| time_t dpp::message::sent |
when this message was sent
| bool dpp::message::tts |
whether this was a TTS message
| uint8_t dpp::message::type |
Message type
| snowflake dpp::message::webhook_id |
Optional: if the message is generated by a webhook, its id will be here otherwise the field will be 0