A user with additional fields only available via the oauth2 identify scope. More...
#include "user.h"
Public Member Functions | |
user_identified () | |
Construct a new user identified object. More... | |
user_identified (const user &u) | |
Construct a new user identified object from a user object. More... | |
virtual | ~user_identified ()=default |
Destroy the user identified object. More... | |
std::string | build_json (bool with_id=false) const |
Convert object to json string. More... | |
std::string | build_json (bool with_id=false) const |
Convert object to json string. More... | |
user & | fill_from_json (nlohmann::json *j) |
Convert object from nlohmann::json. More... | |
user_identified & | fill_from_json (nlohmann::json *j) |
Convert object from nlohmann::json. More... | |
std::string | format_username () const |
Format a username into user#discriminator. More... | |
std::string | get_avatar_decoration_url (uint16_t size=0) const |
Get the avatar decoration url of the user if they have one, otherwise returns an empty string. More... | |
std::string | get_avatar_url (uint16_t size=0, const image_type format=i_png, bool prefer_animated=true) const |
Get the avatar url of the user. More... | |
std::string | get_banner_url (uint16_t size=0, const image_type format=i_png, bool prefer_animated=true) const |
Get the user identified's banner url if they have one, otherwise returns an empty string. More... | |
constexpr double | get_creation_time () const noexcept |
Get the creation time of this object according to Discord. More... | |
std::string | get_default_avatar_url () const |
Get the default avatar url of the user. More... | |
std::string | get_mention () const |
Return a ping/mention for the user. More... | |
std::string | get_url () const |
Returns URL to user. More... | |
bool | has_animated_banner () const |
Return true if user has an animated banner. More... | |
bool | has_animated_icon () const |
Return true if user has an animated icon. More... | |
bool | has_hypesquad_events () const |
Return true if user has hypesquad events. More... | |
bool | has_nitro_basic () const |
Return true if user has nitro basic. More... | |
bool | has_nitro_classic () const |
Return true if user has nitro classic. More... | |
bool | has_nitro_full () const |
Return true if user has full nitro. More... | |
bool | is_active_developer () const |
Return true if user has the active Developer badge. More... | |
bool | is_bot () const |
User is a bot. More... | |
bool | is_bot_http_interactions () const |
Return true if user is a bot which exclusively uses HTTP interactions. More... | |
bool | is_bughunter_1 () const |
Return true if user has the bughunter level 1 badge. More... | |
bool | is_bughunter_2 () const |
Return true if user has the bughunter level 2 badge. More... | |
bool | is_certified_moderator () const |
Return true if user is a certified moderator. More... | |
bool | is_discord_employee () const |
Return true if user is a discord employee. More... | |
bool | is_early_supporter () const |
Return true if user is an early supporter. More... | |
bool | is_house_balance () const |
Return true if user is in house balance. 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_mfa_enabled () const |
User has multi-factor authentication enabled. More... | |
bool | is_partnered_owner () const |
Return true if user owns a partnered server. More... | |
bool | is_system () const |
User is a system user (Clyde) More... | |
bool | is_team_user () const |
Return true if user is a team user. More... | |
bool | is_verified () const |
Return true if user has verified account. 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... | |
constexpr bool | operator!= (const managed &other) const noexcept |
Comparison operator for comparing two managed objects by id. More... | |
constexpr bool | operator== (const managed &other) const noexcept |
Comparison operator for comparing two managed objects by id. More... | |
auto | to_json (bool with_id=false) const |
Convert object to nlohmann::json. More... | |
auto | to_json (bool with_id=false) const |
Convert object to nlohmann::json. More... | |
Static Public Member Functions | |
static std::string | get_mention (const snowflake &id) |
Create a mentionable user. More... | |
Public Attributes | |
uint32_t | accent_color |
Optional: The user's banner color encoded as an integer representation of hexadecimal color code identify. More... | |
utility::iconhash | avatar |
Avatar hash. More... | |
utility::iconhash | avatar_decoration |
Avatar decoration hash. More... | |
utility::iconhash | banner |
Optional: The user's banner hash identify. More... | |
uint16_t | discriminator |
Discriminator (aka tag), 4 digits usually displayed with leading zeroes. More... | |
std::string | |
Optional: The user's email. More... | |
uint32_t | flags |
Flags built from a bitmask of values in dpp::user_flags. More... | |
std::string | global_name |
Global display name. More... | |
snowflake | id = {} |
Unique ID of object set by Discord. More... | |
std::string | locale |
Optional: The user's chosen language option identify. More... | |
uint8_t | refcount |
Reference count of how many guilds this user is in. More... | |
std::string | username |
Discord username. More... | |
bool | verified |
Optional: Whether the email on this account has been verified email. More... | |
Protected Member Functions | |
user_identified & | fill_from_json_impl (nlohmann::json *j) |
Fill this record from json. More... | |
virtual json | to_json_impl (bool with_id=true) const |
Convert to JSON. More... | |
Friends | |
struct | json_interface< user_identified > |
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.
dpp::user_identified::user_identified | ( | ) |
Construct a new user identified object.
References dpp::utility::cdn_endpoint_url(), dpp::user::discriminator, and dpp::i_png.
dpp::user_identified::user_identified | ( | const user & | u | ) |
Construct a new user identified object from a user object.
u | user object |
|
virtualdefault |
Destroy the user identified object.
|
inlineinherited |
Convert object to json string.
with_id | Whether to include the ID or not |
|
inlineinherited |
Convert object to json string.
with_id | Whether to include the ID or not |
|
inlineinherited |
Convert object from nlohmann::json.
j | nlohmann::json object |
|
inlineinherited |
Convert object from nlohmann::json.
j | nlohmann::json object |
|
protected |
Fill this record from json.
j | The json to fill this record from |
References email, dpp::from_json(), locale, and dpp::string_not_null().
|
inherited |
Format a username into user#discriminator.
For example Brain#0001
References dpp::user::flags, and dpp::u_bot.
|
inherited |
Get the avatar decoration url of the user if they have one, otherwise returns an empty string.
size | The size of the avatar decoration in pixels. It can be any power of two between 16 and 4096, otherwise the default sized avatar decoration is returned. |
|
inherited |
Get the avatar url of the user.
png
format!size | The size of the avatar in pixels. It can be any power of two between 16 and 4096, otherwise the default sized avatar is returned. |
format | The format to use for the avatar. It can be one of i_webp , i_jpg , i_png or i_gif . When passing i_gif , it returns an empty string for non-animated images. Consider using the prefer_animated parameter instead. |
prefer_animated | Whether you prefer gif format. If true, it'll return gif format whenever the image is available as animated. |
std::string dpp::user_identified::get_banner_url | ( | uint16_t | size = 0 , |
const image_type | format = i_png , |
||
bool | prefer_animated = true |
||
) | const |
Get the user identified's banner url if they have one, otherwise returns an empty string.
size | The size of the banner in pixels. It can be any power of two between 16 and 4096, otherwise the default sized banner is returned. |
format | The format to use for the avatar. It can be one of i_webp , i_jpg , i_png or i_gif . When passing i_gif , it returns an empty string for non-animated images. Consider using the prefer_animated parameter instead. |
prefer_animated | Whether you prefer gif format. If true, it'll return gif format whenever the image is available as animated. |
References dpp::unicode_emoji::b, dpp::user::flags, and dpp::u_animated_banner.
|
inlineconstexprnoexceptinherited |
Get the creation time of this object according to Discord.
|
inherited |
Get the default avatar url of the user.
This is calculated by the discriminator.
|
inherited |
Return a ping/mention for the user.
References dpp::user::flags, and dpp::u_mfa_enabled.
|
staticinherited |
Create a mentionable user.
id | The ID of the user. |
|
inherited |
bool dpp::user_identified::has_animated_banner | ( | ) | const |
Return true if user has an animated banner.
Referenced by dpp::user::has_animated_icon().
|
inherited |
Return true if user has an animated icon.
References banner, dpp::utility::cdn_endpoint_url_hash(), has_animated_banner(), dpp::i_gif, dpp::i_jpg, dpp::i_png, dpp::i_webp, and dpp::utility::iconhash::to_string().
|
inherited |
Return true if user has hypesquad events.
References dpp::user::flags, and dpp::u_early_supporter.
|
inherited |
Return true if user has nitro basic.
This is mutually exclusive with nitro basic.
References dpp::user::flags, and dpp::u_house_bravery.
|
inherited |
Return true if user has nitro classic.
This is mutually exclusive with nitro classic.
References dpp::user::flags, and dpp::u_bughunter_1.
|
inherited |
Return true if user has full nitro.
This is mutually exclusive with full nitro.
References dpp::user::flags, and dpp::u_hypesquad_events.
|
inherited |
Return true if user has the active Developer badge.
References dpp::user::flags, and dpp::u_nitro_full.
|
inherited |
User is a bot.
References dpp::user::flags, and dpp::u_nitro_classic.
|
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.
|
inherited |
Return true if user has the bughunter level 1 badge.
References dpp::user::flags, and dpp::u_team_user.
|
inherited |
Return true if user has the bughunter level 2 badge.
References dpp::user::flags, and dpp::u_animated_icon.
|
inherited |
Return true if user is a certified moderator.
|
inherited |
Return true if user is a discord employee.
References dpp::user::flags, and dpp::u_house_brilliance.
|
inherited |
Return true if user is an early supporter.
References dpp::user::flags, and dpp::u_certified_moderator.
|
inherited |
Return true if user is in house balance.
References dpp::user::flags, and dpp::u_verified_bot_dev.
|
inherited |
Return true if user is in house bravery.
References dpp::user::flags, and dpp::u_bughunter_2.
|
inherited |
Return true if user is in house brilliance.
References dpp::user::flags, and dpp::u_verified_bot.
|
inherited |
User has multi-factor authentication enabled.
References dpp::user::flags, and dpp::u_discord_employee.
|
inherited |
Return true if user owns a partnered server.
References dpp::user::flags, and dpp::u_house_balance.
|
inherited |
User is a system user (Clyde)
References dpp::user::flags, and dpp::u_nitro_basic.
|
inherited |
Return true if user is a team user.
References dpp::user::flags, and dpp::u_bot_http_interactions.
|
inherited |
Return true if user has verified account.
References dpp::user::flags, and dpp::u_partnered_owner.
|
inherited |
Return true if user has the verified bot badge.
|
inherited |
Return true if user is an early verified bot developer.
|
inlineconstexprnoexceptinherited |
Comparison operator for comparing two managed objects by id.
other | Other object to compare against |
|
inlineconstexprnoexceptinherited |
Comparison operator for comparing two managed objects by id.
other | Other object to compare against |
|
inlineinherited |
Convert object to nlohmann::json.
with_id | Whether to include the ID or not |
|
inlineinherited |
Convert object to nlohmann::json.
with_id | Whether to include the ID or not |
|
protectedvirtual |
Convert to JSON.
with_id | include ID in output |
Reimplemented from dpp::user.
|
friend |
uint32_t dpp::user_identified::accent_color |
Optional: The user's banner color encoded as an integer representation of hexadecimal color code identify.
|
inherited |
Avatar hash.
|
inherited |
Avatar decoration hash.
utility::iconhash dpp::user_identified::banner |
Optional: The user's banner hash identify.
Referenced by dpp::user::has_animated_icon().
|
inherited |
Discriminator (aka tag), 4 digits usually displayed with leading zeroes.
Referenced by user_identified().
std::string dpp::user_identified::email |
|
inherited |
Flags built from a bitmask of values in dpp::user_flags.
Referenced by dpp::user::format_username(), get_banner_url(), dpp::user::get_mention(), dpp::user::get_url(), dpp::user::has_hypesquad_events(), dpp::user::has_nitro_basic(), dpp::user::has_nitro_classic(), dpp::user::has_nitro_full(), dpp::user::is_active_developer(), dpp::user::is_bot(), dpp::user::is_bughunter_1(), dpp::user::is_bughunter_2(), dpp::user::is_discord_employee(), dpp::user::is_early_supporter(), dpp::user::is_house_balance(), dpp::user::is_house_bravery(), dpp::user::is_house_brilliance(), dpp::user::is_mfa_enabled(), dpp::user::is_partnered_owner(), dpp::user::is_system(), dpp::user::is_team_user(), and dpp::user::is_verified().
|
inherited |
Global display name.
|
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.
Referenced by dpp::poll::add_answer(), dpp::cluster::create_webhook(), dpp::cluster::current_user_join_thread(), dpp::invite::fill_from_json_impl(), dpp::command_permission::fill_from_json_impl(), dpp::interaction::get_resolved_role(), dpp::interaction::get_resolved_user(), dpp::cluster::global_bulk_command_create(), dpp::cluster::global_bulk_command_delete(), dpp::cluster::global_command_delete(), dpp::cluster::global_command_edit(), dpp::cluster::guild_ban_delete(), dpp::cluster::guild_command_create(), dpp::cluster::guild_command_edit_permissions(), dpp::cluster::guild_get_integrations(), dpp::events::guild_member_update::handle(), dpp::events::guild_role_create::handle(), dpp::events::channel_create::handle(), dpp::events::voice_state_update::handle(), dpp::discord_voice_client::handle_frame(), main(), dpp::component::set_disabled(), and dpp::select_option::set_label().
std::string dpp::user_identified::locale |
Optional: The user's chosen language option identify.
Referenced by fill_from_json_impl().
|
inherited |
Reference count of how many guilds this user is in.
|
inherited |
Discord username.
bool dpp::user_identified::verified |
Optional: Whether the email on this account has been verified email.