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

This object represents a voice note. https://core.telegram.org/bots/api#voice. More...

#include <Voice.hpp>

Public Member Functions

 Voice ()=default
 
 Voice (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 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...
 

Detailed Description

This object represents a voice note. https://core.telegram.org/bots/api#voice.

Definition at line 7 of file Voice.hpp.

Constructor & Destructor Documentation

◆ Voice() [1/2]

tgbotxx::Voice::Voice ( )
default

◆ Voice() [2/2]

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

Definition at line 9 of file Voice.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 44 of file Voice.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 33 of file Voice.hpp.

Member Data Documentation

◆ duration

std::int32_t tgbotxx::Voice::duration {}

Duration of the audio in seconds as defined by sender.

Definition at line 21 of file Voice.hpp.

◆ fileId

std::string tgbotxx::Voice::fileId

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

Definition at line 14 of file Voice.hpp.

◆ fileSize

std::int64_t tgbotxx::Voice::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 29 of file Voice.hpp.

◆ fileUniqueId

std::string tgbotxx::Voice::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 18 of file Voice.hpp.

◆ mimeType

std::string tgbotxx::Voice::mimeType

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

Definition at line 24 of file Voice.hpp.


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