tgbotxx  1.1.6.9
Telegram Bot C++ Library
tgbotxx::InputMedia Struct Reference

This object represents the content of a media message to be sent. It should be one of: More...

#include <InputMedia.hpp>

Inheritance diagram for tgbotxx::InputMedia:
tgbotxx::InputMediaAnimation tgbotxx::InputMediaAudio tgbotxx::InputMediaDocument tgbotxx::InputMediaPhoto tgbotxx::InputMediaVideo

Public Member Functions

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

Public Attributes

std::string type
 Type of the result. More...
 
std::variant< cpr::File, std::string > media {""}
 File to send. More...
 
std::string caption
 Optional. Caption of the media to be sent, 0-1024 characters after entities parsing. More...
 
std::string parseMode
 Optional. Mode for parsing entities in the media caption. See https://core.telegram.org/bots/api#formatting-options for more details. More...
 
std::vector< Ptr< MessageEntity > > captionEntities
 Optional. List of special entities that appear in the caption, which can be specified instead of parseMode. More...
 

Detailed Description

This object represents the content of a media message to be sent. It should be one of:

Definition at line 13 of file InputMedia.hpp.

Constructor & Destructor Documentation

◆ InputMedia() [1/2]

tgbotxx::InputMedia::InputMedia ( )
default

◆ InputMedia() [2/2]

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

Definition at line 15 of file InputMedia.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Reimplemented in tgbotxx::InputMediaVideo, tgbotxx::InputMediaPhoto, tgbotxx::InputMediaAudio, tgbotxx::InputMediaDocument, and tgbotxx::InputMediaAnimation.

Definition at line 58 of file InputMedia.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Reimplemented in tgbotxx::InputMediaVideo, tgbotxx::InputMediaPhoto, tgbotxx::InputMediaAudio, tgbotxx::InputMediaDocument, and tgbotxx::InputMediaAnimation.

Definition at line 43 of file InputMedia.hpp.

Member Data Documentation

◆ caption

std::string tgbotxx::InputMedia::caption

Optional. Caption of the media to be sent, 0-1024 characters after entities parsing.

Definition at line 31 of file InputMedia.hpp.

◆ captionEntities

std::vector<Ptr<MessageEntity> > tgbotxx::InputMedia::captionEntities

Optional. List of special entities that appear in the caption, which can be specified instead of parseMode.

Definition at line 38 of file InputMedia.hpp.

◆ media

std::variant<cpr::File, std::string> tgbotxx::InputMedia::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 28 of file InputMedia.hpp.

◆ parseMode

std::string tgbotxx::InputMedia::parseMode

Optional. Mode for parsing entities in the media caption. See https://core.telegram.org/bots/api#formatting-options for more details.

Definition at line 35 of file InputMedia.hpp.

◆ type

std::string tgbotxx::InputMedia::type

Type of the result.

Definition at line 20 of file InputMedia.hpp.


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