dpp::webhook
dpp::managed
dpp::json_interface< webhook >
webhook.h
struct friend struct json_interface< webhook > json_interface< webhook > dpp::webhook::json_interface< webhook > json_interface< webhook >
snowflake snowflake dpp::webhook::application_id application_id dpp::webhook::application_id

The bot/OAuth2 application that created this webhook.

This may be empty.

utility::iconhash utility::iconhash dpp::webhook::avatar avatar dpp::webhook::avatar

The default avatar of the webhook.

This value will not have any effect when `avatar_url` is set, they are mutually exclusive.

This may be empty.

std::string std::string dpp::webhook::avatar_url avatar_url dpp::webhook::avatar_url

Avatar URL to use instead of the default if it is set.

This will override `avatar` if it is set, they are mutually exclusive.

This may be empty.

snowflake snowflake dpp::webhook::channel_id channel_id dpp::webhook::channel_id

The channel id this webhook is for.

This may be empty.

snowflake snowflake dpp::webhook::guild_id guild_id dpp::webhook::guild_id

The guild id this webhook is for.

This field is optional, and may also be empty.

snowflake snowflake dpp::managed::id id dpp::managed::id = {}

Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID, and an incrementing value. Only the timestamp is relevant to us as useful metadata.

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

base64 encoded image data if uploading a new image.

You should only ever read data from here. If you want to set the data, use dpp::webhook::load_image.

std::string std::string dpp::webhook::name name dpp::webhook::name

The default name of the webhook.

This may be empty.

channel channel dpp::webhook::source_channel source_channel dpp::webhook::source_channel

The channel that this webhook is following (only for Channel Follower Webhooks).

This will be absent if the webhook creator has since lost access to the guild where the followed channel resides!

guild guild dpp::webhook::source_guild source_guild dpp::webhook::source_guild

The guild of the channel that this webhook is following (only for Channel Follower Webhooks).

This will be absent if the webhook creator has since lost access to the guild where the followed channel resides!

std::string std::string dpp::webhook::token token dpp::webhook::token

The secure token of the webhook (returned for Incoming Webhooks).

This field is optional.

uint8_t uint8_t dpp::webhook::type type dpp::webhook::type

Type of the webhook from dpp::webhook_type.

std::string std::string dpp::webhook::url url dpp::webhook::url

The url used for executing the webhook (returned by the webhooks OAuth2 flow).

user user dpp::webhook::user_obj user_obj dpp::webhook::user_obj

The user this webhook was created by.

This field is optional.

This is not returned when getting a webhook with its token!

webhook & webhook & dpp::webhook::fill_from_json_impl (nlohmann::json *j) fill_from_json_impl dpp::webhook::fill_from_json_impl nlohmann::json * j

Fill in object from json data.

j

JSON data

webhook& Reference to self

json virtual json dpp::webhook::to_json_impl (bool with_id=false) const to_json_impl dpp::webhook::to_json_impl bool with_id false

Build JSON string from object.

with_id

Include the ID of the webhook in the json

std::string JSON encoded object

dpp::webhook::webhook
()
webhook
dpp::webhook::webhook

Construct a new webhook object.

dpp::webhook::webhook
(const snowflake webhook_id, const std::string &webhook_token)
webhook
dpp::webhook::webhook
const snowflake webhook_id
const std::string & webhook_token

Construct a new webhook object using the webhook ID and the webhook token.

webhook_id

id taken from a link of an existing webhook

webhook_token

token taken from a link of an existing webhook

dpp::webhook::webhook
(const std::string &webhook_url)
webhook
dpp::webhook::webhook
const std::string & webhook_url

Construct a new webhook object using the Webhook URL provided by Discord.

webhook_url

a fully qualified web address of an existing webhook

logic_exception

if the webhook url could not be parsed

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

Convert object to json string.

with_id

Whether to include the ID or not

Some fields are conditionally filled, do not rely on all fields being present

std::string Json built from the structure

webhook & webhook & dpp::json_interface< webhook >::fill_from_json (nlohmann::json *j) fill_from_json dpp::json_interface< webhook >::fill_from_json nlohmann::json * j

Convert object from nlohmann::json.

j

nlohmann::json object

T& Reference to self for fluent calling

double double dpp::managed::get_creation_time () const noexcept get_creation_time dpp::managed::get_creation_time

Get the creation time of this object according to Discord.

double creation time inferred from the snowflake ID. The minimum possible value is the first second of 2015.

webhook & webhook & dpp::webhook::load_image (const std::string &image_blob, const image_type type, bool is_base64_encoded=false) load_image dpp::webhook::load_image const std::string & image_blob const image_type type bool is_base64_encoded false

Base64 encode image data and allocate it to image_data.

image_blob

Binary image data

type

Image type. It can be one of `i_gif`, `i_jpg` or `i_png`.

is_base64_encoded

True if the image data is already base64 encoded

webhook& Reference to self

dpp::length_exception

Image data is larger than the maximum size of 256 kilobytes

bool bool dpp::managed::operator!= (const managed &other) const noexcept operator!= dpp::managed::operator!= const managed & other

Comparison operator for comparing two managed objects by id.

other

Other object to compare against

true objects are not the same id

false objects are the same id

