qTbot
0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
Toggle main menu visibility
telegramfile.cpp
Go to the documentation of this file.
1
//#
2
//# Copyright (C) 2023-2026 QuasarApp.
3
//# Distributed under the GPLv3 software license, see the accompanying
4
//# Everyone is permitted to copy and distribute verbatim copies
5
//# of this license document, but changing it is not allowed.
6
//#
7
8
9
#include "
telegramfile.h
"
10
11
namespace
qTbot
{
12
13
TelegramFile::TelegramFile
() {
14
15
}
16
17
TelegramFile::TelegramFile
(
const
QJsonObject &jsonObject):
IJsonBasedObject
(jsonObject) {
18
19
}
20
21
int
TelegramFile::fileSize
()
const
{
22
return
rawJson
()[
"file_size"
].toInt();
23
}
24
25
QString
TelegramFile::takePath
() {
26
if
(_used)
27
return
""
;
28
29
_used =
true
;
30
31
return
rawJson
()[
"file_path"
].toString();
32
}
33
34
QString
TelegramFile::fileId
()
const
{
35
return
rawJson
()[
"file_id"
].toString();
36
}
37
38
39
QString
TelegramFile::fileUniqueId
()
const
{
40
return
rawJson
()[
"file_unique_id"
].toString();
41
}
42
43
}
qTbot::IJsonBasedObject::rawJson
const QJsonObject & rawJson() const
rawJson Telegram uses a rest api with json objects. So all received messages are parsed into a json o...
Definition
ijsonbasedobject.cpp:21
qTbot::IJsonBasedObject::IJsonBasedObject
IJsonBasedObject()
IJsonBasedObject default constructor.
Definition
ijsonbasedobject.cpp:12
qTbot::TelegramFile::fileId
QString fileId() const
Returns the file ID of the file.
Definition
telegramfile.cpp:34
qTbot::TelegramFile::fileUniqueId
QString fileUniqueId() const
Returns the unique ID of the file.
Definition
telegramfile.cpp:39
qTbot::TelegramFile::fileSize
int fileSize() const
Returns the file size of the file.
Definition
telegramfile.cpp:21
qTbot::TelegramFile::TelegramFile
TelegramFile()
TelegramFile default constructor.
Definition
telegramfile.cpp:13
qTbot::TelegramFile::takePath
QString takePath()
Returns the file path to get from the web.
Definition
telegramfile.cpp:25
qTbot
Definition
telegramdeletemessage.cpp:8
telegramfile.h
src
qTbot
src
public
qTbot
messages
telegramfile.cpp
Generated by
1.18.0