Update dependencies (#886)
This commit is contained in:
18
vendor/github.com/nlopes/slack/bots.go
generated
vendored
18
vendor/github.com/nlopes/slack/bots.go
generated
vendored
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user