diff options
author | Oleg Morozenkov <omorozenkov@gmail.com> | 2018-04-01 03:09:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-01 03:09:34 +0300 |
commit | 525861d940f2361531e4cd61b831a94f7d079ea9 (patch) | |
tree | ab18481c4775b76c7e021c5b36d272709cb1776d /include/tgbot/net/TgLongPoll.h | |
parent | 59b1f98679bd4f9b21cc92a861db6655ec314605 (diff) | |
parent | 297e5bc0f8cb6a7fd0f3fbf1a722da7d47d6dea3 (diff) |
Merge pull request #58 from wtdcode/master
remove hard-code parameters in TgLongPoll() for getUpdates()
Diffstat (limited to 'include/tgbot/net/TgLongPoll.h')
-rw-r--r-- | include/tgbot/net/TgLongPoll.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/tgbot/net/TgLongPoll.h b/include/tgbot/net/TgLongPoll.h index 949a2a4..93ace5b 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>> _allowupdates; const Api* _api; const EventHandler* _eventHandler; }; |