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

Represents a role within a dpp::guild. More...

#include <role.h>

+ Inheritance diagram for dpp::role:
+ Collaboration diagram for dpp::role:

Public Member Functions

 role ()
virtual ~role ()
rolefill_from_json (snowflake guild_id, nlohmann::json *j)
std::string build_json (bool with_id=false) const
roleload_image (const std::string &image_blob, const image_type type)
 Load an image into the object as base64. More...
bool is_hoisted () const
bool is_mentionable () const
bool is_managed () const
bool has_create_instant_invite () const
bool has_kick_members () const
bool has_ban_members () const
bool has_administrator () const
bool has_manage_channels () const
bool has_manage_guild () const
bool has_add_reactions () const
bool has_view_audit_log () const
bool has_priority_speaker () const
bool has_stream () const
bool has_view_channel () const
bool has_send_messages () const
bool has_send_tts_messages () const
bool has_manage_messages () const
bool has_embed_links () const
bool has_attach_files () const
bool has_read_message_history () const
bool has_mention_everyone () const
bool has_use_external_emojis () const
bool has_view_guild_insights () const
bool has_connect () const
bool has_speak () const
bool has_mute_members () const
bool has_deafen_members () const
bool has_move_members () const
bool has_use_vad () const
bool has_change_nickname () const
bool has_manage_nicknames () const
bool has_manage_roles () const
bool has_manage_webhooks () const
bool has_manage_emojis_and_stickers () const
bool has_use_application_commands () const
bool has_request_to_speak () const
bool has_manage_threads () const
bool has_create_public_threads () const
bool has_create_private_threads () const
bool has_use_external_stickers () const
bool has_send_messages_in_threads () const
bool has_start_embedded_activities () const

Public Attributes

std::string name
snowflake guild_id
uint32_t colour
uint8_t position
uint64_t permissions
uint8_t flags
snowflake integration_id
snowflake bot_id
std::string unicode_emoji
utility::iconhash icon
std::string * image_data
snowflake id

Detailed Description

Represents a role within a dpp::guild.

Constructor & Destructor Documentation

◆ role()

dpp::role::role ( )

Default constructor

◆ ~role()

virtual dpp::role::~role ( )

Default destructor

Member Function Documentation

◆ build_json()

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

Build a json string from this object.

with_idtrue if the ID is to be included in the json text
The json of the role

◆ fill_from_json()

