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

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

The ban class represents a ban on a guild. More...

`#include <ban.h>`

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

## Public Member Functions

| ban ()
virtual | ~ban ()=default
std::string | build_json (bool with_id=false) const
| Convert object to json string.
ban & | fill_from_json (nlohmann::json *j)
| Convert object from nlohmann::json.
auto | to_json (bool with_id=false) const
| Convert object to nlohmann::json.

## Public Attributes

std::string | reason
| The ban reason.
snowflake | user_id
| User ID the ban applies to.

## Protected Member Functions

ban & | fill_from_json_impl (nlohmann::json *j)

## Friends

struct | json_interface< ban >

## Detailed Description

The ban class represents a ban on a guild.

## Constructor & Destructor Documentation

## ◆ ban()

dpp::ban::ban | ( |  | ) |

Constructor

## ◆ ~ban()

virtual dpp::ban::~ban | ( |  | ) |

virtual default

Destructor

## Member Function Documentation

## ◆ build_json()

std::string dpp::json_interface< ban >::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()

ban & dpp::json_interface< ban >::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()

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

protected

Read class values from json object

Parameters

  j | A json object to read from

Returns
  A reference to self

## ◆ to_json()

auto dpp::json_interface< ban >::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< ban >

friend struct json_interface< ban >

friend

## Member Data Documentation

## ◆ reason

std::string dpp::ban::reason

The ban reason.

## ◆ user_id

snowflake dpp::ban::user_id

User ID the ban applies to.

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