bool bool dpp::managed::operator== (const managed &other) const noexcept operator== dpp::managed::operator== const managed & other

Comparison operator for comparing two managed objects by id.

other

Other object to compare against

true objects are the same id

false objects are not the same id

auto auto dpp::json_interface< webhook >::to_json (bool with_id=false) const to_json dpp::json_interface< webhook >::to_json bool with_id false

Convert object to nlohmann::json.

with_id

Whether to include the ID or not

Some fields are conditionally filled, do not rely on all fields being present

json Json built from the structure

Represents a discord webhook.

dpp::json_interface< T >
dpp::json_interface< webhook >
< webhook >
dpp::managed
dpp::webhook
K
T
auto_archive_duration_t
bool
default_forum_sort_order_t
default_message_notification_t
dpp::channel
CHANNEL_TYPE_MASK
name
rtc_region
topic
recipients
permission_overwrites
available_tags
default_reaction
icon
guild_id
last_message_id
owner_id
parent_id
last_pin_timestamp
permissions
bitrate
default_thread_rate_limit_per_user
flags
position
rate_limit_per_user
default_auto_archive_duration
default_sort_order
user_limit
dpp::forum_tag
name
emoji
moderated
dpp::guild
description
name
vanity_url_code
channels
emojis
roles
threads
voice_members
members
welcome_screen
banner
discovery_splash
icon
splash
afk_channel_id
application_id
owner_id
public_updates_channel_id
rules_channel_id
safety_alerts_channel_id
system_channel_id
widget_channel_id
flags
max_members
max_presences
member_count
flags_extra
premium_subscription_count
shard_id
afk_timeout
max_video_channel_users
default_message_notifications
premium_tier
verification_level
explicit_content_filter
mfa_level
nsfw_level
dpp::json_interface< T >
dpp::json_interface< channel >
< channel >
dpp::json_interface< forum_tag >
< forum_tag >
dpp::json_interface< guild >
< guild >
dpp::json_interface< user >
< user >
dpp::json_interface< voicestate >
< voicestate >
dpp::json_interface< webhook >
< webhook >
dpp::json_interface< welcome_channel >
< welcome_channel >
dpp::json_interface< welcome_screen >
< welcome_screen >
dpp::managed
id
dpp::permission
value
dpp::permission_overwrite
id
allow
deny
type
dpp::snowflake
value
dpp::user
global_name
username
avatar
avatar_decoration
primary_guild
flags
discriminator
refcount
dpp::utility::icon
hash_or_data
dpp::utility::iconhash
first
second
dpp::utility::primaryguild
id
enabled
tag
badge
dpp::voicestate
shard_id
channel_id
guild_id
user_id
session_id
flags
request_to_speak
dpp::webhook
type
application_id
channel_id
guild_id
user_obj
avatar_url
image_data
name
token
url
avatar
source_guild
source_channel
dpp::welcome_channel
description
emoji_name
channel_id
emoji_id
dpp::welcome_screen
description
welcome_channels
guild_afk_timeout_t
guild_explicit_content_t
guild_nsfw_level_t
guild_premium_tier_t
int32_t
mfa_level_t
static constexpr uint16_t
std::basic_string< Char >
std::map< K, T >
keys
elements
std::map< dpp::snowflake, dpp::voicestate >
keys
elements
< dpp::snowflake, dpp::voicestate >
std::string
std::unordered_map< K, T >
keys
elements
std::unordered_map< snowflake, guild_member >
< snowflake, guild_member >
variant< std::monostate, dpp::snowflake, std::string >
variant< std::monostate, dpp::utility::iconhash, dpp::utility::image_data >
std::vector< T >
elements
std::vector< dpp::forum_tag >
elements
< dpp::forum_tag >
std::vector< dpp::permission_overwrite >
elements
< dpp::permission_overwrite >
std::vector< dpp::snowflake >
elements
< dpp::snowflake >
std::vector< dpp::welcome_channel >
elements
< dpp::welcome_channel >
time_t
uint16_t
uint32_t
uint64_t
uint8_t
verification_level_t
- dpp::webhook
  application_id
- dpp::webhook
  avatar
- dpp::webhook
  avatar_url
- dpp::webhook
  build_json
- dpp::webhook
  channel_id
- dpp::webhook
  fill_from_json
- dpp::webhook
  fill_from_json_impl
- dpp::webhook
  get_creation_time
- dpp::webhook
  guild_id
- dpp::webhook
  id
- dpp::webhook
  image_data
- dpp::webhook
  json_interface< webhook >
- dpp::webhook
  load_image
- dpp::webhook
  managed
- dpp::webhook
  managed
- dpp::webhook
  managed
- dpp::webhook
  managed
- dpp::webhook
  name
- dpp::webhook
  operator!=
- dpp::webhook
  operator=
- dpp::webhook
  operator=
- dpp::webhook
  operator==
- dpp::webhook
  source_channel
- dpp::webhook
  source_guild
- dpp::webhook
  to_json
- dpp::webhook
  to_json_impl
- dpp::webhook
  token
- dpp::webhook
  type
- dpp::webhook
  url
- dpp::webhook
  user_obj
- dpp::webhook
  webhook
- dpp::webhook
  webhook
- dpp::webhook
  webhook
- dpp::webhook
  ~managed