tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
tgbotxx::InputPaidMedia Struct Reference

Base class describing paid media to send https://core.telegram.org/bots/api#inputpaidmedia. More...

#include <InputPaidMedia.hpp>

Inheritance diagram for tgbotxx::InputPaidMedia:
tgbotxx::InputPaidMediaPhoto tgbotxx::InputPaidMediaVideo

Public Member Functions

 InputPaidMedia ()=default
 
 InputPaidMedia (const nl::json &json)
 
virtual ~InputPaidMedia ()=default
 
virtual nl::json toJson () const
 Serializes this object to JSON.
 
virtual void fromJson (const nl::json &json)
 Deserializes this object from JSON.
 

Public Attributes

std::string type
 Type of the media.
 
std::variant< cpr::File, std::string > media {""}
 File to send.
 

Detailed Description

Base class describing paid media to send https://core.telegram.org/bots/api#inputpaidmedia.

Definition at line 10 of file InputPaidMedia.hpp.

Constructor & Destructor Documentation

◆ InputPaidMedia() [1/2]

tgbotxx::InputPaidMedia::InputPaidMedia ( )
default

◆ InputPaidMedia() [2/2]

tgbotxx::InputPaidMedia::InputPaidMedia ( const nl::json &  json)
inlineexplicit

Definition at line 12 of file InputPaidMedia.hpp.

◆ ~InputPaidMedia()

virtual tgbotxx::InputPaidMedia::~InputPaidMedia ( )
virtualdefault

Member Function Documentation

◆ fromJson()

virtual void tgbotxx::InputPaidMedia::fromJson ( const nl::json &  json)
inlinevirtual

Deserializes this object from JSON.

Reimplemented in tgbotxx::InputPaidMediaPhoto, and tgbotxx::InputPaidMediaVideo.

Definition at line 41 of file InputPaidMedia.hpp.

◆ toJson()

virtual nl::json tgbotxx::InputPaidMedia::toJson ( ) const
inlinevirtual

Serializes this object to JSON.

Reimplemented in tgbotxx::InputPaidMediaPhoto, and tgbotxx::InputPaidMediaVideo.

Definition at line 29 of file InputPaidMedia.hpp.

Member Data Documentation

◆ media

std::variant<cpr::File, std::string> tgbotxx::InputPaidMedia::media {""}

File to send.

  • Pass a file_id std::string to send a file that exists on the Telegram servers (recommended),
  • Pass an HTTP URL std::string for Telegram to get a file from the Internet, or
  • Pass a cpr::File to upload a local file The latter will internally use “attach://<file_attach_name>” with multipart/form-data under <file_attach_name> name to upload the local file. More information on Sending Files » https://core.telegram.org/bots/api#sending-files

Definition at line 26 of file InputPaidMedia.hpp.

◆ type

std::string tgbotxx::InputPaidMedia::type

Type of the media.

Definition at line 18 of file InputPaidMedia.hpp.


The documentation for this struct was generated from the following file: