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

This object represents an audio file to be treated as music by the Telegram clients. https://core.telegram.org/bots/api#audio. More...

#include <Audio.hpp>

Public Member Functions

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

Public Attributes

std::string fileId
 Identifier for this file, which can be used to download or reuse the file. More...
 
std::string fileUniqueId
 Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. More...
 
std::int32_t duration {}
 Duration of the audio in seconds as defined by sender. More...
 
std::string performer
 Optional. Performer of the audio as defined by sender or by audio tags. More...
 
std::string title
 Optional. Title of the audio as defined by sender or by audio tags. More...
 
std::string fileName
 Optional. Original filename as defined by sender. More...
 
std::string mimeType
 Optional. MIME type of the file as defined by sender. More...
 
std::int64_t fileSize {}
 Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. More...
 
Ptr< PhotoSizethumbnail
 Optional. Thumbnail of the album cover to which the music file belongs. More...
 

Detailed Description

This object represents an audio file to be treated as music by the Telegram clients. https://core.telegram.org/bots/api#audio.

Definition at line 8 of file Audio.hpp.

Constructor & Destructor Documentation

◆ Audio() [1/2]

tgbotxx::Audio::Audio ( )
default

◆ Audio() [2/2]

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

Definition at line 10 of file Audio.hpp.

Member Function Documentation

◆ fromJson()

void tgbotxx::Audio::fromJson ( const nl::json &  json)
inline

Deserializes this object from JSON.

Definition at line 62 of file Audio.hpp.

◆ toJson()

nl::json tgbotxx::Audio::toJson ( ) const
inline

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 47 of file Audio.hpp.

Member Data Documentation

◆ duration

std::int32_t tgbotxx::Audio::duration {}

Duration of the audio in seconds as defined by sender.

Definition at line 22 of file Audio.hpp.

◆ fileId

std::string tgbotxx::Audio::fileId

Identifier for this file, which can be used to download or reuse the file.

Definition at line 15 of file Audio.hpp.

◆ fileName

std::string tgbotxx::Audio::fileName

Optional. Original filename as defined by sender.

Definition at line 31 of file Audio.hpp.

◆ fileSize

std::int64_t tgbotxx::Audio::fileSize {}

Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

Definition at line 39 of file Audio.hpp.

◆ fileUniqueId

std::string tgbotxx::Audio::fileUniqueId

Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.

Definition at line 19 of file Audio.hpp.

◆ mimeType

std::string tgbotxx::Audio::mimeType

Optional. MIME type of the file as defined by sender.

Definition at line 34 of file Audio.hpp.

◆ performer

std::string tgbotxx::Audio::performer

Optional. Performer of the audio as defined by sender or by audio tags.

Definition at line 25 of file Audio.hpp.

◆ thumbnail

Ptr<PhotoSize> tgbotxx::Audio::thumbnail

Optional. Thumbnail of the album cover to which the music file belongs.

Definition at line 42 of file Audio.hpp.

◆ title

std::string tgbotxx::Audio::title

Optional. Title of the audio as defined by sender or by audio tags.

Definition at line 28 of file Audio.hpp.


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