qTbot
0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
Toggle main menu visibility
telegramupdateanswer.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
#include "
telegramupdateanswer.h
"
9
10
namespace
qTbot
{
11
12
TelegramUpdateAnswer::TelegramUpdateAnswer
()
13
{
14
15
}
16
17
QJsonValue
TelegramUpdateAnswer::result
()
const
{
18
return
rawJson
().value(
"result"
);
19
}
20
21
int
TelegramUpdateAnswer::errorCode
()
const
{
22
return
rawJson
().value(
"error_code"
).toInt();
23
}
24
25
QString
TelegramUpdateAnswer::errorDescription
()
const
{
26
return
rawJson
().value(
"description"
).toString();
27
}
28
29
QString
TelegramUpdateAnswer::from
()
const
{
30
return
""
;
31
}
32
33
QVariant
TelegramUpdateAnswer::chatId
()
const
{
34
return
{};
35
}
36
37
unsigned
long
long
TelegramUpdateAnswer::updateId
()
const
{
38
return
0;
39
}
40
41
bool
TelegramUpdateAnswer::isValid
()
const
{
42
return
rawJson
().value(
"ok"
).toBool();
43
}
44
45
}
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::TelegramUpdateAnswer::chatId
QVariant chatId() const override
chatId This virtual function should return the id of the chat that sent this update to the bot.
Definition
telegramupdateanswer.cpp:33
qTbot::TelegramUpdateAnswer::TelegramUpdateAnswer
TelegramUpdateAnswer()
TelegramUpdateAnswer default constructor.
Definition
telegramupdateanswer.cpp:12
qTbot::TelegramUpdateAnswer::updateId
unsigned long long updateId() const override
updateId This method returns the numeric id of the update.
Definition
telegramupdateanswer.cpp:37
qTbot::TelegramUpdateAnswer::errorDescription
QString errorDescription() const
errorDescription This is the text description of what happened.
Definition
telegramupdateanswer.cpp:25
qTbot::TelegramUpdateAnswer::errorCode
int errorCode() const
errorCode This is the error code (if it exists).
Definition
telegramupdateanswer.cpp:21
qTbot::TelegramUpdateAnswer::result
QJsonValue result() const
result This is the result field of the telegram response.
Definition
telegramupdateanswer.cpp:17
qTbot::TelegramUpdateAnswer::isValid
bool isValid() const override
isValid returns true if the update is valid else false.
Definition
telegramupdateanswer.cpp:41
qTbot::TelegramUpdateAnswer::from
QString from() const override
from This virtual function should return the id of the user that sent this update to the bot.
Definition
telegramupdateanswer.cpp:29
qTbot
Definition
telegramdeletemessage.cpp:8
telegramupdateanswer.h
src
qTbot
src
public
qTbot
messages
telegramupdateanswer.cpp
Generated by
1.18.0