D++ (DPP)
C++ Discord API Bot Library
Loading...
Searching...
No Matches
dpp::message_pin Class Reference

Represents a pinned message. More...

#include <message.h>

Inheritance diagram for dpp::message_pin:
Collaboration diagram for dpp::message_pin:

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_pinfill_from_json (nlohmann::json *j)
 Convert object from nlohmann::json.
message_pinoperator= (const message_pin &msg_pin)=default
 Copy a message_pin object.
message_pinoperator= (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_pinfill_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
inlineinherited

Convert object to json string.

Parameters
with_idWhether 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)
inlineinherited

Convert object from nlohmann::json.

Parameters
jnlohmann::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
jJSON 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_pinmessage_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_pinmessage_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
inlineinherited

Convert object to nlohmann::json.

Parameters
with_idWhether 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
protectedvirtual

Build JSON from this object.

Returns
The JSON text of the message_pin

◆ 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.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0