dpp::channel
dpp::managed
dpp::json_interface< channel >
dpp::thread
channel.h
struct friend struct json_interface< channel > json_interface< channel > dpp::channel::json_interface< channel > json_interface< channel >
uint16_t uint16_t dpp::channel::CHANNEL_TYPE_MASK CHANNEL_TYPE_MASK dpp::channel::CHANNEL_TYPE_MASK = 0b0000000000001111
std::vector< forum_tag > std::vector<forum_tag> dpp::channel::available_tags available_tags dpp::channel::available_tags

A set of tags that can be used in a forum or media channel.

uint16_t uint16_t dpp::channel::bitrate bitrate dpp::channel::bitrate

The bitrate (in kilobits) of the voice channel.

auto_archive_duration_t auto_archive_duration_t dpp::channel::default_auto_archive_duration default_auto_archive_duration dpp::channel::default_auto_archive_duration

Default duration, copied onto newly created threads. Used by the clients, not the API. Threads will stop showing in the channel list after the specified period of inactivity. Defaults to dpp::arc_1_day.

std::variant< std::monostate, snowflake, std::string > std::variant<std::monostate, snowflake, std::string> dpp::channel::default_reaction default_reaction dpp::channel::default_reaction

The emoji to show as the default reaction button on a thread in a forum or media channel. Contains either nothing, the id of a guild's custom emoji or the unicode character of the emoji.

default_forum_sort_order_t default_forum_sort_order_t dpp::channel::default_sort_order default_sort_order dpp::channel::default_sort_order

The default sort order type used to order posts in forum and media channels.

uint16_t uint16_t dpp::channel::default_thread_rate_limit_per_user default_thread_rate_limit_per_user dpp::channel::default_thread_rate_limit_per_user

The initial `rate_limit_per_user` to set on newly created threads in a channel. This field is copied to the thread at creation time and does not live update.

uint16_t uint16_t dpp::channel::flags flags dpp::channel::flags

Flags bitmap (dpp::channel_flags).

snowflake snowflake dpp::channel::guild_id guild_id dpp::channel::guild_id

Guild id of the guild that owns the channel.

utility::iconhash utility::iconhash dpp::channel::icon icon dpp::channel::icon

Channel icon (for group DMs).

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.

snowflake snowflake dpp::channel::last_message_id last_message_id dpp::channel::last_message_id

ID of last message to be sent to the channel.

may not point to an existing or valid message/thread.

time_t time_t dpp::channel::last_pin_timestamp last_pin_timestamp dpp::channel::last_pin_timestamp

Timestamp of last pinned message.

std::string std::string dpp::channel::name name dpp::channel::name

Channel name (1-100 characters).

snowflake snowflake dpp::channel::owner_id owner_id dpp::channel::owner_id

User ID of the creator for group DMs or threads.

snowflake snowflake dpp::channel::parent_id parent_id dpp::channel::parent_id

Parent ID (for guild channels: id of the parent category, for threads: id of the text channel this thread was created).

std::vector< permission_overwrite > std::vector<permission_overwrite> dpp::channel::permission_overwrites permission_overwrites dpp::channel::permission_overwrites

Permission overwrites to apply to base permissions.

permission permission dpp::channel::permissions permissions dpp::channel::permissions

This is only filled when the channel is part of the `resolved` set sent within an interaction. Any other time it contains zero. When filled, it contains the calculated permission bitmask of the user issuing the command within this channel.

uint16_t uint16_t dpp::channel::position position dpp::channel::position

Sorting position, lower number means higher up the list.

uint16_t uint16_t dpp::channel::rate_limit_per_user rate_limit_per_user dpp::channel::rate_limit_per_user

Amount of seconds a user has to wait before sending another message (0-21600). Bots, as well as users with the permission manage_messages or manage_channel, are unaffected.

std::vector< snowflake > std::vector<snowflake> dpp::channel::recipients recipients dpp::channel::recipients

DM recipients.

std::string std::string dpp::channel::rtc_region rtc_region dpp::channel::rtc_region

Voice region if set for voice channel, otherwise empty string.

std::string std::string dpp::channel::topic topic dpp::channel::topic

Channel topic (0-4096 characters for forum and media channels, 0-1024 characters for all others).

uint8_t uint8_t dpp::channel::user_limit user_limit dpp::channel::user_limit

