summaryrefslogtreecommitdiff
path: root/include/tgbot/Api.h
diff options
context:
space:
mode:
authorKonstantin Kukin <kukin.konstantin@gmail.com>2016-12-30 11:38:22 +0300
committerKonstantin Kukin <kukin.konstantin@gmail.com>2016-12-30 11:38:36 +0300
commit2d7d1a269383ec1db99b6759f9c58ba08d1d29fe (patch)
tree4b6e1422b0675a344f3c83165b6bd9a61caff99b /include/tgbot/Api.h
parent33e4184338cc7b9ecd8af36ee0ecaff74020356c (diff)
add Webhook functions
Diffstat (limited to 'include/tgbot/Api.h')
-rw-r--r--include/tgbot/Api.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h
index 0a2b7bd..928a017 100644
--- a/include/tgbot/Api.h
+++ b/include/tgbot/Api.h
@@ -37,6 +37,7 @@
#include "tgbot/types/Update.h"
#include "tgbot/types/InlineQueryResult.h"
#include "tgbot/types/Venue.h"
+#include "tgbot/types/WebhookInfo.h"
namespace TgBot {
@@ -48,6 +49,8 @@ class Bot;
*/
class Api {
+typedef std::shared_ptr<std::vector<std::string>> StringArrayPtr;
+
friend class Bot;
public:
@@ -318,7 +321,20 @@ public:
* Ports currently supported for Webhooks: 443, 80, 88, 8443.
* @param url Optional. HTTPS url to send updates to. Use an empty string to remove webhook integration.
*/
- void setWebhook(const std::string& url = "", const InputFile::Ptr& certificate = nullptr) const;
+ void setWebhook(const std::string& url = "", const InputFile::Ptr& certificate = nullptr, int32_t maxConnection = 40, const StringArrayPtr &allowedUpdates = nullptr) const;
+
+ /**
+ * Use this method to remove webhook integration if you decide to switch back to getUpdates.
+ * Returns True on success. Requires no parameters.
+ */
+ bool deleteWebhook() const;
+
+ /**
+ * Use this method to get current webhook status.
+ * Requires no parameters. On success, returns a WebhookInfo object.
+ * If the bot is using getUpdates, will return an object with the url field empty.
+ */
+ WebhookInfo::Ptr getWebhookInfo() const;
/**
* Use this method to send answers to an inline query.