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

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

Represents a pinned message. More...

`#include <message.h>`

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

## Public Member Functions

| message_pin ()
| message_pin (const message_pin &msg_pin)=default
| message_pin (message_pin &&msg_pin)=default
| message_pin (time_t _pinned_at, const message &_pinned_message)
| ~message_pin ()=default
| Destroy the message_pin object.
std::string | build_json (bool with_id=false) const
| Convert object to json string.
message_pin & | fill_from_json (nlohmann::json *j)
| Convert object from nlohmann::json.
message_pin & | operator= (const message_pin &msg_pin)=default
| Copy a message_pin object.
message_pin & | operator= (message_pin &&msg_pin)=default
| Move a message_pin object.
auto | to_json (bool with_id=false) const
| Convert object to nlohmann::json.

## Public Attributes

time_t | pinned_at
| The time the message was pinned.
message | pinned_message
| The pinned message.

## Protected Member Functions

message_pin & | fill_from_json_impl (nlohmann::json *j)
| Fill in object from json data.
virtual json | to_json () const

## Friends

struct | json_interface< message_pin >

## Detailed Description

Represents a pinned message.

## Constructor & Destructor Documentation

## ◆ message_pin() [1/4]

dpp::message_pin::message_pin | ( |  | ) |

## ◆ message_pin() [2/4]

dpp::message_pin::message_pin | ( | time_t | _pinned_at,
|  | const message & | _pinned_message )

## ◆ message_pin() [3/4]

dpp::message_pin::message_pin | ( | const message_pin & | msg_pin | ) |

default

## ◆ message_pin() [4/4]

dpp::message_pin::message_pin | ( | message_pin && | msg_pin | ) |

default

## ◆ ~message_pin()

dpp::message_pin::~message_pin | ( |  | ) |

default

Destroy the message_pin object.

## Member Function Documentation

## ◆ build_json()

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

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

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

protected

Fill in object from json data.

Parameters

  j | JSON data

Returns
  message_pin& Reference to self

## ◆ operator=() [1/2]

message_pin & dpp::message_pin::operator= | ( | const message_pin & | msg_pin | ) |

default

Copy a message_pin object.

Parameters

  msg_pin | message_pin to copy

Returns
  message_pin& Reference to self

## ◆ operator=() [2/2]

message_pin & dpp::message_pin::operator= | ( | message_pin && | msg_pin | ) |

default

Move a message_pin object.

Parameters

  msg_pin | message_pin to move

Returns
  message_pin& Reference to self

## ◆ to_json() [1/2]

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

## ◆ to_json() [2/2]

virtual json dpp::message_pin::to_json | ( |  | ) | const

protected virtual

Build JSON from this object.

Returns
  The JSON text of the message_pin

## Friends And Related Symbol Documentation

## ◆ json_interface< message_pin >

friend struct json_interface< message_pin >

friend

## Member Data Documentation

## ◆ pinned_at

time_t dpp::message_pin::pinned_at

The time the message was pinned.

## ◆ pinned_message

message dpp::message_pin::pinned_message

The pinned message.

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