dpp::guild_member
dpp::json_interface< guild_member >
guild.h
void void from_json (const nlohmann::json &j, guild_member &gm) from_json dpp::guild_member::from_json const nlohmann::json & j guild_member & gm

helper function to deserialize a guild_member from json

https://github.com/nlohmann/json#arbitrary-types-conversions

j

output json object

gm

guild_member to be deserialized

struct friend struct json_interface< guild_member > json_interface< guild_member > dpp::guild_member::json_interface< guild_member > json_interface< guild_member >
uint16_t uint16_t dpp::guild_member::flags flags dpp::guild_member::flags

A set of flags built from the bitmask defined by dpp::guild_member_flags.

std::string std::string dpp::guild_member::nickname nickname dpp::guild_member::nickname

Nickname.

Empty string if they don't have a nickname on this guild

std::vector< snowflake > std::vector<snowflake> dpp::guild_member::roles roles dpp::guild_member::roles

List of roles this user has on this guild.

utility::iconhash utility::iconhash dpp::guild_member::avatar avatar dpp::guild_member::avatar

User avatar.

Per-server avatar is a nitro only feature.

time_t time_t dpp::guild_member::communication_disabled_until communication_disabled_until dpp::guild_member::communication_disabled_until

Timestamp of when the time out will be removed; until then, they cannot interact with the guild.

snowflake snowflake dpp::guild_member::guild_id guild_id dpp::guild_member::guild_id

Guild id.

time_t time_t dpp::guild_member::joined_at joined_at dpp::guild_member::joined_at

Date and time the user joined the guild.

time_t time_t dpp::guild_member::premium_since premium_since dpp::guild_member::premium_since

The Date and time the user started boosting.

snowflake snowflake dpp::guild_member::user_id user_id dpp::guild_member::user_id

User id.

json json dpp::guild_member::to_json_impl (bool with_id=false) const to_json_impl dpp::guild_member::to_json_impl bool with_id false

Build json for the member object.

with_id

Add ID to output

json JSON object

dpp::guild_member::guild_member
()
guild_member
dpp::guild_member::guild_member

Default constructor

guild_member & guild_member & dpp::guild_member::add_role (dpp::snowflake role_id) add_role dpp::guild_member::add_role dpp::snowflake role_id

Add a role to this member.

This call sets the role change bit, which causes the new role list to be sent if this is passed to dpp::cluster::guild_edit_member or dpp::cluster::guild_add_member

role_id

Role ID to add

guild_member& Reference to self

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

guild_member & guild_member & dpp::guild_member::fill_from_json (nlohmann::json *j, snowflake g_id, snowflake u_id) fill_from_json dpp::guild_member::fill_from_json nlohmann::json * j snowflake g_id snowflake u_id

Fill this object from a json object.

j

The json object to get data from

g_id

The guild id to associate the member with

u_id

The user id to associate the member with

Reference to self for call chaining

guild_member & guild_member & dpp::json_interface< guild_member >::fill_from_json (nlohmann::json *j) fill_from_json dpp::json_interface< guild_member >::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::guild_member::get_avatar_url (uint16_t size=0, const image_type format=i_png, bool prefer_animated=true) const get_avatar_url dpp::guild_member::get_avatar_url uint16_t size 0 const image_type format i_png bool prefer_animated true

Returns the member's per guild avatar url if they have one, otherwise returns an empty string.

per-server avatar is a nitro only feature so it might be not set. If you need the user avatar, use user::get_avatar_url.

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

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

Return a ping/mention for the user by nickname.

std::string mention

std::string std::string dpp::guild_member::get_nickname () const get_nickname dpp::guild_member::get_nickname

Get the nickname.

std::string nickname

const std::vector< dpp::snowflake > & const std::vector< dpp::snowflake > & dpp::guild_member::get_roles () const get_roles dpp::guild_member::get_roles

Get the roles.

std::vector<dpp::snowflake> roles

user * user * dpp::guild_member::get_user () const get_user dpp::guild_member::get_user

Find the dpp::user object for this member. This is an alias for dpp::find_user.

dpp::user* Pointer to the user object. If not in cache, it returns nullptr

bool bool dpp::guild_member::has_animated_guild_avatar () const has_animated_guild_avatar dpp::guild_member::has_animated_guild_avatar

Returns true if the user's per-guild custom avatar is animated.

true user's custom avatar is animated

false user's custom avatar is not animated

bool bool dpp::guild_member::has_bypasses_verification () const has_bypasses_verification dpp::guild_member::has_bypasses_verification

Returns true if the user is exempt from guild verification requirements.

true user bypasses verification

false user doesn't bypass verification

bool bool dpp::guild_member::has_completed_onboarding () const has_completed_onboarding dpp::guild_member::has_completed_onboarding

Returns true if the user has completed onboarding.

true user has completed onboarding

false user has not completed onboarding

bool bool dpp::guild_member::has_rejoined () const has_rejoined dpp::guild_member::has_rejoined

Returns true if the user has left and rejoined the guild.

true user has left and rejoined the guild

false user has not rejoined

bool bool dpp::guild_member::has_started_onboarding () const has_started_onboarding dpp::guild_member::has_started_onboarding

Returns true if the user has started onboarding.

true user has started onboarding

false user has not started onboarding yet

bool bool dpp::guild_member::is_communication_disabled () const is_communication_disabled dpp::guild_member::is_communication_disabled

Returns true if the user is in time-out (communication disabled).

true user is in time-out

false user is not in time-out

bool bool dpp::guild_member::is_deaf () const is_deaf dpp::guild_member::is_deaf

Returns true if the user is deafened.

true user is deafened

false user is not deafened

