dpp::user
dpp::managed
dpp::json_interface< user >
dpp::user_identified
user.h
struct friend struct json_interface< user > json_interface< user > dpp::user::json_interface< user > json_interface< user >
utility::iconhash utility::iconhash dpp::user::avatar avatar dpp::user::avatar

Avatar hash.

utility::iconhash utility::iconhash dpp::user::avatar_decoration avatar_decoration dpp::user::avatar_decoration

Avatar decoration hash.

uint16_t uint16_t dpp::user::discriminator discriminator dpp::user::discriminator

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

To print the discriminator with leading zeroes, use format_username(). 0 for users that have migrated to the new username format.

uint32_t uint32_t dpp::user::flags flags dpp::user::flags

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

std::string std::string dpp::user::global_name global_name dpp::user::global_name

Global display name.

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.

utility::primaryguild utility::primaryguild dpp::user::primary_guild primary_guild dpp::user::primary_guild

Primary guild object (server tag).

uint8_t uint8_t dpp::user::refcount refcount dpp::user::refcount

Reference count of how many guilds this user is in.

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

Discord username.

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

Fill this record from json. j

The json to fill this record from

Reference to self

json virtual json dpp::user::to_json_impl (bool with_id=true) const to_json_impl dpp::user::to_json_impl to_json_impl bool with_id true

Convert to JSON.

with_id

include ID in output

json JSON output

dpp::user::user
()
user
dpp::user::user

Construct a new user object.

virtual dpp::user::~user
()=default
~user
dpp::user::~user

Destroy the user object.

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

user & user & dpp::json_interface< user >::fill_from_json (nlohmann::json *j) fill_from_json dpp::json_interface< user >::fill_from_json nlohmann::json * j

Convert object from nlohmann::json.

j

nlohmann::json object

T& Reference to self for fluent calling

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

Format a username into user#discriminator.

For example Brain#0001

This will, most often, return something like Brain#0000 due to discriminators slowly being removed. Some accounts, along with most bots, still have discriminators, so they will still show as Bot#1234.

Formatted username and discriminator

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

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.

std::string avatar url or an empty string

std::string std::string dpp::user::get_avatar_url (uint16_t size=0, const image_type format=i_png, bool prefer_animated=true) const get_avatar_url dpp::user::get_avatar_url uint16_t size 0 const image_type format i_png bool prefer_animated true

Get the avatar url of the user.

If the user doesn't have an avatar, the default user avatar url is returned which is always in `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 avatar url or an empty string, if required attributes are missing or an invalid format was passed

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.

std::string std::string dpp::user::get_default_avatar_url () const get_default_avatar_url dpp::user::get_default_avatar_url

Get the default avatar url of the user. This is calculated by the discriminator.

std::string avatar url or an empty string, if the discriminator is empty

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

Return a ping/mention for the user.

std::string mention

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

Returns URL to user.

string of URL to user

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

Return true if user has an animated icon.

true if icon is animated (gif)

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

Return true if user has hypesquad events.

true if has hypesquad events

bool bool dpp::user::has_nitro_basic () const has_nitro_basic dpp::user::has_nitro_basic

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

true if user has nitro basic

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

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

true if user has nitro classic

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

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

true if user has full nitro

bool bool dpp::user::is_active_developer () const is_active_developer dpp::user::is_active_developer

Return true if user has the active Developer badge.

true if has active developer

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

User is a bot.

True if the user is a bot

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

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.

true if is a http interactions only bot

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

Return true if user has the bughunter level 1 badge.

true if has bughunter level 1

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

Return true if user has the bughunter level 2 badge.

true if has bughunter level 2

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

Return true if user is a certified moderator.

true if certified moderator

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

Return true if user is a discord employee.

true if user is discord staff

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

Return true if user is an early supporter.

true if early supporter

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

Return true if user is in house balance.

true if in house brilliance

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

Return true if user is in house bravery.

true if in house bravery

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

Return true if user is in house brilliance.

true if in house brilliance

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

User has multi-factor authentication enabled.

true if multi-factor is enabled

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

Return true if user owns a partnered server.

true if user has partnered server

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

User is a system user (Clyde).

true if user is a system user

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

Return true if user is a team user.

true if a team user

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

Return true if user has verified account.

true if verified

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

Return true if user has the verified bot badge.

true if verified bot

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

Return true if user is an early verified bot developer.

true if verified bot developer

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

auto auto dpp::json_interface< user >::to_json (bool with_id=false) const to_json dpp::json_interface< user >::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::user::get_mention (const snowflake &id) get_mention dpp::user::get_mention const snowflake & id

Create a mentionable user.

id

The ID of the user.

std::string The formatted mention of the user.

Represents a user on discord. May or may not be a member of a dpp::guild.

dpp::json_interface< T >
dpp::json_interface< user >
< user >
dpp::managed
dpp::user
dpp::user_identified
bool
dpp::json_interface< T >
dpp::json_interface< user >
< user >
dpp::managed
id
dpp::snowflake
value
dpp::user
global_name
username
avatar
avatar_decoration
primary_guild
flags
discriminator
refcount
dpp::utility::iconhash
first
second
dpp::utility::primaryguild
id
enabled
tag
badge
std::basic_string< Char >
std::string
uint16_t
uint32_t
uint64_t
uint8_t
- dpp::user
  avatar
- dpp::user
  avatar_decoration
- dpp::user
  build_json
- dpp::user
  discriminator
- dpp::user
  fill_from_json
- dpp::user
  fill_from_json_impl
- dpp::user
  flags
- dpp::user
  format_username
- dpp::user
  get_avatar_decoration_url
- dpp::user
  get_avatar_url
- dpp::user
  get_creation_time
- dpp::user
  get_default_avatar_url
- dpp::user
  get_mention
- dpp::user
  get_mention
- dpp::user
  get_url
- dpp::user
  global_name
- dpp::user
  has_animated_icon
- dpp::user
  has_hypesquad_events
- dpp::user
  has_nitro_basic
- dpp::user
  has_nitro_classic
- dpp::user
  has_nitro_full
- dpp::user
  id
- dpp::user
  is_active_developer
- dpp::user
  is_bot
- dpp::user
  is_bot_http_interactions
- dpp::user
  is_bughunter_1
- dpp::user
  is_bughunter_2
- dpp::user
  is_certified_moderator
- 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
- dpp::user
  is_verified
- dpp::user
  is_verified_bot
- dpp::user
  is_verified_bot_dev
- dpp::user
  json_interface< user >
- dpp::user
  managed
- dpp::user
  managed
- dpp::user
  managed
- dpp::user
  managed
- dpp::user
  operator!=
- dpp::user
  operator=
- dpp::user
  operator=
- dpp::user
  operator==
- dpp::user
  primary_guild
- dpp::user
  refcount
- dpp::user
  to_json
- dpp::user
  to_json_impl
- dpp::user
  user
- dpp::user
  username
- dpp::user
  ~managed
- dpp::user
  ~user