| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
dpp::voicestate Class Reference

Represents the voice state of a user on a guild These are stored in the dpp::guild object, and accessible there, or via dpp::channel::get_voice_members. More...

`#include <voicestate.h>`

Inheritance diagram for dpp::voicestate:
[legend]
Collaboration diagram for dpp::voicestate:
[legend]

## Public Member Functions

| voicestate ()
| Construct a new voicestate object.
virtual | ~voicestate ()=default
| Destroy the voicestate object.
std::string | build_json (bool with_id=false) const
| Convert object to json string.
voicestate & | fill_from_json (nlohmann::json *j)
| Convert object from nlohmann::json.
bool | is_deaf () const
| Return true if the user is deafened by the server.
bool | is_mute () const
| Return true if the user is muted by the server.
bool | is_self_deaf () const
| Return true if user deafened themselves.
bool | is_self_mute () const
| Return true if user muted themselves.
bool | is_suppressed () const
| Return true if user is suppressed.
bool | self_stream () const
| Return true if the user is streaming using "Go Live".
bool | self_video () const
| Return true if the user's camera is enabled.
auto | to_json (bool with_id=false) const
| Convert object to nlohmann::json.

## Public Attributes

snowflake | channel_id {0}
| The channel id this user is connected to.
uint8_t | flags {0}
| Voice state flags from dpp::voicestate_flags.
snowflake | guild_id {0}
| Optional: The guild id this voice state is for.
time_t | request_to_speak {0}
| The time at which the user requested to speak.
std::string | session_id
| The session id for this voice state.
int32_t | shard_id {0}
| Owning shard.
snowflake | user_id {0}
| The user id this voice state is for.

## Protected Member Functions

voicestate & | fill_from_json_impl (nlohmann::json *j)
| Fill voicestate object from json data.

## Friends

struct | json_interface< voicestate >

## Detailed Description

Represents the voice state of a user on a guild These are stored in the dpp::guild object, and accessible there, or via dpp::channel::get_voice_members.

## Constructor & Destructor Documentation

## ◆ voicestate()

dpp::voicestate::voicestate | ( |  | ) |

Construct a new voicestate object.

## ◆ ~voicestate()

virtual dpp::voicestate::~voicestate | ( |  | ) |

virtual default

Destroy the voicestate object.

## Member Function Documentation

## ◆ build_json()

std::string dpp::json_interface< voicestate >::build_json | ( | bool | with_id = false | ) | const

inline inherited

Convert object to json string.

Parameters

  with_id | Whether to include the ID or not

Note
  Some fields are conditionally filled, do not rely on all fields being present

Returns
  std::string Json built from the structure

## ◆ fill_from_json()

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

inline inherited

Convert object from nlohmann::json.

Parameters

  j | nlohmann::json object

Returns
  T& Reference to self for fluent calling

## ◆ fill_from_json_impl()

voicestate & dpp::voicestate::fill_from_json_impl | ( | nlohmann::json * | j | ) |

protected

Fill voicestate object from json data.

Parameters

  j | JSON data to fill from

Returns
  voicestate& Reference to self

## ◆ is_deaf()

bool dpp::voicestate::is_deaf | ( |  | ) | const

Return true if the user is deafened by the server.

## ◆ is_mute()

bool dpp::voicestate::is_mute | ( |  | ) | const

Return true if the user is muted by the server.

## ◆ is_self_deaf()

bool dpp::voicestate::is_self_deaf | ( |  | ) | const

Return true if user deafened themselves.

## ◆ is_self_mute()

bool dpp::voicestate::is_self_mute | ( |  | ) | const

Return true if user muted themselves.

## ◆ is_suppressed()

bool dpp::voicestate::is_suppressed | ( |  | ) | const

Return true if user is suppressed.

"HELP HELP I'M BEING SUPPRESSED!"

## ◆ self_stream()

bool dpp::voicestate::self_stream | ( |  | ) | const

Return true if the user is streaming using "Go Live".

## ◆ self_video()

bool dpp::voicestate::self_video | ( |  | ) | const

Return true if the user's camera is enabled.

## ◆ to_json()

auto dpp::json_interface< voicestate >::to_json | ( | bool | with_id = false | ) | const

inline inherited

Convert object to nlohmann::json.

Parameters

  with_id | Whether to include the ID or not

Note
  Some fields are conditionally filled, do not rely on all fields being present

Returns
  json Json built from the structure

## Friends And Related Symbol Documentation

## ◆ json_interface< voicestate >

friend struct json_interface< voicestate >

friend

## Member Data Documentation

## ◆ channel_id

snowflake dpp::voicestate::channel_id {0}

The channel id this user is connected to.

Note
  This may be empty.

## ◆ flags

uint8_t dpp::voicestate::flags {0}

Voice state flags from dpp::voicestate_flags.

## ◆ guild_id

snowflake dpp::voicestate::guild_id {0}

Optional: The guild id this voice state is for.

## ◆ request_to_speak

time_t dpp::voicestate::request_to_speak {0}

The time at which the user requested to speak.

Note
  If the user never requested to speak, this is 0.

## ◆ session_id

std::string dpp::voicestate::session_id

The session id for this voice state.

## ◆ shard_id

int32_t dpp::voicestate::shard_id {0}

Owning shard.

## ◆ user_id

snowflake dpp::voicestate::user_id {0}

The user id this voice state is for.

D++ Library version 9.0.13 D++ Library version 9.0.12 D++ Library version 9.0.11 D++ Library version 9.0.10 D++ Library version 9.0.9 D++ Library version 9.0.8 D++ Library version 9.0.7 D++ Library version 9.0.6 D++ Library version 9.0.5 D++ Library version 9.0.4 D++ Library version 9.0.3 D++ Library version 9.0.2 D++ Library version 9.0.1 D++ Library version 9.0.0 D++ Library version 1.0.2 D++ Library version 1.0.1 D++ Library version 1.0.0