D++ (DPP)
C++ Discord API Bot Library
dpp::webhook Class Reference

Represents a discord webhook. More...

#include <webhook.h>

+ Inheritance diagram for dpp::webhook:
+ Collaboration diagram for dpp::webhook:

Public Member Functions

 webhook ()
 Construct a new webhook object. More...
 
 ~webhook ()
 Destroy the webhook object. More...
 
webhookfill_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...
 
webhookload_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
 

Detailed Description

Represents a discord webhook.

Constructor & Destructor Documentation

◆ webhook()

dpp::webhook::webhook ( )

Construct a new webhook object.

◆ ~webhook()

dpp::webhook::~webhook ( )

Destroy the webhook object.

Member Function Documentation

◆ build_json()

std::string dpp::webhook::build_json ( bool  with_id = false) const

Build JSON string from object.

Parameters
with_idInclude the ID of the webhook in the json
Returns
std::string JSON encoded object

◆ fill_from_json()

webhook & dpp::webhook::fill_from_json ( nlohmann::json j)

Fill in object from json data.

Parameters
jJSON data
Returns
webhook& Reference to self

◆ load_image()

webhook & dpp::webhook::load_image ( const std::string &  image_blob,
image_type  type 
)

Base64 encode image data and allocate it to image_data.

Parameters
image_blobBinary image data
typeImage type
Returns
webhook& Reference to self

Member Data Documentation

◆ application_id

snowflake dpp::webhook::application_id

◆ avatar

std::string dpp::webhook::avatar

◆ channel_id

snowflake dpp::webhook::channel_id

◆ guild_id

snowflake dpp::webhook::guild_id

◆ id

snowflake dpp::managed::id
inherited

Unique ID of object

◆ image_data

std::string* dpp::webhook::image_data

◆ name

std::string dpp::webhook::name

◆ token

std::string dpp::webhook::token

◆ type

uint8_t dpp::webhook::type

◆ user_id

snowflake dpp::webhook::user_id
D++ Library version 10.0.29D++ Library version 10.0.28D++ Library version 10.0.27D++ Library version 10.0.26D++ Library version 10.0.25D++ Library version 10.0.24D++ Library version 10.0.23D++ Library version 10.0.22D++ Library version 10.0.21D++ Library version 10.0.20D++ Library version 10.0.19D++ Library version 10.0.18D++ Library version 10.0.17D++ Library version 10.0.16D++ Library version 10.0.15D++ Library version 10.0.14D++ Library version 10.0.13D++ Library version 10.0.12D++ Library version 10.0.11D++ Library version 10.0.10D++ Library version 10.0.9D++ Library version 10.0.8D++ Library version 10.0.7D++ Library version 10.0.6D++ Library version 10.0.5D++ Library version 10.0.4D++ Library version 10.0.3D++ Library version 10.0.2D++ Library version 10.0.1D++ Library version 10.0.0D++ Library version 9.0.19D++ Library version 9.0.18D++ Library version 9.0.17D++ Library version 9.0.16D++ Library version 9.0.15D++ Library version 9.0.14D++ Library version 9.0.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0