qTbot 0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
qTbot::TelegramFile Class Reference

The TelegramFile class is base class for all files. More...

#include <telegramfile.h>

Inheritance diagram for qTbot::TelegramFile:
Inheritance graph
Collaboration diagram for qTbot::TelegramFile:
Collaboration graph

Public Member Functions

 TelegramFile ()
 TelegramFile default constructor.
 TelegramFile (const QJsonObject &jsonObject)
 Constructs a File object from a JSON object.
QString fileId () const
 Returns the file ID of the file.
QString fileUniqueId () const
 Returns the unique ID of the file.
int fileSize () const
 Returns the file size of the file.
QString takePath ()
 Returns the file path to get from the web.
Public Member Functions inherited from qTbot::IJsonBasedObject
 IJsonBasedObject ()
 IJsonBasedObject default constructor.
 IJsonBasedObject (const QJsonObject &newRawJson)
 IJsonBasedObject constructs the object from a raw json value.
const QJsonObject & rawJson () const
 rawJson Telegram uses a rest api with json objects. So all received messages are parsed into a json object.
virtual void setRawJson (const QJsonObject &newRawJson)
 setRawJson This method sets a new raw json data of the object.

Detailed Description

The TelegramFile class is base class for all files.

Definition at line 17 of file telegramfile.h.

Constructor & Destructor Documentation

◆ TelegramFile() [1/2]

qTbot::TelegramFile::TelegramFile ( )

TelegramFile default constructor.

Definition at line 13 of file telegramfile.cpp.

Here is the caller graph for this function:

◆ TelegramFile() [2/2]

qTbot::TelegramFile::TelegramFile ( const QJsonObject & jsonObject)

Constructs a File object from a JSON object.

Parameters
jsonObjectThe JSON object containing file data.

Definition at line 17 of file telegramfile.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ fileId()

QString qTbot::TelegramFile::fileId ( ) const

Returns the file ID of the file.

Returns
The file ID of the file.

Definition at line 34 of file telegramfile.cpp.

Here is the call graph for this function:

◆ fileSize()

int qTbot::TelegramFile::fileSize ( ) const

Returns the file size of the file.

Returns
The file size of the file.

Definition at line 21 of file telegramfile.cpp.

Here is the call graph for this function:

◆ fileUniqueId()

QString qTbot::TelegramFile::fileUniqueId ( ) const

Returns the unique ID of the file.

Returns
The unique ID of the file.

Definition at line 39 of file telegramfile.cpp.

Here is the call graph for this function:

◆ takePath()

QString qTbot::TelegramFile::takePath ( )
nodiscard

Returns the file path to get from the web.

Returns
The file path to get from the web. Returns an empty string if the file was already used.
Note
It is possible to get a file from the web only one time after invoking the getFile method. If you invoke this method twice, on the second time you receive an empty string. This is a rule of the telegram backend. See https://core.telegram.org/bots/api#file

Definition at line 25 of file telegramfile.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: