qTbot 0.89.ee6949a
qTbot is base back end library for your c++ Qt projects.
telegramupdateanswer.cpp
Go to the documentation of this file.
1//#
2//# Copyright (C) 2023-2024 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
9
10namespace qTbot {
11
16
17QJsonValue TelegramUpdateAnswer::result() const {
18 return rawJson().value("result");
19}
20
22 return rawJson().value("error_code").toInt();
23}
24
26 return rawJson().value("description").toString();
27}
28
30 return "";
31}
32
34 return {};
35}
36
37unsigned long long TelegramUpdateAnswer::updateId() const {
38 return 0;
39}
40
42 return rawJson().value("ok").toBool();
43}
44
45}
const QJsonObject & rawJson() const
rawJson Telegram use rest api with json objects. So all received messages will be parsed in to jsobje...
QVariant chatId() const override
from This virtual function should return name of the chat when sent this message to bot.
unsigned long long updateId() const override
updateId This method returns numeric id of the update.
QString errorDescription() const
errorDescription This is text description : what is happend.
int errorCode() const
errorCode This is error code (if exist)
QJsonValue result() const
result This is result filed of thetelegram responce.
bool isValid() const override
isValid return true if the message is valid else false.
QString from() const override
from This virtual function should return name of the user that sent this message to bot.