diff options
author | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2019-08-09 02:16:08 +0300 |
---|---|---|
committer | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2019-08-09 02:16:08 +0300 |
commit | 188740f248bf26934aa8db832f5c9c9b9418b2fc (patch) | |
tree | 89f2c9f5ab9ba267862d16b9d0dc048b00f06fea /subscriptions.go | |
parent | 94c96cef29cd83bc60b2eabb8bb89c9fd8c7059b (diff) |
0.1.8 Release -- small fixes
Diffstat (limited to 'subscriptions.go')
-rw-r--r-- | subscriptions.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/subscriptions.go b/subscriptions.go index d32d985..ec2df80 100644 --- a/subscriptions.go +++ b/subscriptions.go @@ -1,5 +1,5 @@ -// Package tamtam implements TamTam Bot API -// Copyright (c) 2019 Alexander Kiryukhin <a.kiryukhin@mail.ru> +//Package tamtam implements TamTam Bot API +//Copyright (c) 2019 Alexander Kiryukhin <a.kiryukhin@mail.ru> package tamtam import ( @@ -16,6 +16,8 @@ type subscriptions struct { func newSubscriptions(client *client) *subscriptions { return &subscriptions{client: client} } + +//GetSubscriptions returns list of all subscriptions func (a *subscriptions) GetSubscriptions() (*GetSubscriptionsResult, error) { result := new(GetSubscriptionsResult) values := url.Values{} @@ -31,6 +33,7 @@ func (a *subscriptions) GetSubscriptions() (*GetSubscriptionsResult, error) { return result, json.NewDecoder(body).Decode(result) } +//Subscribe subscribes bot to receive updates via WebHook func (a *subscriptions) Subscribe(subscribeURL string, updateTypes []string) (*SimpleQueryResult, error) { subscription := &SubscriptionRequestBody{ Url: subscribeURL, @@ -51,6 +54,7 @@ func (a *subscriptions) Subscribe(subscribeURL string, updateTypes []string) (*S return result, json.NewDecoder(body).Decode(result) } +//Unsubscribe unsubscribes bot from receiving updates via WebHook func (a *subscriptions) Unsubscribe(subscriptionURL string) (*SimpleQueryResult, error) { result := new(SimpleQueryResult) values := url.Values{} |