aegis.cpp
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Public Types | Public Member Functions | Friends | List of all members
aegis::user Class Reference

Stores user-specific and guild-specific attributes of users. More...

#include <user.hpp>

Classes

struct  guild_info
 Member owned guild information. More...
 

Public Types

using presence = aegis::gateway::objects::presence
 

Public Member Functions

 user (snowflake id)
 
std::string get_name (snowflake guild_id) noexcept
 Get the nickname of this user. More...
 
std::string get_username () const noexcept
 Get the nickname of this user. More...
 
uint16_t get_discriminator () const noexcept
 Get the discriminator of this user. More...
 
std::string get_avatar () const noexcept
 Get the avatar hash of this user. More...
 
bool is_bot () const noexcept
 Check whether user is a bot. More...
 
bool is_mfa_enabled () const noexcept
 Get the status of multi factor authentication. More...
 
std::string get_mention () const noexcept
 Builds a mention for this user. More...
 
guild_infoget_guild_info (snowflake guild_id) noexcept
 Get the member owned guild information object. More...
 
guild_infoget_guild_info_nolock (snowflake guild_id) noexcept
 
guild_infoget_guild_info_nocreate (snowflake guild_id) const noexcept
 
std::string get_full_name () const noexcept
 Get the full name (username#discriminator) of this user. More...
 
snowflake get_id () const noexcept
 Get the snowflake of this user. More...
 
bool has_dm () const noexcept
 Whether the DM channel id for this user has been cached yet. More...
 
snowflake get_dm_id () const noexcept
 
void set_dm_id (snowflake _id) noexcept
 Set the DM channel id for the user. More...
 
shared_mutex & mtx () noexcept
 

Friends

class core
 
class guild
 
class gateway::objects::message
 

Detailed Description

Stores user-specific and guild-specific attributes of users.

Member Function Documentation

std::string aegis::user::get_avatar ( ) const
noexcept

Get the avatar hash of this user.

Returns
string of the avatar hash
uint16_t aegis::user::get_discriminator ( ) const
noexcept

Get the discriminator of this user.

Returns
string of the discriminator
snowflake aegis::user::get_dm_id ( ) const
noexcept

Get the DM channel associated with this user DM channels are obtained when a DM is sent

Returns
snowflake of DM channel
std::string aegis::user::get_full_name ( ) const
noexcept

Get the full name (username#discriminator) of this user.

Returns
string of the full username and discriminator
user::guild_info & aegis::user::get_guild_info ( snowflake  guild_id)
noexcept

Get the member owned guild information object.

Parameters
guild_idThe snowflake for the guild
Returns
Pointer to the member owned guild information object
snowflake aegis::user::get_id ( ) const
noexcept

Get the snowflake of this user.

Returns
snowflake of the user
std::string aegis::user::get_mention ( ) const
noexcept

Builds a mention for this user.

Returns
string of member mention
std::string aegis::user::get_name ( snowflake  guild_id)
noexcept

Get the nickname of this user.

Parameters
guild_idThe snowflake for the guild to check if nickname is set
Returns
string of the nickname or empty if no nickname is set
std::string aegis::user::get_username ( ) const
noexcept

Get the nickname of this user.

Returns
string of the username
bool aegis::user::has_dm ( ) const
noexcept

Whether the DM channel id for this user has been cached yet.

Returns
bool
bool aegis::user::is_bot ( ) const
noexcept

Check whether user is a bot.

Returns
bool of bot status
bool aegis::user::is_mfa_enabled ( ) const
noexcept

Get the status of multi factor authentication.

Returns
bool of mfa status
shared_mutex& aegis::user::mtx ( )
noexcept
Returns
shared_mutex The mutex for the user
void aegis::user::set_dm_id ( snowflake  _id)
noexcept

Set the DM channel id for the user.

Parameters
_idSnowflake of DM channel for this user

The documentation for this class was generated from the following files: