diff options
author | Wim <wim@42.be> | 2017-07-16 14:29:46 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-07-16 14:29:46 +0200 |
commit | aec5e3d77b6e480d04dd8773723de62416a94919 (patch) | |
tree | 57ab269e6c46e62e61db04a9ca6fbb55e736519f /vendor/github.com/nlopes/slack/bots.go | |
parent | 335ddf8db543bf64522196e6928c3d10af64694c (diff) | |
download | matterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.tar.gz matterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.tar.bz2 matterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.zip |
Update vendor (nlopes/slack)
Diffstat (limited to 'vendor/github.com/nlopes/slack/bots.go')
-rw-r--r-- | vendor/github.com/nlopes/slack/bots.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vendor/github.com/nlopes/slack/bots.go b/vendor/github.com/nlopes/slack/bots.go index 555915e4..13a78cb1 100644 --- a/vendor/github.com/nlopes/slack/bots.go +++ b/vendor/github.com/nlopes/slack/bots.go @@ -1,6 +1,7 @@ package slack import ( + "context" "errors" "net/url" ) @@ -18,9 +19,9 @@ type botResponseFull struct { SlackResponse } -func botRequest(path string, values url.Values, debug bool) (*botResponseFull, error) { +func botRequest(ctx context.Context, path string, values url.Values, debug bool) (*botResponseFull, error) { response := &botResponseFull{} - err := post(path, values, response, debug) + err := post(ctx, path, values, response, debug) if err != nil { return nil, err } @@ -32,11 +33,16 @@ func botRequest(path string, values url.Values, debug bool) (*botResponseFull, e // GetBotInfo will retrieve the complete bot information func (api *Client) GetBotInfo(bot string) (*Bot, error) { + return api.GetBotInfoContext(context.Background(), bot) +} + +// GetBotInfoContext will retrieve the complete bot information using a custom context +func (api *Client) GetBotInfoContext(ctx context.Context, bot string) (*Bot, error) { values := url.Values{ "token": {api.config.token}, "bot": {bot}, } - response, err := botRequest("bots.info", values, api.debug) + response, err := botRequest(ctx, "bots.info", values, api.debug) if err != nil { return nil, err } |