Maximum user limit for voice channels (0-99).

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

Read class values from json object j

A json object to read from

A reference to self

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

Build json for this channel object.

with_id

include the ID in the json

json JSON object

dpp::channel::channel
()
channel
dpp::channel::channel

Constructor

virtual dpp::channel::~channel
()
~channel
dpp::channel::~channel

Destructor

channel & channel & dpp::channel::add_flag (const channel_flags flag) add_flag dpp::channel::add_flag const channel_flags flag

Add (bitwise OR) a flag to this channel object.

flag

Flag bit to add from dpp::channel_flags

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::add_permission_overwrite (const snowflake target, const overwrite_type type, const uint64_t allowed_permissions, const uint64_t denied_permissions) add_permission_overwrite dpp::channel::add_permission_overwrite const snowflake target const overwrite_type type const uint64_t allowed_permissions const uint64_t denied_permissions

Add permission overwrites for a user or role. If the channel already has permission overwrites for the passed target, the existing ones will be adjusted by the passed permissions.

target

ID of the role or the member you want to adjust overwrites for

type

type of overwrite

allowed_permissions

bitmask of dpp::permissions you want to allow for this user/role in this channel. Note: You can use the dpp::permission class

denied_permissions

bitmask of dpp::permissions you want to deny for this user/role in this channel. Note: You can use the dpp::permission class

Example:

    channel.add_permission_overwrite(388499352297406481,dpp::ot_role,dpp::p_manage_channels|dpp::p_manage_messages,0);
    //Allowsp_manage_channelsandp_manage_messagespermissionsfortheprovidedrole.

Reference to self, so these method calls may be chained

std::string std::string dpp::json_interface< channel >::build_json (bool with_id=false) const build_json dpp::json_interface< channel >::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

channel & channel & dpp::json_interface< channel >::fill_from_json (nlohmann::json *j) fill_from_json dpp::json_interface< channel >::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.

forum_layout_type forum_layout_type dpp::channel::get_default_forum_layout () const get_default_forum_layout dpp::channel::get_default_forum_layout

Get the default forum layout type used to display posts in forum channels.

forum_layout_types Forum layout type

std::string std::string dpp::channel::get_icon_url (uint16_t size=0, const image_type format=i_png) const get_icon_url dpp::channel::get_icon_url uint16_t size 0 const image_type format i_png

Get the channel's icon url (if its a group DM), otherwise returns an empty string.

size

The size of the icon in pixels. It can be any power of two between 16 and 4096, otherwise the default sized icon is returned.

format

The format to use for the avatar. It can be one of `i_webp`, `i_jpg` or `i_png`.

std::string icon url or an empty string, if required attributes are missing or an invalid format was passed

std::map< snowflake, class guild_member * > std::map< snowflake, class guild_member * > dpp::channel::get_members () get_members dpp::channel::get_members

Return a map of members on the channel, built from the guild's member list based on which members have the VIEW_CHANNEL permission. Does not return reliable information for voice channels, use dpp::channel::get_voice_members() instead for this.

A map of guild members keyed by user id.

If the guild this channel belongs to is not in the cache, the function will always return 0.

std::string std::string dpp::channel::get_mention () const get_mention dpp::channel::get_mention

Get the mention ping for the channel.

std::string mention

channel_type channel_type dpp::channel::get_type () const get_type dpp::channel::get_type

Get the channel type.

channel_type Channel type

std::string std::string dpp::channel::get_url () const get_url dpp::channel::get_url

Returns string of URL to channel.

string of URL to channel

permission permission dpp::channel::get_user_permissions (const class guild_member &member) const get_user_permissions dpp::channel::get_user_permissions const class guild_member & member

Get the overall permissions for a member in this channel, including channel overwrites, role permissions and admin privileges.

member

The member to resolve the permissions for

permission Permission overwrites for the member. Made of bits in dpp::permissions.

