From a3bee01e0af3394c19360b98fd2db1b647f49299 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 7 Sep 2019 22:46:58 +0200 Subject: Update dependencies (#886) --- vendor/github.com/nlopes/slack/bots.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'vendor/github.com/nlopes/slack/bots.go') diff --git a/vendor/github.com/nlopes/slack/bots.go b/vendor/github.com/nlopes/slack/bots.go index e27e76ab..5d5a2add 100644 --- a/vendor/github.com/nlopes/slack/bots.go +++ b/vendor/github.com/nlopes/slack/bots.go @@ -2,7 +2,6 @@ package slack import ( "context" - "errors" "net/url" ) @@ -19,15 +18,17 @@ type botResponseFull struct { SlackResponse } -func botRequest(ctx context.Context, client httpClient, path string, values url.Values, d debug) (*botResponseFull, error) { +func (api *Client) botRequest(ctx context.Context, path string, values url.Values) (*botResponseFull, error) { response := &botResponseFull{} - err := postSlackMethod(ctx, client, path, values, response, d) + err := api.postMethod(ctx, path, values, response) if err != nil { return nil, err } - if !response.Ok { - return nil, errors.New(response.Error) + + if err := response.Err(); err != nil { + return nil, err } + return response, nil } @@ -40,10 +41,13 @@ func (api *Client) GetBotInfo(bot string) (*Bot, error) { func (api *Client) GetBotInfoContext(ctx context.Context, bot string) (*Bot, error) { values := url.Values{ "token": {api.token}, - "bot": {bot}, } - response, err := botRequest(ctx, api.httpclient, "bots.info", values, api) + if bot != "" { + values.Add("bot", bot) + } + + response, err := api.botRequest(ctx, "bots.info", values) if err != nil { return nil, err } -- cgit v1.2.3