summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMio <a771644612@live.com>2018-03-20 15:10:39 +0800
committerMio <a771644612@live.com>2018-03-20 15:10:39 +0800
commit81ab7f5e8929589b352a5f621cfb98fcb2929cec (patch)
tree6333697d3082886ef3c32a121c65d82936a3fd2c /include
parent59b1f98679bd4f9b21cc92a861db6655ec314605 (diff)
Make TgLongPoll constructed with user-specified parameters for getUpdates() instead of hard-code
Diffstat (limited to 'include')
-rw-r--r--include/tgbot/net/TgLongPoll.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/tgbot/net/TgLongPoll.h b/include/tgbot/net/TgLongPoll.h
index 949a2a4..3c0988a 100644
--- a/include/tgbot/net/TgLongPoll.h
+++ b/include/tgbot/net/TgLongPoll.h
@@ -36,8 +36,8 @@ namespace TgBot {
class TgLongPoll {
public:
- TgLongPoll(const Api* api, const EventHandler* eventHandler);
- TgLongPoll(const Bot& bot);
+ TgLongPoll(const Api* api, const EventHandler* eventHandler, int32_t, int32_t, const std::shared_ptr<std::vector<std::string>>&);
+ TgLongPoll(const Bot& bot, int32_t = 100, int32_t = 60, const std::shared_ptr<std::vector<std::string>>& = nullptr);
/**
* Starts long poll. After new update will come, this method will parse it and send to EventHandler which invokes your listeners. Designed to be executed in a loop.
@@ -46,6 +46,9 @@ public:
private:
int32_t _lastUpdateId = 0;
+ int32_t _limit;
+ int32_t _timeout;
+ std::shared_ptr<std::vector<std::string>> _stringarrayptr;
const Api* _api;
const EventHandler* _eventHandler;
};