D++ (DPP)
C++ Discord API Bot Library
|
Represents a discord webhook. More...
#include <webhook.h>
Public Member Functions | |
webhook () | |
Construct a new webhook object. More... | |
~webhook () | |
Destroy the webhook object. More... | |
webhook & | fill_from_json (nlohmann::json *j) |
Fill in object from json data. More... | |
std::string | build_json (bool with_id=false) const |
Build JSON string from object. More... | |
webhook & | load_image (const std::string &image_blob, image_type type) |
Base64 encode image data and allocate it to image_data. More... | |
Public Attributes | |
uint8_t | type |
snowflake | guild_id |
snowflake | channel_id |
snowflake | user_id |
std::string | name |
std::string | avatar |
std::string | token |
snowflake | application_id |
std::string * | image_data |
snowflake | id |
Represents a discord webhook.
dpp::webhook::webhook | ( | ) |
Construct a new webhook object.
dpp::webhook::~webhook | ( | ) |
Destroy the webhook object.
std::string dpp::webhook::build_json | ( | bool | with_id = false | ) | const |
Build JSON string from object.
with_id | Include the ID of the webhook in the json |
webhook & dpp::webhook::fill_from_json | ( | nlohmann::json * | j | ) |
Fill in object from json data.
j | JSON data |
webhook & dpp::webhook::load_image | ( | const std::string & | image_blob, |
image_type | type | ||
) |
Base64 encode image data and allocate it to image_data.
image_blob | Binary image data |
type | Image type |
snowflake dpp::webhook::application_id |
std::string dpp::webhook::avatar |
snowflake dpp::webhook::channel_id |
snowflake dpp::webhook::guild_id |
|
inherited |
Unique ID of object
std::string* dpp::webhook::image_data |
std::string dpp::webhook::name |
std::string dpp::webhook::token |
uint8_t dpp::webhook::type |
snowflake dpp::webhook::user_id |