Update nlopes/slack vendor

This commit is contained in:
Wim
2018-08-10 00:38:19 +02:00
parent 51062863a5
commit 68aeb93afa
57 changed files with 2654 additions and 2047 deletions

View File

@@ -19,9 +19,9 @@ type botResponseFull struct {
SlackResponse
}
func botRequest(ctx context.Context, path string, values url.Values, debug bool) (*botResponseFull, error) {
func botRequest(ctx context.Context, client HTTPRequester, path string, values url.Values, debug bool) (*botResponseFull, error) {
response := &botResponseFull{}
err := post(ctx, path, values, response, debug)
err := postSlackMethod(ctx, client, path, values, response, debug)
if err != nil {
return nil, err
}
@@ -39,10 +39,11 @@ func (api *Client) GetBotInfo(bot string) (*Bot, error) {
// 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},
"token": {api.token},
"bot": {bot},
}
response, err := botRequest(ctx, "bots.info", values, api.debug)
response, err := botRequest(ctx, api.httpclient, "bots.info", values, api.debug)
if err != nil {
return nil, err
}