Represents user presence, e.g. More...
#include "presence.h"
Public Member Functions | |
presence () | |
Constructor. More... | |
presence (presence_status status, activity_type type, const std::string &activity_description) | |
Construct a new presence object with some parameters for sending to a websocket. More... | |
presence (presence_status status, const activity &a) | |
Construct a new presence object with some parameters for sending to a websocket. More... | |
~presence () | |
Destructor. More... | |
std::string | build_json (bool with_id=false) const |
Convert object to json string. More... | |
presence_status | desktop_status () const |
The users status on desktop. More... | |
presence & | fill_from_json (nlohmann::json *j) |
Convert object from nlohmann::json. More... | |
presence_status | mobile_status () const |
The user's status on mobile. More... | |
presence_status | status () const |
The user's status as shown to other users. More... | |
json | to_json (bool with_id=false) const |
Build JSON from this object. More... | |
presence_status | web_status () const |
The user's status on web. More... | |
Public Attributes | |
std::vector< activity > | activities |
List of activities. More... | |
uint8_t | flags |
Flags bitmask containing dpp::presence_flags. More... | |
snowflake | guild_id |
Guild ID. More... | |
snowflake | user_id |
The user the presence applies to. More... | |
Protected Member Functions | |
presence & | fill_from_json_impl (nlohmann::json *j) |
Fill this object from json. More... | |
virtual json | to_json_impl (bool with_id=false) const |
Build JSON from this object. More... | |
Friends | |
struct | json_interface< presence > |
Represents user presence, e.g.
what game they are playing and if they are online
dpp::presence::presence | ( | ) |
Constructor.
References flags, and dpp::p_status_online.
dpp::presence::presence | ( | presence_status | status, |
activity_type | type, | ||
const std::string & | activity_description | ||
) |
Construct a new presence object with some parameters for sending to a websocket.
status | Status of the activity |
type | Type of activity |
activity_description | Description of the activity |
dpp::presence::presence | ( | presence_status | status, |
const activity & | a | ||
) |
Construct a new presence object with some parameters for sending to a websocket.
status | Status of the activity |
a | Activity itself |
References dpp::unicode_emoji::desktop, and dpp::string_not_null().
|
default |
Destructor.
|
inlineinherited |
Convert object to json string.
with_id | Whether to include the ID or not |
presence_status dpp::presence::desktop_status | ( | ) | const |
The users status on desktop.
|
inlineinherited |
Convert object from nlohmann::json.
j | nlohmann::json object |
|
protected |
Fill this object from json.
j | JSON object to fill from |
presence_status dpp::presence::mobile_status | ( | ) | const |
The user's status on mobile.
presence_status dpp::presence::status | ( | ) | const |
The user's status as shown to other users.
json dpp::presence::to_json | ( | bool | with_id = false | ) | const |
Build JSON from this object.
with_id | Add ID to output |
|
protectedvirtual |
Build JSON from this object.
with_id | Add ID to output |
References dpp::at_custom.
presence_status dpp::presence::web_status | ( | ) | const |
The user's status on web.
|
friend |
std::vector<activity> dpp::presence::activities |
List of activities.
uint8_t dpp::presence::flags |
Flags bitmask containing dpp::presence_flags.
Referenced by presence().
snowflake dpp::presence::guild_id |
Guild ID.
snowflake dpp::presence::user_id |
The user the presence applies to.