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

A user with additional fields only available via the oauth2 identify scope. These are not included in dpp::user as additional scopes are needed to fetch them which bots do not normally have. More...

#include <user.h>

+ Inheritance diagram for dpp::user_identified:
+ Collaboration diagram for dpp::user_identified:

Public Member Functions

user_identifiedfill_from_json (nlohmann::json *j)
 
virtual std::string build_json (bool with_id=true) const
 Convert to JSON string. More...
 
 user_identified ()
 Construct a new user identified object. More...
 
virtual ~user_identified ()
 Destroy the user identified object. More...
 
std::string get_banner_url (uint16_t size=0) const
 Get the user identified's banner url if they have one, otherwise returns an empty string. More...
 
std::string get_avatar_url (uint16_t size=0) const
 Get the avatar url of the user object. More...
 
std::string get_mention () const
 Return a ping/mention for the user. More...
 
bool is_bot () const
 User is a bot. More...
 
bool is_system () const
 User is a system user (Clyde) More...
 
bool is_mfa_enabled () const
 User has multi-factor authentication enabled. More...
 
bool is_verified () const
 Return true if user has verified account. More...
 
bool has_nitro_full () const
 Return true if user has full nitro. This is mutually exclusive with full nitro. More...
 
bool has_nitro_classic () const
 Return true if user has nitro classic. This is mutually exclusive with nitro classic. More...
 
bool is_discord_employee () const
 Return true if user is a discord employee. More...
 
bool is_partnered_owner () const
 Return true if user owns a partnered server. More...
 
bool has_hypesquad_events () const
 Return true if user has hypesquad events. More...
 
bool is_bughunter_1 () const
 Return true if user has the bughunter level 1 badge. More...
 
bool is_house_bravery () const
 Return true if user is in house bravery. More...
 
bool is_house_brilliance () const
 Return true if user is in house brilliance. More...
 
bool is_house_balance () const
 Return true if user is in house balance. More...
 
bool is_early_supporter () const
 Return true if user is an early supporter. More...
 
bool is_team_user () const
 Return true if user is a team user. More...
 
bool is_bughunter_2 () const
 Return true if user has the bughunter level 2 badge. More...
 
bool is_verified_bot () const
 Return true if user has the verified bot badge. More...
 
bool is_verified_bot_dev () const
 Return true if user is an early verified bot developer. More...
 
bool is_certified_moderator () const
 Return true if user is a certified moderator. More...
 
bool is_bot_http_interactions () const
 Return true if user is a bot which exclusively uses HTTP interactions. Bots using HTTP interactions are always considered online even when not connected to a websocket. More...
 
bool has_animated_icon () const
 Return true if user has an animated icon. More...
 
std::string format_username () const
 Format a username into user::discriminator. More...
 
double get_creation_time () const
 Get the creation time of this object according to Discord. More...
 
bool operator== (const managed &other) const noexcept
 Comparison operator for comparing two managed objects by id. More...
 
bool operator!= (const managed &other) const noexcept
 Comparison operator for comparing two managed objects by id. More...
 

Public Attributes

std::string locale
 Optional: the user's chosen language option identify. More...
 
std::string email
 Optional: the user's email email (may be empty) More...
 
utility::iconhash banner
 Optional: the user's banner hash identify (may be empty) More...
 
uint32_t accent_color
 Optional: the user's banner color encoded as an integer representation of hexadecimal color code identify (may be empty) More...
 
bool verified
 Optional: whether the email on this account has been verified email. More...
 
std::string username
 
utility::iconhash avatar
 
uint32_t flags
 
uint16_t discriminator
 
uint8_t refcount
 
snowflake 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. More...
 

Detailed Description

A user with additional fields only available via the oauth2 identify scope. These are not included in dpp::user as additional scopes are needed to fetch them which bots do not normally have.

Constructor & Destructor Documentation

◆ user_identified()

dpp::user_identified::user_identified ( )

Construct a new user identified object.

◆ ~user_identified()

virtual dpp::user_identified::~user_identified ( )
virtual

Destroy the user identified object.

Member Function Documentation

◆ build_json()

virtual std::string dpp::user_identified::build_json ( bool  with_id = true) const
virtual

Convert to JSON string.

Parameters
with_idinclude ID in output
Returns
std::string JSON output

Reimplemented from dpp::user.

◆ fill_from_json()

user_identified & dpp::user_identified::fill_from_json ( nlohmann::json *  j)

Fill this record from json.

Parameters
jThe json to fill this record from
Returns
Reference to self

◆ format_username()

std::string dpp::user::format_username ( ) const
inherited

Format a username into user::discriminator.

For example Brain#0001

Returns
Formatted username and discriminator

◆ get_avatar_url()

std::string dpp::user::get_avatar_url ( uint16_t  size = 0) const
inherited

Get the avatar url of the user object.

Parameters
sizeThe size of the avatar in pixels. It can be any power of two between 16 and 4096. if not specified, the default sized avatar is returned.
Returns
std::string avatar url. If the user doesn't have an avatar, the default user avatar url is returned

◆ get_banner_url()

std::string dpp::user_identified::get_banner_url ( uint16_t  size = 0) const

Get the user identified's banner url if they have one, otherwise returns an empty string.

Parameters
sizeThe size of the banner in pixels. It can be any power of two between 16 and 4096. if not specified, the default sized banner is returned.
Returns
std::string banner url or empty string

◆ get_creation_time()

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

Get the creation time of this object according to Discord.

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

◆ get_mention()

std::string dpp::user::get_mention ( ) const
inherited

Return a ping/mention for the user.

Returns
std::string mention

◆ has_animated_icon()

bool dpp::user::has_animated_icon ( ) const
inherited

Return true if user has an animated icon.

Returns
true if icon is animated (gif)

◆ has_hypesquad_events()

bool dpp::user::has_hypesquad_events ( ) const
inherited

Return true if user has hypesquad events.

Returns
true if has hypesquad events

◆ has_nitro_classic()

bool dpp::user::has_nitro_classic ( ) const
inherited

Return true if user has nitro classic. This is mutually exclusive with nitro classic.

Returns
true if user has nitro classic

◆ has_nitro_full()

bool dpp::user::has_nitro_full ( ) const
inherited

Return true if user has full nitro. This is mutually exclusive with full nitro.

Returns
true if user has full nitro

◆ is_bot()

bool dpp::user::is_bot ( ) const
inherited

User is a bot.

Returns
True if the user is a bot

◆ is_bot_http_interactions()

bool dpp::user::is_bot_http_interactions ( ) const
inherited

Return true if user is a bot which exclusively uses HTTP interactions. Bots using HTTP interactions are always considered online even when not connected to a websocket.

Returns
true if is a http interactions only bot

◆ is_bughunter_1()

bool dpp::user::is_bughunter_1 ( ) const
inherited

Return true if user has the bughunter level 1 badge.

Returns
true if has bughunter level 1

◆ is_bughunter_2()

bool dpp::user::is_bughunter_2 ( ) const
inherited

Return true if user has the bughunter level 2 badge.

Returns
true if has bughunter level 2

◆ is_certified_moderator()

bool dpp::user::is_certified_moderator ( ) const
inherited

Return true if user is a certified moderator.

Returns
true if certified moderator

◆ is_discord_employee()

bool dpp::user::is_discord_employee ( ) const
inherited

Return true if user is a discord employee.

Returns
true if user is discord staff

◆ is_early_supporter()

bool dpp::user::is_early_supporter ( ) const
inherited

Return true if user is an early supporter.

Returns
true if early supporter

◆ is_house_balance()

bool dpp::user::is_house_balance ( ) const
inherited

Return true if user is in house balance.

Returns
true if in house brilliance

◆ is_house_bravery()

bool dpp::user::is_house_bravery ( ) const
inherited

Return true if user is in house bravery.

Returns
true if in house bravery

◆ is_house_brilliance()

bool dpp::user::is_house_brilliance ( ) const
inherited

Return true if user is in house brilliance.

Returns
true if in house brilliance

◆ is_mfa_enabled()

bool dpp::user::is_mfa_enabled ( ) const
inherited

User has multi-factor authentication enabled.

Returns
true if multi-factor is enabled

◆ is_partnered_owner()

bool dpp::user::is_partnered_owner ( ) const
inherited

Return true if user owns a partnered server.

Returns
true if user has partnered server

◆ is_system()

bool dpp::user::is_system ( ) const
inherited

User is a system user (Clyde)

Returns
true if user is a system user

◆ is_team_user()

bool dpp::user::is_team_user ( ) const
inherited

Return true if user is a team user.

Returns
true if a team user

◆ is_verified()

bool dpp::user::is_verified ( ) const
inherited

Return true if user has verified account.

Returns
true if verified

◆ is_verified_bot()

bool dpp::user::is_verified_bot ( ) const
inherited

Return true if user has the verified bot badge.

Returns
true if verified bot

◆ is_verified_bot_dev()

bool dpp::user::is_verified_bot_dev ( ) const
inherited

Return true if user is an early verified bot developer.

Returns
true if verified bot developer

◆ operator!=()

bool dpp::managed::operator!= ( const managed other) const
noexceptinherited

Comparison operator for comparing two managed objects by id.

Parameters
otherOther object to compare against
Returns
true objects are not the same id
false objects are the same id

◆ operator==()

bool dpp::managed::operator== ( const managed other) const
noexceptinherited

Comparison operator for comparing two managed objects by id.

Parameters
otherOther object to compare against
Returns
true objects are the same id
false objects are not the same id

Member Data Documentation

◆ accent_color

uint32_t dpp::user_identified::accent_color

Optional: the user's banner color encoded as an integer representation of hexadecimal color code identify (may be empty)

◆ avatar

utility::iconhash dpp::user::avatar
inherited

Avatar hash

◆ banner

utility::iconhash dpp::user_identified::banner

Optional: the user's banner hash identify (may be empty)

◆ discriminator

uint16_t dpp::user::discriminator
inherited

Discriminator (aka tag), 4 digits usually displayed with leading zeroes.

Note
To print the discriminator with leading zeroes, use something like fmt::format("{:04d}", discriminator)

◆ email

std::string dpp::user_identified::email

Optional: the user's email email (may be empty)

◆ flags

uint32_t dpp::user::flags
inherited

Flags built from a bitmask of values in dpp::user_flags

◆ id

snowflake dpp::managed::id
inherited

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.

◆ locale

std::string dpp::user_identified::locale

Optional: the user's chosen language option identify.

◆ refcount

uint8_t dpp::user::refcount
inherited

Reference count of how many guilds this user is in

◆ username

std::string dpp::user::username
inherited

Discord username

◆ verified

bool dpp::user_identified::verified

Optional: whether the email on this account has been verified email.

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