qTbot 0.87.9547b0c
qTbot is base back end library for your c++ Qt projects.
telegramrestbot.h
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
8
9#ifndef TELEGRAMRESTBOT_H
10#define TELEGRAMRESTBOT_H
11
12#include "itelegrambot.h"
13
14class QTimer;
15
16namespace qTbot {
17
22{
23 Q_OBJECT
24public:
27
28 // IBot interface
29 bool login(const QByteArray &token) override;
30
31 void logout() override;
32
37 int updateDelay() const;
38
43 void setUpdateDelay(int newUpdateDelay);
44
45 void setProcessed(const QSet<unsigned long long> &newProcessed) override;
46private slots:
47 void handleReceiveUpdates(const QWeakPointer<QNetworkReply>& replay);
48 void handleReceiveUpdatesErr(QNetworkReply::NetworkError err);
49
50private:
51 void startUpdates();
52
53 bool _run = false;
54 long long _lanstUpdateTime = 0;
55 unsigned long long _lanstUpdateid = 0;
56
57 int _updateDelay = 1000;
58
59};
60}
61#endif // TELEGRAMRESTBOT_H
The ITelegramBot class This is base implementation of the all telegramm bots.
The TelegramRestBot class Is Rest implementation base on the Update API telegram method.
#define QTBOT_EXPORT
Definition global.h:18