qTbot 0.89.ee6949a
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>

Public Member Functions

 TelegramFile ()
 
 TelegramFile (const QJsonObject &jsonObject)
 Constructs a Photo object from a JSON object.
 
QString fileId () const
 Returns the file ID of the photo.
 
QString fileUniqueId () const
 Returns the unique ID of the photo.
 
int fileSize () const
 Returns the file size of the photo.
 
QString takePath ()
 Returns the file path to get from web.
 
- Public Member Functions inherited from qTbot::IJsonBasedObject
 IJsonBasedObject ()
 
 IJsonBasedObject (const QJsonObject &newRawJson)
 
const QJsonObject & rawJson () const
 rawJson Telegram use rest api with json objects. So all received messages will be parsed in to jsobject.
 
virtual void setRawJson (const QJsonObject &newRawJson)
 setRawJson this method convert jsobject into telegram message.
 

Detailed Description

The TelegramFile class is base class for all files.

Definition at line 17 of file telegramfile.h.

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

Constructor & Destructor Documentation

◆ TelegramFile() [1/2]

qTbot::TelegramFile::TelegramFile ( )

Definition at line 13 of file telegramfile.cpp.

◆ TelegramFile() [2/2]

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

Constructs a Photo object from a JSON object.

Parameters
jsonObjectThe JSON object containing photo data.

Definition at line 17 of file telegramfile.cpp.

Member Function Documentation

◆ fileId()

QString qTbot::TelegramFile::fileId ( ) const

Returns the file ID of the photo.

Returns
The file ID of the photo.

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 photo.

Returns
The file size of the photo.

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 photo.

Returns
The unique ID of the photo.

Definition at line 39 of file telegramfile.cpp.

Here is the call graph for this function:

◆ takePath()

QString qTbot::TelegramFile::takePath ( )

Returns the file path to get from web.

Returns
The file size of the photo. return empty string if file alredy used.
Note
posible to get file from web only one time after invoke the getFile method. If you invoke this method 2 times on the second time you receive empty string. This is rooles of the telegram backend. see https://telegram-bot-sdk.readme.io/reference/getfile

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: