qTbot
0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
Toggle main menu visibility
telegramrestbot.h
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
#ifndef TELEGRAMRESTBOT_H
10
#define TELEGRAMRESTBOT_H
11
12
#include "
itelegrambot.h
"
13
14
class
QTimer;
15
16
namespace
qTbot
{
17
22
class
QTBOT_EXPORT
TelegramRestBot
:
public
ITelegramBot
23
{
24
Q_OBJECT
25
public
:
29
TelegramRestBot
();
30
34
~TelegramRestBot
();
35
36
// IBot interface
43
bool
login
(
const
QByteArray &
token
)
override
;
44
48
void
logout
()
override
;
49
54
int
updateDelay
()
const
;
55
60
void
setUpdateDelay
(
int
newUpdateDelay);
61
67
void
setProcessed
(
const
QSet<unsigned long long> &newProcessed)
override
;
68
private
slots:
69
void
handleReceiveUpdates(
const
QByteArray &replay);
70
void
handleReceiveUpdatesErr(QNetworkReply::NetworkError err);
71
72
private
:
73
void
startUpdates();
74
75
bool
_run =
false
;
76
long
long
_lanstUpdateTime = 0;
77
unsigned
long
long
_lanstUpdateid = 0;
78
79
int
_updateDelay = 1000;
80
81
};
82
}
83
#endif
// TELEGRAMRESTBOT_H
qTbot::IBot::token
const QByteArray & token() const
token This is the token value for authentication on the remote server (bot).
Definition
ibot.cpp:36
qTbot::ITelegramBot::ITelegramBot
ITelegramBot()
ITelegramBot default constructor.
Definition
itelegrambot.cpp:41
qTbot::TelegramRestBot::logout
void logout() override
logout This method stops the long polling of the updates and removes the login token of the bot.
Definition
telegramrestbot.cpp:39
qTbot::TelegramRestBot::setUpdateDelay
void setUpdateDelay(int newUpdateDelay)
setUpdateDelay This method sets a new value for the TelegramRestBot::updateDelay property.
Definition
telegramrestbot.cpp:71
qTbot::TelegramRestBot::setProcessed
void setProcessed(const QSet< unsigned long long > &newProcessed) override
setProcessed This method sets a new list of processed updates. The bot will start to receive the upda...
Definition
telegramrestbot.cpp:75
qTbot::TelegramRestBot::login
bool login(const QByteArray &token) override
login This method gets basic information of the bot from the remote server and starts the long pollin...
Definition
telegramrestbot.cpp:26
qTbot::TelegramRestBot::updateDelay
int updateDelay() const
updateDelay This is the interval "how many msecs the bot will wait to send the next request for updat...
Definition
telegramrestbot.cpp:67
qTbot::TelegramRestBot::TelegramRestBot
TelegramRestBot()
TelegramRestBot default constructor.
Definition
telegramrestbot.cpp:20
itelegrambot.h
qTbot
Definition
telegramdeletemessage.cpp:8
src
qTbot
src
public
qTbot
telegramrestbot.h
Generated by
1.18.0