bool bool dpp::guild_member::is_guild_owner () const is_guild_owner dpp::guild_member::is_guild_owner

Is this user also the guild member?

true if the user is the guild owner.

false if the user is not the guild owner or the guild is not in the cache.

If the guild cache is disabled, this function will always return false.

bool bool dpp::guild_member::is_muted () const is_muted dpp::guild_member::is_muted

Returns true if the user is muted.

true user muted

false user not muted

bool bool dpp::guild_member::is_pending () const is_pending dpp::guild_member::is_pending

Returns true if pending verification by membership screening.

true user has completed membership screening

false user has not completed membership screening

bool bool dpp::guild_member::operator== (guild_member const &other_member) const operator== dpp::guild_member::operator== guild_member const & other_member

Check if this member is equal to another member object.

other_member

other member object to compare

true if their user ids are equal, false otherwise.

guild_member & guild_member & dpp::guild_member::remove_role (dpp::snowflake role_id) remove_role dpp::guild_member::remove_role dpp::snowflake role_id

Remove a role from this member.

This call sets the role change bit, which causes the new role list to be sent if this is passed to dpp::cluster::guild_edit_member or dpp::cluster::guild_add_member

role_id

Role ID to remove

guild_member& Reference to self

guild_member & guild_member & dpp::guild_member::set_bypasses_verification (const bool is_bypassing_verification) set_bypasses_verification dpp::guild_member::set_bypasses_verification const bool is_bypassing_verification

Set whether the user is exempt from guild verification requirements.

is_bypassing_verification

value to set

guild_member& reference to self

guild_member & guild_member & dpp::guild_member::set_communication_disabled_until (const time_t timestamp) set_communication_disabled_until dpp::guild_member::set_communication_disabled_until const time_t timestamp

Set communication_disabled_until.

timestamp

timestamp until communication is disabled

guild_member& reference to self

guild_member & guild_member & dpp::guild_member::set_deaf (const bool is_deafened) set_deaf dpp::guild_member::set_deaf const bool is_deafened

Set whether the user is deafened in voice channels.

is_deafened

value to set, true if deaf in voice channels

guild_member& reference to self

guild_member & guild_member & dpp::guild_member::set_mute (const bool is_muted) set_mute dpp::guild_member::set_mute const bool is_muted

Set whether the user is muted in voice channels.

is_muted

value to set, true if mute in voice channels

guild_member& reference to self

guild_member & guild_member & dpp::guild_member::set_nickname (const std::string &nick) set_nickname dpp::guild_member::set_nickname const std::string & nick

Set the nickname.

nick

Nickname to set

guild_member& reference to self

guild_member & guild_member & dpp::guild_member::set_roles (const std::vector< dpp::snowflake > &role_ids) set_roles dpp::guild_member::set_roles const std::vector< dpp::snowflake > & role_ids

Set a new role list for this member.

This call sets the role change bit, which causes the new role list to be sent if this is passed to dpp::cluster::guild_edit_member or dpp::cluster::guild_add_member

role_ids

Roles to set

guild_member& Reference to self

auto auto dpp::json_interface< guild_member >::to_json (bool with_id=false) const to_json dpp::json_interface< guild_member >::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

Represents dpp::user membership upon a dpp::guild. This contains the user's nickname, guild roles, and any other guild-specific flags.

dpp::guild_member
dpp::json_interface< T >
dpp::json_interface< guild_member >
< guild_member >
T
dpp::guild_member
nickname
roles
flags
guild_id
user_id
avatar
communication_disabled_until
joined_at
premium_since
dpp::json_interface< T >
dpp::json_interface< guild_member >
< guild_member >
dpp::snowflake
value
dpp::utility::iconhash
first
second
std::basic_string< Char >
std::string
std::vector< T >
elements
std::vector< dpp::snowflake >
elements
< dpp::snowflake >
time_t
uint16_t
uint64_t
- dpp::guild_member
  add_role
- dpp::guild_member
  avatar
- dpp::guild_member
  build_json
- dpp::guild_member
  communication_disabled_until
- dpp::guild_member
  fill_from_json
- dpp::guild_member
  fill_from_json
- dpp::guild_member
  flags
- dpp::guild_member
  from_json
- dpp::guild_member
  get_avatar_url
- dpp::guild_member
  get_mention
- dpp::guild_member
  get_nickname
- dpp::guild_member
  get_roles
- dpp::guild_member
  get_user
- dpp::guild_member
  guild_id
- dpp::guild_member
  guild_member
- dpp::guild_member
  has_animated_guild_avatar
- dpp::guild_member
  has_bypasses_verification
- dpp::guild_member
  has_completed_onboarding
- dpp::guild_member
  has_rejoined
- dpp::guild_member
  has_started_onboarding
- dpp::guild_member
  is_communication_disabled
- dpp::guild_member
  is_deaf
- dpp::guild_member
  is_guild_owner
- dpp::guild_member
  is_muted
- dpp::guild_member
  is_pending
- dpp::guild_member
  joined_at
- dpp::guild_member
  json_interface< guild_member >
- dpp::guild_member
  nickname
- dpp::guild_member
  operator==
- dpp::guild_member
  premium_since
- dpp::guild_member
  remove_role
- dpp::guild_member
  roles
- dpp::guild_member
  set_bypasses_verification
- dpp::guild_member
  set_communication_disabled_until
- dpp::guild_member
  set_deaf
- dpp::guild_member
  set_mute
- dpp::guild_member
  set_nickname
- dpp::guild_member
  set_roles
- dpp::guild_member
  to_json
- dpp::guild_member
  to_json_impl
- dpp::guild_member
  user_id