role & dpp::role::fill_from_json ( snowflake  guild_id,
nlohmann::json j 

Fill this role from json.

guild_idthe guild id to place in the json
jThe json data
A reference to self

◆ has_add_reactions()

bool dpp::role::has_add_reactions ( ) const

True if has the add reactions permission

◆ has_administrator()

bool dpp::role::has_administrator ( ) const

True if has the administrator permission

◆ has_attach_files()

bool dpp::role::has_attach_files ( ) const

True if has the attach files permission

◆ has_ban_members()

bool dpp::role::has_ban_members ( ) const

True if has the ban members permission

◆ has_change_nickname()

bool dpp::role::has_change_nickname ( ) const

True if has the change nickname permission

◆ has_connect()

bool dpp::role::has_connect ( ) const

True if has the connect voice permission

◆ has_create_instant_invite()

bool dpp::role::has_create_instant_invite ( ) const

True if has create instant invite permission

◆ has_create_private_threads()

bool dpp::role::has_create_private_threads ( ) const

True if has the create private threads permission

◆ has_create_public_threads()

bool dpp::role::has_create_public_threads ( ) const

True if has the create public threads permission

◆ has_deafen_members()

bool dpp::role::has_deafen_members ( ) const

True if has the deafen members permission

◆ has_embed_links()

bool dpp::role::has_embed_links ( ) const

True if has the embed links permission

◆ has_kick_members()

bool dpp::role::has_kick_members ( ) const

True if has the kick members permission

◆ has_manage_channels()

bool dpp::role::has_manage_channels ( ) const

True if has the manage channels permission

◆ has_manage_emojis_and_stickers()

bool dpp::role::has_manage_emojis_and_stickers ( ) const

True if has the manage emojis and stickers permission

◆ has_manage_guild()

bool dpp::role::has_manage_guild ( ) const

True if has the manage guild permission

◆ has_manage_messages()

bool dpp::role::has_manage_messages ( ) const

True if has the manage messages permission

◆ has_manage_nicknames()

bool dpp::role::has_manage_nicknames ( ) const

True if has the manage nicknames permission

◆ has_manage_roles()

bool dpp::role::has_manage_roles ( ) const

True if has the manage roles permission

◆ has_manage_threads()

bool dpp::role::has_manage_threads ( ) const

True if has the manage threads permission

◆ has_manage_webhooks()

bool dpp::role::has_manage_webhooks ( ) const

True if has the manage webhooks permission

◆ has_mention_everyone()

bool dpp::role::has_mention_everyone ( ) const

True if has the mention @everyone and @here permission

◆ has_move_members()

bool dpp::role::has_move_members ( ) const

True if has the move members permission

◆ has_mute_members()

bool dpp::role::has_mute_members ( ) const

True if has the mute members permission

◆ has_priority_speaker()

bool dpp::role::has_priority_speaker ( ) const

True if has the priority speaker permission

◆ has_read_message_history()

bool dpp::role::has_read_message_history ( ) const

True if has the read message history permission

◆ has_request_to_speak()

bool dpp::role::has_request_to_speak ( ) const

True if has the request to speak permission

◆ has_send_messages()

bool dpp::role::has_send_messages ( ) const

True if has the send messages permission

◆ has_send_messages_in_threads()

bool dpp::role::has_send_messages_in_threads ( ) const

True if has the send messages in threads permission

◆ has_send_tts_messages()

bool dpp::role::has_send_tts_messages ( ) const

True if has the send TTS messages permission

◆ has_speak()

bool dpp::role::has_speak ( ) const

True if has the speak permission

◆ has_start_embedded_activities()

bool dpp::role::has_start_embedded_activities ( ) const

True if has the start embedded activities permission

◆ has_stream()

bool dpp::role::has_stream ( ) const

True if has the stream permission

◆ has_use_application_commands()

bool dpp::role::has_use_application_commands ( ) const

True if has the use application commands permission

◆ has_use_external_emojis()

bool dpp::role::has_use_external_emojis ( ) const

True if has the use external emojis permission

◆ has_use_external_stickers()

bool dpp::role::has_use_external_stickers ( ) const

True if has the use external stickers permission

◆ has_use_vad()

bool dpp::role::has_use_vad ( ) const

True if has use voice activity detection permission

◆ has_view_audit_log()

bool dpp::role::has_view_audit_log ( ) const

True if has the view audit log permission

◆ has_view_channel()

bool dpp::role::has_view_channel ( ) const

True if has the view channel permission

◆ has_view_guild_insights()

bool dpp::role::has_view_guild_insights ( ) const

True if has the view guild insights permission

◆ is_hoisted()

bool dpp::role::is_hoisted ( ) const

True if the role is hoisted

◆ is_managed()

bool dpp::role::is_managed ( ) const

True if the role is managed (belongs to a bot or application)

◆ is_mentionable()

bool dpp::role::is_mentionable ( ) const

True if the role is mentionable

◆ load_image()

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

Load an image into the object as base64.

image_blobImage binary data
typeType of image
emoji& Reference to self

Member Data Documentation

◆ bot_id

snowflake dpp::role::bot_id

Bot id if any (e.g. role is a bot's role created when it was invited)

◆ colour

uint32_t dpp::role::colour

Role colour

◆ flags

uint8_t dpp::role::flags

Role flags from dpp::role_flags

◆ guild_id

snowflake dpp::role::guild_id

Guild id

◆ icon

utility::iconhash dpp::role::icon

The role icon hash, can be an empty string

◆ id

snowflake dpp::managed::id

Unique ID of object

◆ image_data

std::string* dpp::role::image_data

Image data for the role icon (if any)

◆ integration_id

snowflake dpp::role::integration_id

Integration id if any (e.g. role is a bot's role created when it was invited)

◆ name

std::string dpp::role::name

Role name

◆ permissions

uint64_t dpp::role::permissions

Role permissions bitmask values from dpp::role_permissions

◆ position

uint8_t dpp::role::position

Role position

◆ unicode_emoji

std::string dpp::role::unicode_emoji

The unicode emoji used for the role's icon, can be an empty string

D++ Library version 10.0.30D++ 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