D++ (DPP)
C++ Discord API Bot Library
|
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. More...
#include <channel.h>
Public Member Functions | |
channel () | |
virtual | ~channel () |
channel & | fill_from_json (nlohmann::json *j) |
virtual std::string | build_json (bool with_id=false) const |
Build json for this channel object. More... | |
uint64_t | get_user_permissions (const class user *member) const |
Get the user permissions for a user on this channel. More... | |
std::map< snowflake, class guild_member * > | 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. More... | |
std::map< snowflake, voicestate > | 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. More... | |
bool | is_nsfw () const |
Returns true if the channel is NSFW gated. More... | |
bool | is_text_channel () const |
Returns true if the channel is a text channel. More... | |
bool | is_dm () const |
Returns true if the channel is a DM. More... | |
bool | is_voice_channel () const |
Returns true if the channel is a voice channel. More... | |
bool | is_group_dm () const |
Returns true if the channel is a group DM channel. More... | |
bool | is_category () const |
Returns true if the channel is a category. More... | |
bool | is_news_channel () const |
Returns true if the channel is a news channel. More... | |
bool | is_store_channel () const |
Returns true if the channel is a store channel. More... | |
bool | is_stage_channel () const |
Returns true if the channel is a stage channel. More... | |
bool | is_video_auto () const |
Returns true if video quality is auto. More... | |
bool | is_video_720p () const |
Returns true if video quality is 720p. More... | |
Public Attributes | |
uint16_t | flags |
snowflake | guild_id |
uint16_t | position |
std::string | name |
std::string | topic |
snowflake | last_message_id |
uint8_t | user_limit |
uint16_t | bitrate |
uint16_t | rate_limit_per_user |
snowflake | owner_id |
snowflake | parent_id |
time_t | last_pin_timestamp |
std::vector< snowflake > | recipients |
std::vector< permission_overwrite > | permission_overwrites |
uint64_t | 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. More... | |
std::string | rtc_region |
Voice region if set for voice channel, otherwise empty string. More... | |
snowflake | id |
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::channel | ( | ) |
Constructor
|
virtual |
Destructor
|
virtual |
Build json for this channel object.
with_id | include the ID in the json |
Reimplemented in dpp::thread.
channel & dpp::channel::fill_from_json | ( | nlohmann::json * | j | ) |
Read class values from json object
j | A json object to read from |
std::map< snowflake, class guild_member * > 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.
uint64_t dpp::channel::get_user_permissions | ( | const class user * | member | ) | const |
Get the user permissions for a user on this channel.
member | The user to return permissions for |
std::map< snowflake, voicestate > 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.
bool dpp::channel::is_category | ( | ) | const |
Returns true if the channel is a category.
bool dpp::channel::is_dm | ( | ) | const |
Returns true if the channel is a DM.
bool dpp::channel::is_group_dm | ( | ) | const |
Returns true if the channel is a group DM channel.
bool dpp::channel::is_news_channel | ( | ) | const |
Returns true if the channel is a news channel.
bool dpp::channel::is_nsfw | ( | ) | const |
Returns true if the channel is NSFW gated.
bool dpp::channel::is_stage_channel | ( | ) | const |
Returns true if the channel is a stage channel.
bool dpp::channel::is_store_channel | ( | ) | const |
Returns true if the channel is a store channel.
bool dpp::channel::is_text_channel | ( | ) | const |
Returns true if the channel is a text channel.
bool dpp::channel::is_video_720p | ( | ) | const |
Returns true if video quality is 720p.
bool dpp::channel::is_video_auto | ( | ) | const |
Returns true if video quality is auto.
bool dpp::channel::is_voice_channel | ( | ) | const |
Returns true if the channel is a voice channel.
uint16_t dpp::channel::bitrate |
the bitrate (in bits) of the voice channel
uint16_t dpp::channel::flags |
Flags bitmap
snowflake dpp::channel::guild_id |
Guild id of the guild that owns the channel
|
inherited |
Unique ID of object
snowflake dpp::channel::last_message_id |
ID of last message to be sent to the channel
time_t dpp::channel::last_pin_timestamp |
Timestamp of last pinned message
std::string dpp::channel::name |
Channel name
snowflake dpp::channel::owner_id |
User ID of owner for group DMs
snowflake dpp::channel::parent_id |
Parent ID (category)
std::vector<permission_overwrite> dpp::channel::permission_overwrites |
Permission overwrites to apply to base permissions
uint64_t 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 dpp::channel::position |
Sorting position, lower number means higher up the list
uint16_t 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> dpp::channel::recipients |
DM recipients
std::string dpp::channel::rtc_region |
Voice region if set for voice channel, otherwise empty string.
std::string dpp::channel::topic |
Channel topic
uint8_t dpp::channel::user_limit |
Maximum user limit for voice channels (0-99)