Requires role cache to be enabled (it's enabled by default).

This is an alias for guild::permission_overwrites and searches for the guild in the cache, so consider using guild::permission_overwrites if you already have the guild object.

permission permission dpp::channel::get_user_permissions (const class user *user) const get_user_permissions dpp::channel::get_user_permissions const class user * user

Get the overall permissions for a member in this channel, including channel overwrites, role permissions and admin privileges.

user

The user to resolve the permissions for

permission Permission overwrites for the member. Made of bits in dpp::permissions.

Requires role cache to be enabled (it's enabled by default).

This is an alias for guild::permission_overwrites and searches for the guild in the cache, so consider using guild::permission_overwrites if you already have the guild object.

The method will search for the guild member in the cache by the users id. If the guild member is not in cache, the method will always return 0.

std::map< snowflake, voicestate > std::map< snowflake, voicestate > dpp::channel::get_voice_members () get_voice_members dpp::channel::get_voice_members

Get a map of members in this channel, if it is a voice channel. The map is keyed by snowflake id of the user.

std::map<snowflake, voicestate> The voice members of the channel

bool bool dpp::channel::is_category () const is_category dpp::channel::is_category

Returns true if the channel is a category.

true if a category

bool bool dpp::channel::is_dm () const is_dm dpp::channel::is_dm

Returns true if the channel is a DM.

true if is a DM

bool bool dpp::channel::is_download_options_hidden () const is_download_options_hidden dpp::channel::is_download_options_hidden

Returns true if embedded media download options are hidden in a media channel.

true, if embedded media download options are hidden in a media channel

bool bool dpp::channel::is_forum () const is_forum dpp::channel::is_forum

Returns true if the channel is a forum.

true if a forum

bool bool dpp::channel::is_group_dm () const is_group_dm dpp::channel::is_group_dm

Returns true if the channel is a group DM channel.

true if group DM

bool bool dpp::channel::is_locked_permissions () const is_locked_permissions dpp::channel::is_locked_permissions

Returns true if the permissions are to be synced with the category it is in. Used only and set manually when using the reorder channels method.

true if keeping permissions

bool bool dpp::channel::is_media_channel () const is_media_channel dpp::channel::is_media_channel

Returns true if the channel is a media channel.

true if media channel

bool bool dpp::channel::is_news_channel () const is_news_channel dpp::channel::is_news_channel

Returns true if the channel is an announcement channel.

true if announcement channel

bool bool dpp::channel::is_nsfw () const is_nsfw dpp::channel::is_nsfw

Returns true if the channel is NSFW gated.

true if NSFW

bool bool dpp::channel::is_pinned_thread () const is_pinned_thread dpp::channel::is_pinned_thread

Returns true if channel is a pinned thread in forum.

true, if channel is a pinned thread in forum

bool bool dpp::channel::is_stage_channel () const is_stage_channel dpp::channel::is_stage_channel

Returns true if the channel is a stage channel.

true if stage channel

bool bool dpp::channel::is_store_channel () const is_store_channel dpp::channel::is_store_channel

Returns true if the channel is a store channel.

Deprecated

store channels are deprecated by Discord

true if store channel

bool bool dpp::channel::is_tag_required () const is_tag_required dpp::channel::is_tag_required

Returns true if a tag is required to be specified when creating a thread in a forum channel.

true, if a tag is required to be specified when creating a thread in a forum channel

bool bool dpp::channel::is_text_channel () const is_text_channel dpp::channel::is_text_channel

Returns true if the channel is a text channel.

true if text channel

bool bool dpp::channel::is_video_720p () const is_video_720p dpp::channel::is_video_720p

Returns true if video quality is 720p.

true if video quality is 720p

bool bool dpp::channel::is_video_auto () const is_video_auto dpp::channel::is_video_auto

Returns true if video quality is auto.

true if video quality is auto

bool bool dpp::channel::is_voice_channel () const is_voice_channel dpp::channel::is_voice_channel

Returns true if the channel is a voice channel.

true if voice channel

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

channel & channel & dpp::channel::remove_flag (const channel_flags flag) remove_flag dpp::channel::remove_flag const channel_flags flag

Remove (bitwise NOT AND) a flag from this channel object.

flag

Flag bit to remove from dpp::channel_flags

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::remove_permission_overwrite (const snowflake target, const overwrite_type type) remove_permission_overwrite dpp::channel::remove_permission_overwrite const snowflake target const overwrite_type type

Remove channel specific permission overwrites of a user or role.

target

ID of the role or the member you want to remove permission overwrites of

type

type of overwrite

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_bitrate (const uint16_t bitrate) set_bitrate dpp::channel::set_bitrate const uint16_t bitrate

Set bitrate of this channel object.

bitrate

Bitrate to set (in kilobits)

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_default_forum_layout (forum_layout_type layout_type) set_default_forum_layout dpp::channel::set_default_forum_layout forum_layout_type layout_type

Set the default forum layout type for the forum channel.

layout_type

The layout type

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_default_sort_order (default_forum_sort_order_t sort_order) set_default_sort_order dpp::channel::set_default_sort_order default_forum_sort_order_t sort_order

Set the default forum sort order for the forum channel.

sort_order

The sort order

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_flags (const uint16_t flags) set_flags dpp::channel::set_flags const uint16_t flags

Set flags for this channel object.

flags

Flag bitmask to set from dpp::channel_flags

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_guild_id (const snowflake guild_id) set_guild_id dpp::channel::set_guild_id const snowflake guild_id

Set guild_id of this channel object.

guild_id

Guild ID to set

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_lock_permissions (const bool is_lock_permissions) set_lock_permissions dpp::channel::set_lock_permissions const bool is_lock_permissions

Set lock permissions property of this channel object Used only with the reorder channels method.

is_lock_permissions

true, if we are to inherit permissions from the category

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_name (const std::string &name) set_name dpp::channel::set_name const std::string & name

Set name of this channel object.

name

Name to set

Reference to self, so these method calls may be chained

name will be truncated to 100 chars, if longer

dpp::length_exception

if length < 1

channel & channel & dpp::channel::set_nsfw (const bool is_nsfw) set_nsfw dpp::channel::set_nsfw const bool is_nsfw

Set nsfw property of this channel object.

is_nsfw

true, if channel is nsfw

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_parent_id (const snowflake parent_id) set_parent_id dpp::channel::set_parent_id const snowflake parent_id

Set parent_id of this channel object.

parent_id

Parent ID to set

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_permission_overwrite (const snowflake target, const overwrite_type type, const uint64_t allowed_permissions, const uint64_t denied_permissions) set_permission_overwrite dpp::channel::set_permission_overwrite const snowflake target const overwrite_type type const uint64_t allowed_permissions const uint64_t denied_permissions

Set permission overwrites for a user or role on this channel object. Old permission overwrites for the target will be overwritten.

target

ID of the role or the member you want to set overwrites for

type

type of overwrite

allowed_permissions

bitmask of allowed dpp::permissions for this user/role in this channel. Note: You can use the dpp::permission class

denied_permissions

bitmask of denied dpp::permissions for this user/role in this channel. Note: You can use the dpp::permission class

Example:

    channel.set_permission_overwrite(388499352297406481,dpp::ot_role,dpp::p_manage_channels|dpp::p_manage_messages,0);
    //Setstheallowedpermissionstop_manage_channelsandp_manage_messagesandremovesalldeniedpermissionflagsfortheprovidedrole.

Reference to self, so these method calls may be chained

If both `allowed_permissions` and `denied_permissions` parameters are 0, the permission overwrite for the target will be removed

channel & channel & dpp::channel::set_position (const uint16_t position) set_position dpp::channel::set_position const uint16_t position

Set position of this channel object.

position

Position to set

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_rate_limit_per_user (const uint16_t rate_limit_per_user) set_rate_limit_per_user dpp::channel::set_rate_limit_per_user const uint16_t rate_limit_per_user

Set rate_limit_per_user of this channel object.

rate_limit_per_user

rate_limit_per_user (slowmode in sec) to set

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_topic (const std::string &topic) set_topic dpp::channel::set_topic const std::string & topic

Set topic of this channel object.

topic

Topic to set

Reference to self, so these method calls may be chained

topic will be truncated to 1024 chars, if longer

channel & channel & dpp::channel::set_type (channel_type type) set_type dpp::channel::set_type channel_type type

Set type of this channel object.

type

Channel type to set

Reference to self, so these method calls may be chained

channel & channel & dpp::channel::set_user_limit (const uint8_t user_limit) set_user_limit dpp::channel::set_user_limit const uint8_t user_limit

Set user_limit of this channel object.

user_limit

Limit to set

Reference to self, so these method calls may be chained

auto auto dpp::json_interface< channel >::to_json (bool with_id=false) const to_json dpp::json_interface< channel >::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

std::string static std::string dpp::channel::get_mention (const snowflake &id) get_mention dpp::channel::get_mention const snowflake & id

Create a mentionable channel.

id

The ID of the channel.

std::string The formatted mention of the channel.

A definition of a discord channel. There are one of these for every channel type except threads. Threads are special snowflakes. Get it? A Discord pun. Hahaha. .... I'll get my coat.

dpp::channel
dpp::json_interface< T >
dpp::json_interface< channel >
< channel >
dpp::managed
dpp::thread
T
auto_archive_duration_t
bool
default_forum_sort_order_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::json_interface< T >
dpp::json_interface< channel >
< channel >
dpp::json_interface< forum_tag >
< forum_tag >
dpp::managed
id
dpp::permission
value
dpp::permission_overwrite
id
allow
deny
type
dpp::snowflake
value
dpp::utility::iconhash
first
second
static constexpr uint16_t
std::basic_string< Char >
std::string
variant< std::monostate, dpp::snowflake, std::string >
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 >
time_t
uint16_t
uint64_t
uint8_t
- dpp::channel
  add_flag
- dpp::channel
  add_permission_overwrite
- dpp::channel
  available_tags
- dpp::channel
  bitrate
- dpp::channel
  build_json
- dpp::channel
  channel
- dpp::channel
  CHANNEL_TYPE_MASK
- dpp::channel
  default_auto_archive_duration
- dpp::channel
  default_reaction
- dpp::channel
  default_sort_order
- dpp::channel
  default_thread_rate_limit_per_user
- dpp::channel
  fill_from_json
- dpp::channel
  fill_from_json_impl
- dpp::channel
  flags
- dpp::channel
  get_creation_time
- dpp::channel
  get_default_forum_layout
- dpp::channel
  get_icon_url
- dpp::channel
  get_members
- dpp::channel
  get_mention
- dpp::channel
  get_mention
- dpp::channel
  get_type
- dpp::channel
  get_url
- dpp::channel
  get_user_permissions
- dpp::channel
  get_user_permissions
- dpp::channel
  get_voice_members
- dpp::channel
  guild_id
- dpp::channel
  icon
- dpp::channel
  id
- dpp::channel
  is_category
- dpp::channel
  is_dm
- dpp::channel
  is_download_options_hidden
- dpp::channel
  is_forum
- dpp::channel
  is_group_dm
- dpp::channel
  is_locked_permissions
- dpp::channel
  is_media_channel
- dpp::channel
  is_news_channel
- dpp::channel
  is_nsfw
- dpp::channel
  is_pinned_thread
- dpp::channel
  is_stage_channel
- dpp::channel
  is_store_channel
- dpp::channel
  is_tag_required
- dpp::channel
  is_text_channel
- dpp::channel
  is_video_720p
- dpp::channel
  is_video_auto
- dpp::channel
  is_voice_channel
- dpp::channel
  json_interface< channel >
- dpp::channel
  last_message_id
- dpp::channel
  last_pin_timestamp
- dpp::channel
  managed
- dpp::channel
  managed
- dpp::channel
  managed
- dpp::channel
  managed
- dpp::channel
  name
- dpp::channel
  operator!=
- dpp::channel
  operator=
- dpp::channel
  operator=
- dpp::channel
  operator==
- dpp::channel
  owner_id
- dpp::channel
  parent_id
- dpp::channel
  permission_overwrites
- dpp::channel
  permissions
- dpp::channel
  position
- dpp::channel
  rate_limit_per_user
- dpp::channel
  recipients
- dpp::channel
  remove_flag
- dpp::channel
  remove_permission_overwrite
- dpp::channel
  rtc_region
- dpp::channel
  set_bitrate
- dpp::channel
  set_default_forum_layout
- dpp::channel
  set_default_sort_order
- dpp::channel
  set_flags
- dpp::channel
  set_guild_id
- dpp::channel
  set_lock_permissions
- dpp::channel
  set_name
- dpp::channel
  set_nsfw
- dpp::channel
  set_parent_id
- dpp::channel
  set_permission_overwrite
- dpp::channel
  set_position
- dpp::channel
  set_rate_limit_per_user
- dpp::channel
  set_topic
- dpp::channel
  set_type
- dpp::channel
  set_user_limit
- dpp::channel
  to_json
- dpp::channel
  to_json_impl
- dpp::channel
  topic
- dpp::channel
  user_limit
- dpp::channel
  ~channel
- dpp::channel
  ~managed