summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/slack-go/slack
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-03-12 19:41:07 +0100
committerGitHub <noreply@github.com>2022-03-12 19:41:07 +0100
commitb3be2e208cb373207d6199cac5a9fc92be073e7a (patch)
tree6de6d444737edee8f0476eea87c233fa980f0002 /vendor/github.com/slack-go/slack
parentc30e90ff3f7e9ff96ac79ed4b7d90d6346216a15 (diff)
downloadmatterbridge-msglm-b3be2e208cb373207d6199cac5a9fc92be073e7a.tar.gz
matterbridge-msglm-b3be2e208cb373207d6199cac5a9fc92be073e7a.tar.bz2
matterbridge-msglm-b3be2e208cb373207d6199cac5a9fc92be073e7a.zip
Update dependencies and vendor (#1761)
Diffstat (limited to 'vendor/github.com/slack-go/slack')
-rw-r--r--vendor/github.com/slack-go/slack/README.md11
-rw-r--r--vendor/github.com/slack-go/slack/block_conv.go3
-rw-r--r--vendor/github.com/slack-go/slack/messages.go1
-rw-r--r--vendor/github.com/slack-go/slack/oauth.go10
-rw-r--r--vendor/github.com/slack-go/slack/webhooks_go112.go10
-rw-r--r--vendor/github.com/slack-go/slack/webhooks_go113.go10
6 files changed, 27 insertions, 18 deletions
diff --git a/vendor/github.com/slack-go/slack/README.md b/vendor/github.com/slack-go/slack/README.md
index dbf73d4e..39b04ce8 100644
--- a/vendor/github.com/slack-go/slack/README.md
+++ b/vendor/github.com/slack-go/slack/README.md
@@ -1,9 +1,9 @@
Slack API in Go [![Go Reference](https://pkg.go.dev/badge/github.com/slack-go/slack.svg)](https://pkg.go.dev/github.com/slack-go/slack)
===============
-This is the original Slack library for Go created by Norberto Lopes, transferred to a Github organization.
+This is the original Slack library for Go created by Norberto Lopes, transferred to a GitHub organization.
-[![Join the chat at https://gitter.im/go-slack/Lobby](https://badges.gitter.im/go-slack/Lobby.svg)](https://gitter.im/go-slack/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+You can also chat with us on the #slack-go, #slack-go-ja Slack channel on the Gophers Slack.
![logo](logo.png "icon")
@@ -70,8 +70,15 @@ func main() {
}
```
+## Minimal Socket Mode usage:
+
+See https://github.com/slack-go/slack/blob/master/examples/socketmode/socketmode.go
+
+
## Minimal RTM usage:
+As mentioned in https://api.slack.com/rtm - for most applications, Socket Mode is a better way to communicate with Slack.
+
See https://github.com/slack-go/slack/blob/master/examples/websocket/websocket.go
diff --git a/vendor/github.com/slack-go/slack/block_conv.go b/vendor/github.com/slack-go/slack/block_conv.go
index c5378b60..1a2c57e9 100644
--- a/vendor/github.com/slack-go/slack/block_conv.go
+++ b/vendor/github.com/slack-go/slack/block_conv.go
@@ -2,9 +2,8 @@ package slack
import (
"encoding/json"
+ "errors"
"fmt"
-
- "github.com/pkg/errors"
)
type sumtype struct {
diff --git a/vendor/github.com/slack-go/slack/messages.go b/vendor/github.com/slack-go/slack/messages.go
index 2f05f6d7..2cc31d5b 100644
--- a/vendor/github.com/slack-go/slack/messages.go
+++ b/vendor/github.com/slack-go/slack/messages.go
@@ -103,6 +103,7 @@ type Msg struct {
ReplyCount int `json:"reply_count,omitempty"`
Replies []Reply `json:"replies,omitempty"`
ParentUserId string `json:"parent_user_id,omitempty"`
+ LatestReply string `json:"latest_reply,omitempty"`
// file_share, file_comment, file_mention
Files []File `json:"files,omitempty"`
diff --git a/vendor/github.com/slack-go/slack/oauth.go b/vendor/github.com/slack-go/slack/oauth.go
index d9aca5f3..94b6546d 100644
--- a/vendor/github.com/slack-go/slack/oauth.go
+++ b/vendor/github.com/slack-go/slack/oauth.go
@@ -61,10 +61,12 @@ type OAuthV2ResponseEnterprise struct {
// OAuthV2ResponseAuthedUser ...
type OAuthV2ResponseAuthedUser struct {
- ID string `json:"id"`
- Scope string `json:"scope"`
- AccessToken string `json:"access_token"`
- TokenType string `json:"token_type"`
+ ID string `json:"id"`
+ Scope string `json:"scope"`
+ AccessToken string `json:"access_token"`
+ ExpiresIn int `json:"expires_in"`
+ RefreshToken string `json:"refresh_token"`
+ TokenType string `json:"token_type"`
}
// GetOAuthToken retrieves an AccessToken
diff --git a/vendor/github.com/slack-go/slack/webhooks_go112.go b/vendor/github.com/slack-go/slack/webhooks_go112.go
index 4e0db0e4..0eb539ac 100644
--- a/vendor/github.com/slack-go/slack/webhooks_go112.go
+++ b/vendor/github.com/slack-go/slack/webhooks_go112.go
@@ -1,3 +1,4 @@
+//go:build !go1.13
// +build !go1.13
package slack
@@ -6,27 +7,26 @@ import (
"bytes"
"context"
"encoding/json"
+ "fmt"
"net/http"
-
- "github.com/pkg/errors"
)
func PostWebhookCustomHTTPContext(ctx context.Context, url string, httpClient *http.Client, msg *WebhookMessage) error {
raw, err := json.Marshal(msg)
if err != nil {
- return errors.Wrap(err, "marshal failed")
+ return fmt.Errorf("marshal failed: %v", err)
}
req, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(raw))
if err != nil {
- return errors.Wrap(err, "failed new request")
+ return fmt.Errorf("failed new request: %v", err)
}
req = req.WithContext(ctx)
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)
if err != nil {
- return errors.Wrap(err, "failed to post webhook")
+ return fmt.Errorf("failed to post webhook: %v", err)
}
defer resp.Body.Close()
diff --git a/vendor/github.com/slack-go/slack/webhooks_go113.go b/vendor/github.com/slack-go/slack/webhooks_go113.go
index 99c243f5..021eac01 100644
--- a/vendor/github.com/slack-go/slack/webhooks_go113.go
+++ b/vendor/github.com/slack-go/slack/webhooks_go113.go
@@ -1,3 +1,4 @@
+//go:build go1.13
// +build go1.13
package slack
@@ -6,26 +7,25 @@ import (
"bytes"
"context"
"encoding/json"
+ "fmt"
"net/http"
-
- "github.com/pkg/errors"
)
func PostWebhookCustomHTTPContext(ctx context.Context, url string, httpClient *http.Client, msg *WebhookMessage) error {
raw, err := json.Marshal(msg)
if err != nil {
- return errors.Wrap(err, "marshal failed")
+ return fmt.Errorf("marshal failed: %w", err)
}
req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(raw))
if err != nil {
- return errors.Wrap(err, "failed new request")
+ return fmt.Errorf("failed new request: %w", err)
}
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)
if err != nil {
- return errors.Wrap(err, "failed to post webhook")
+ return fmt.Errorf("failed to post webhook: %w", err)
}
defer resp.Body.Close()