diff options
author | Wim <wim@42.be> | 2020-12-31 14:48:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-31 14:48:12 +0100 |
commit | 4f20ebead36876a88391bf033d1de3e4cf0228da (patch) | |
tree | 70b6fd79c6a5e00c958c29a7bd3926f074e76ba6 /vendor/github.com/slack-go | |
parent | a9f89dbc645aafc68daa9fc8d589f55104b535c7 (diff) | |
download | matterbridge-msglm-4f20ebead36876a88391bf033d1de3e4cf0228da.tar.gz matterbridge-msglm-4f20ebead36876a88391bf033d1de3e4cf0228da.tar.bz2 matterbridge-msglm-4f20ebead36876a88391bf033d1de3e4cf0228da.zip |
Update vendor for next release (#1343)
Diffstat (limited to 'vendor/github.com/slack-go')
-rw-r--r-- | vendor/github.com/slack-go/slack/.golangci.yml | 14 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/.travis.yml | 41 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/attachments.go | 2 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/block_action.go | 4 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/channels.go | 233 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/conversation.go | 22 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/files.go | 20 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/groups.go | 198 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/im.go | 66 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/internal/errorsx/errorsx.go | 9 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/logger.go | 2 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/misc.go | 22 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/reminders.go | 15 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/security.go | 12 | ||||
-rw-r--r-- | vendor/github.com/slack-go/slack/users.go | 16 |
15 files changed, 599 insertions, 77 deletions
diff --git a/vendor/github.com/slack-go/slack/.golangci.yml b/vendor/github.com/slack-go/slack/.golangci.yml new file mode 100644 index 00000000..c16f5389 --- /dev/null +++ b/vendor/github.com/slack-go/slack/.golangci.yml @@ -0,0 +1,14 @@ +run: + timeout: 6m + issues-exit-code: 1 +linters: + disable-all: true + enable: + - goimports + - govet + - interfacer + - misspell + - structcheck + - unconvert +issues: + new: true diff --git a/vendor/github.com/slack-go/slack/.travis.yml b/vendor/github.com/slack-go/slack/.travis.yml deleted file mode 100644 index f2019d72..00000000 --- a/vendor/github.com/slack-go/slack/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: go - -env: - - GO111MODULE=on - -install: true - -before_install: - - export PATH=$HOME/gopath/bin:$PATH - # install gometalinter - - curl -L https://git.io/vp6lP | sh - -script: - - PATH=$PWD/bin:$PATH gometalinter ./... - - go test -race -cover ./... - -matrix: - allow_failures: - - go: tip - include: - - go: "1.7.x" - script: go test -v ./... - - go: "1.8.x" - script: go test -v ./... - - go: "1.9.x" - script: go test -v ./... - - go: "1.10.x" - script: go test -v ./... - - go: "1.11.x" - script: go test -v -mod=vendor ./... - - go: "1.12.x" - script: go test -v -mod=vendor ./... - - go: "1.13.x" - script: go test -v -mod=vendor ./... - - go: "1.14.x" - script: go test -v -mod=vendor ./... - - go: "tip" - script: go test -v -mod=vendor ./... - -git: - depth: 10 diff --git a/vendor/github.com/slack-go/slack/attachments.go b/vendor/github.com/slack-go/slack/attachments.go index 5f388e9f..b5b79f9f 100644 --- a/vendor/github.com/slack-go/slack/attachments.go +++ b/vendor/github.com/slack-go/slack/attachments.go @@ -75,7 +75,7 @@ type Attachment struct { Title string `json:"title,omitempty"` TitleLink string `json:"title_link,omitempty"` Pretext string `json:"pretext,omitempty"` - Text string `json:"text"` // Required + Text string `json:"text,omitempty"` ImageURL string `json:"image_url,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` diff --git a/vendor/github.com/slack-go/slack/block_action.go b/vendor/github.com/slack-go/slack/block_action.go index fe46a95c..c15e4a3f 100644 --- a/vendor/github.com/slack-go/slack/block_action.go +++ b/vendor/github.com/slack-go/slack/block_action.go @@ -6,7 +6,7 @@ package slack type ActionBlock struct { Type MessageBlockType `json:"type"` BlockID string `json:"block_id,omitempty"` - Elements BlockElements `json:"elements"` + Elements *BlockElements `json:"elements"` } // BlockType returns the type of the block @@ -19,7 +19,7 @@ func NewActionBlock(blockID string, elements ...BlockElement) *ActionBlock { return &ActionBlock{ Type: MBTAction, BlockID: blockID, - Elements: BlockElements{ + Elements: &BlockElements{ ElementSet: elements, }, } diff --git a/vendor/github.com/slack-go/slack/channels.go b/vendor/github.com/slack-go/slack/channels.go index a90d2384..c05521d0 100644 --- a/vendor/github.com/slack-go/slack/channels.go +++ b/vendor/github.com/slack-go/slack/channels.go @@ -19,6 +19,12 @@ type channelResponseFull struct { } // Channel contains information about the channel +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api type Channel struct { GroupConversation IsChannel bool `json:"is_channel"` @@ -38,9 +44,21 @@ func (api *Client) channelRequest(ctx context.Context, path string, values url.V } // GetChannelsOption option provided when getting channels. +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api type GetChannelsOption func(*ChannelPagination) error // GetChannelsOptionExcludeMembers excludes the members collection from each channel. +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func GetChannelsOptionExcludeMembers() GetChannelsOption { return func(p *ChannelPagination) error { p.excludeMembers = true @@ -49,6 +67,12 @@ func GetChannelsOptionExcludeMembers() GetChannelsOption { } // GetChannelsOptionExcludeArchived excludes archived channels from results. +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func GetChannelsOptionExcludeArchived() GetChannelsOption { return func(p *ChannelPagination) error { p.excludeArchived = true @@ -58,12 +82,24 @@ func GetChannelsOptionExcludeArchived() GetChannelsOption { // ArchiveChannel archives the given channel // see https://api.slack.com/methods/channels.archive +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) ArchiveChannel(channelID string) error { return api.ArchiveChannelContext(context.Background(), channelID) } // ArchiveChannelContext archives the given channel with a custom context // see https://api.slack.com/methods/channels.archive +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) ArchiveChannelContext(ctx context.Context, channelID string) (err error) { values := url.Values{ "token": {api.token}, @@ -76,12 +112,24 @@ func (api *Client) ArchiveChannelContext(ctx context.Context, channelID string) // UnarchiveChannel unarchives the given channel // see https://api.slack.com/methods/channels.unarchive +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) UnarchiveChannel(channelID string) error { return api.UnarchiveChannelContext(context.Background(), channelID) } // UnarchiveChannelContext unarchives the given channel with a custom context // see https://api.slack.com/methods/channels.unarchive +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) UnarchiveChannelContext(ctx context.Context, channelID string) (err error) { values := url.Values{ "token": {api.token}, @@ -94,12 +142,24 @@ func (api *Client) UnarchiveChannelContext(ctx context.Context, channelID string // CreateChannel creates a channel with the given name and returns a *Channel // see https://api.slack.com/methods/channels.create +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) CreateChannel(channelName string) (*Channel, error) { return api.CreateChannelContext(context.Background(), channelName) } // CreateChannelContext creates a channel with the given name and returns a *Channel with a custom context // see https://api.slack.com/methods/channels.create +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) CreateChannelContext(ctx context.Context, channelName string) (*Channel, error) { values := url.Values{ "token": {api.token}, @@ -115,12 +175,24 @@ func (api *Client) CreateChannelContext(ctx context.Context, channelName string) // GetChannelHistory retrieves the channel history // see https://api.slack.com/methods/channels.history +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetChannelHistory(channelID string, params HistoryParameters) (*History, error) { return api.GetChannelHistoryContext(context.Background(), channelID, params) } // GetChannelHistoryContext retrieves the channel history with a custom context // see https://api.slack.com/methods/channels.history +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetChannelHistoryContext(ctx context.Context, channelID string, params HistoryParameters) (*History, error) { values := url.Values{ "token": {api.token}, @@ -160,12 +232,24 @@ func (api *Client) GetChannelHistoryContext(ctx context.Context, channelID strin // GetChannelInfo retrieves the given channel // see https://api.slack.com/methods/channels.info +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetChannelInfo(channelID string) (*Channel, error) { return api.GetChannelInfoContext(context.Background(), channelID) } // GetChannelInfoContext retrieves the given channel with a custom context // see https://api.slack.com/methods/channels.info +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetChannelInfoContext(ctx context.Context, channelID string) (*Channel, error) { values := url.Values{ "token": {api.token}, @@ -182,12 +266,24 @@ func (api *Client) GetChannelInfoContext(ctx context.Context, channelID string) // InviteUserToChannel invites a user to a given channel and returns a *Channel // see https://api.slack.com/methods/channels.invite +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) InviteUserToChannel(channelID, user string) (*Channel, error) { return api.InviteUserToChannelContext(context.Background(), channelID, user) } // InviteUserToChannelContext invites a user to a given channel and returns a *Channel with a custom context // see https://api.slack.com/methods/channels.invite +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) InviteUserToChannelContext(ctx context.Context, channelID, user string) (*Channel, error) { values := url.Values{ "token": {api.token}, @@ -204,12 +300,24 @@ func (api *Client) InviteUserToChannelContext(ctx context.Context, channelID, us // JoinChannel joins the currently authenticated user to a channel // see https://api.slack.com/methods/channels.join +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) JoinChannel(channelName string) (*Channel, error) { return api.JoinChannelContext(context.Background(), channelName) } // JoinChannelContext joins the currently authenticated user to a channel with a custom context // see https://api.slack.com/methods/channels.join +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) JoinChannelContext(ctx context.Context, channelName string) (*Channel, error) { values := url.Values{ "token": {api.token}, @@ -225,12 +333,24 @@ func (api *Client) JoinChannelContext(ctx context.Context, channelName string) ( // LeaveChannel makes the authenticated user leave the given channel // see https://api.slack.com/methods/channels.leave +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) LeaveChannel(channelID string) (bool, error) { return api.LeaveChannelContext(context.Background(), channelID) } // LeaveChannelContext makes the authenticated user leave the given channel with a custom context // see https://api.slack.com/methods/channels.leave +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) LeaveChannelContext(ctx context.Context, channelID string) (bool, error) { values := url.Values{ "token": {api.token}, @@ -247,12 +367,24 @@ func (api *Client) LeaveChannelContext(ctx context.Context, channelID string) (b // KickUserFromChannel kicks a user from a given channel // see https://api.slack.com/methods/channels.kick +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) KickUserFromChannel(channelID, user string) error { return api.KickUserFromChannelContext(context.Background(), channelID, user) } // KickUserFromChannelContext kicks a user from a given channel with a custom context // see https://api.slack.com/methods/channels.kick +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) KickUserFromChannelContext(ctx context.Context, channelID, user string) (err error) { values := url.Values{ "token": {api.token}, @@ -278,6 +410,12 @@ func newChannelPagination(c *Client, options ...GetChannelsOption) (cp ChannelPa } // ChannelPagination allows for paginating over the channels +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api type ChannelPagination struct { Channels []Channel limit int @@ -288,11 +426,23 @@ type ChannelPagination struct { } // Done checks if the pagination has completed +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (ChannelPagination) Done(err error) bool { return err == errPaginationComplete } // Failure checks if pagination failed. +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (t ChannelPagination) Failure(err error) error { if t.Done(err) { return nil @@ -301,6 +451,11 @@ func (t ChannelPagination) Failure(err error) error { return err } +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (t ChannelPagination) Next(ctx context.Context) (_ ChannelPagination, err error) { var ( resp *channelResponseFull @@ -332,18 +487,36 @@ func (t ChannelPagination) Next(ctx context.Context) (_ ChannelPagination, err e } // GetChannelsPaginated fetches channels in a paginated fashion, see GetChannelsContext for usage. +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetChannelsPaginated(options ...GetChannelsOption) ChannelPagination { return newChannelPagination(api, options...) } // GetChannels retrieves all the channels // see https://api.slack.com/methods/channels.list +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetChannels(excludeArchived bool, options ...GetChannelsOption) ([]Channel, error) { return api.GetChannelsContext(context.Background(), excludeArchived, options...) } // GetChannelsContext retrieves all the channels with a custom context // see https://api.slack.com/methods/channels.list +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetChannelsContext(ctx context.Context, excludeArchived bool, options ...GetChannelsOption) (results []Channel, err error) { if excludeArchived { options = append(options, GetChannelsOptionExcludeArchived()) @@ -373,6 +546,12 @@ func (api *Client) GetChannelsContext(ctx context.Context, excludeArchived bool, // (just one per channel). This is useful for when reading scroll-back history, or following a busy live channel. A // timeout of 5 seconds is a good starting point. Be sure to flush these calls on shutdown/logout. // see https://api.slack.com/methods/channels.mark +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetChannelReadMark(channelID, ts string) error { return api.SetChannelReadMarkContext(context.Background(), channelID, ts) } @@ -380,6 +559,12 @@ func (api *Client) SetChannelReadMark(channelID, ts string) error { // SetChannelReadMarkContext sets the read mark of a given channel to a specific point with a custom context // For more details see SetChannelReadMark documentation // see https://api.slack.com/methods/channels.mark +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetChannelReadMarkContext(ctx context.Context, channelID, ts string) (err error) { values := url.Values{ "token": {api.token}, @@ -393,12 +578,24 @@ func (api *Client) SetChannelReadMarkContext(ctx context.Context, channelID, ts // RenameChannel renames a given channel // see https://api.slack.com/methods/channels.rename +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) RenameChannel(channelID, name string) (*Channel, error) { return api.RenameChannelContext(context.Background(), channelID, name) } // RenameChannelContext renames a given channel with a custom context // see https://api.slack.com/methods/channels.rename +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) RenameChannelContext(ctx context.Context, channelID, name string) (*Channel, error) { values := url.Values{ "token": {api.token}, @@ -417,12 +614,24 @@ func (api *Client) RenameChannelContext(ctx context.Context, channelID, name str // SetChannelPurpose sets the channel purpose and returns the purpose that was successfully set // see https://api.slack.com/methods/channels.setPurpose +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetChannelPurpose(channelID, purpose string) (string, error) { return api.SetChannelPurposeContext(context.Background(), channelID, purpose) } // SetChannelPurposeContext sets the channel purpose and returns the purpose that was successfully set with a custom context // see https://api.slack.com/methods/channels.setPurpose +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetChannelPurposeContext(ctx context.Context, channelID, purpose string) (string, error) { values := url.Values{ "token": {api.token}, @@ -439,12 +648,24 @@ func (api *Client) SetChannelPurposeContext(ctx context.Context, channelID, purp // SetChannelTopic sets the channel topic and returns the topic that was successfully set // see https://api.slack.com/methods/channels.setTopic +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetChannelTopic(channelID, topic string) (string, error) { return api.SetChannelTopicContext(context.Background(), channelID, topic) } // SetChannelTopicContext sets the channel topic and returns the topic that was successfully set with a custom context // see https://api.slack.com/methods/channels.setTopic +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetChannelTopicContext(ctx context.Context, channelID, topic string) (string, error) { values := url.Values{ "token": {api.token}, @@ -461,12 +682,24 @@ func (api *Client) SetChannelTopicContext(ctx context.Context, channelID, topic // GetChannelReplies gets an entire thread (a message plus all the messages in reply to it). // see https://api.slack.com/methods/channels.replies +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetChannelReplies(channelID, thread_ts string) ([]Message, error) { return api.GetChannelRepliesContext(context.Background(), channelID, thread_ts) } // GetChannelRepliesContext gets an entire thread (a message plus all the messages in reply to it) with a custom context // see https://api.slack.com/methods/channels.replies +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetChannelRepliesContext(ctx context.Context, channelID, thread_ts string) ([]Message, error) { values := url.Values{ "token": {api.token}, diff --git a/vendor/github.com/slack-go/slack/conversation.go b/vendor/github.com/slack-go/slack/conversation.go index 60c50fc7..6fc4a083 100644 --- a/vendor/github.com/slack-go/slack/conversation.go +++ b/vendor/github.com/slack-go/slack/conversation.go @@ -621,3 +621,25 @@ func (api *Client) GetConversationHistoryContext(ctx context.Context, params *Ge return &response, response.Err() } + +// MarkConversation sets the read mark of a conversation to a specific point +func (api *Client) MarkConversation(channel, ts string) (err error) { + return api.MarkConversationContext(context.Background(), channel, ts) +} + +// MarkConversationContext sets the read mark of a conversation to a specific point with a custom context +func (api *Client) MarkConversationContext(ctx context.Context, channel, ts string) error { + values := url.Values{ + "token": {api.token}, + "channel": {channel}, + "ts": {ts}, + } + + response := &SlackResponse{} + + err := api.postMethod(ctx, "conversations.mark", values, response) + if err != nil { + return err + } + return response.Err() +} diff --git a/vendor/github.com/slack-go/slack/files.go b/vendor/github.com/slack-go/slack/files.go index 3a7363de..713038f0 100644 --- a/vendor/github.com/slack-go/slack/files.go +++ b/vendor/github.com/slack-go/slack/files.go @@ -11,13 +11,14 @@ import ( const ( // Add here the defaults in the siten - DEFAULT_FILES_USER = "" - DEFAULT_FILES_CHANNEL = "" - DEFAULT_FILES_TS_FROM = 0 - DEFAULT_FILES_TS_TO = -1 - DEFAULT_FILES_TYPES = "all" - DEFAULT_FILES_COUNT = 100 - DEFAULT_FILES_PAGE = 1 + DEFAULT_FILES_USER = "" + DEFAULT_FILES_CHANNEL = "" + DEFAULT_FILES_TS_FROM = 0 + DEFAULT_FILES_TS_TO = -1 + DEFAULT_FILES_TYPES = "all" + DEFAULT_FILES_COUNT = 100 + DEFAULT_FILES_PAGE = 1 + DEFAULT_FILES_SHOW_HIDDEN = false ) // File contains all the information for a file @@ -132,6 +133,7 @@ type GetFilesParameters struct { Types string Count int Page int + ShowHidden bool } // ListFilesParameters contains all the parameters necessary (including the optional ones) for a ListFiles() request @@ -163,6 +165,7 @@ func NewGetFilesParameters() GetFilesParameters { Types: DEFAULT_FILES_TYPES, Count: DEFAULT_FILES_COUNT, Page: DEFAULT_FILES_PAGE, + ShowHidden: DEFAULT_FILES_SHOW_HIDDEN, } } @@ -267,6 +270,9 @@ func (api *Client) GetFilesContext(ctx context.Context, params GetFilesParameter if params.Page != DEFAULT_FILES_PAGE { values.Add("page", strconv.Itoa(params.Page)) } + if params.ShowHidden != DEFAULT_FILES_SHOW_HIDDEN { + values.Add("show_files_hidden_by_limit", strconv.FormatBool(params.ShowHidden)) + } response, err := api.fileRequest(ctx, "files.list", values) if err != nil { diff --git a/vendor/github.com/slack-go/slack/groups.go b/vendor/github.com/slack-go/slack/groups.go index 6ea1b134..4c5793dc 100644 --- a/vendor/github.com/slack-go/slack/groups.go +++ b/vendor/github.com/slack-go/slack/groups.go @@ -7,6 +7,12 @@ import ( ) // Group contains all the information for a group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api type Group struct { GroupConversation IsGroup bool `json:"is_group"` @@ -38,11 +44,23 @@ func (api *Client) groupRequest(ctx context.Context, path string, values url.Val } // ArchiveGroup archives a private group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) ArchiveGroup(group string) error { return api.ArchiveGroupContext(context.Background(), group) } // ArchiveGroupContext archives a private group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) ArchiveGroupContext(ctx context.Context, group string) error { values := url.Values{ "token": {api.token}, @@ -54,11 +72,23 @@ func (api *Client) ArchiveGroupContext(ctx context.Context, group string) error } // UnarchiveGroup unarchives a private group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) UnarchiveGroup(group string) error { return api.UnarchiveGroupContext(context.Background(), group) } // UnarchiveGroupContext unarchives a private group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) UnarchiveGroupContext(ctx context.Context, group string) error { values := url.Values{ "token": {api.token}, @@ -70,11 +100,23 @@ func (api *Client) UnarchiveGroupContext(ctx context.Context, group string) erro } // CreateGroup creates a private group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) CreateGroup(group string) (*Group, error) { return api.CreateGroupContext(context.Background(), group) } // CreateGroupContext creates a private group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) CreateGroupContext(ctx context.Context, group string) (*Group, error) { values := url.Values{ "token": {api.token}, @@ -94,12 +136,24 @@ func (api *Client) CreateGroupContext(ctx context.Context, group string) (*Group // 2. Archives the existing group. // 3. Creates a new group with the name of the existing group. // 4. Adds all members of the existing group to the new group. +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) CreateChildGroup(group string) (*Group, error) { return api.CreateChildGroupContext(context.Background(), group) } // CreateChildGroupContext creates a new private group archiving the old one with a custom context // For more information see CreateChildGroup +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) CreateChildGroupContext(ctx context.Context, group string) (*Group, error) { values := url.Values{ "token": {api.token}, @@ -114,11 +168,23 @@ func (api *Client) CreateChildGroupContext(ctx context.Context, group string) (* } // GetGroupHistory fetches all the history for a private group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetGroupHistory(group string, params HistoryParameters) (*History, error) { return api.GetGroupHistoryContext(context.Background(), group, params) } // GetGroupHistoryContext fetches all the history for a private group with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetGroupHistoryContext(ctx context.Context, group string, params HistoryParameters) (*History, error) { values := url.Values{ "token": {api.token}, @@ -156,11 +222,23 @@ func (api *Client) GetGroupHistoryContext(ctx context.Context, group string, par } // InviteUserToGroup invites a specific user to a private group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) InviteUserToGroup(group, user string) (*Group, bool, error) { return api.InviteUserToGroupContext(context.Background(), group, user) } // InviteUserToGroupContext invites a specific user to a private group with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) InviteUserToGroupContext(ctx context.Context, group, user string) (*Group, bool, error) { values := url.Values{ "token": {api.token}, @@ -176,11 +254,23 @@ func (api *Client) InviteUserToGroupContext(ctx context.Context, group, user str } // LeaveGroup makes authenticated user leave the group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) LeaveGroup(group string) error { return api.LeaveGroupContext(context.Background(), group) } // LeaveGroupContext makes authenticated user leave the group with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) LeaveGroupContext(ctx context.Context, group string) (err error) { values := url.Values{ "token": {api.token}, @@ -192,11 +282,23 @@ func (api *Client) LeaveGroupContext(ctx context.Context, group string) (err err } // KickUserFromGroup kicks a user from a group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) KickUserFromGroup(group, user string) error { return api.KickUserFromGroupContext(context.Background(), group, user) } // KickUserFromGroupContext kicks a user from a group with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) KickUserFromGroupContext(ctx context.Context, group, user string) (err error) { values := url.Values{ "token": {api.token}, @@ -209,11 +311,23 @@ func (api *Client) KickUserFromGroupContext(ctx context.Context, group, user str } // GetGroups retrieves all groups +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetGroups(excludeArchived bool) ([]Group, error) { return api.GetGroupsContext(context.Background(), excludeArchived) } // GetGroupsContext retrieves all groups with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetGroupsContext(ctx context.Context, excludeArchived bool) ([]Group, error) { values := url.Values{ "token": {api.token}, @@ -230,11 +344,23 @@ func (api *Client) GetGroupsContext(ctx context.Context, excludeArchived bool) ( } // GetGroupInfo retrieves the given group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetGroupInfo(group string) (*Group, error) { return api.GetGroupInfoContext(context.Background(), group) } // GetGroupInfoContext retrieves the given group with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetGroupInfoContext(ctx context.Context, group string) (*Group, error) { values := url.Values{ "token": {api.token}, @@ -254,12 +380,24 @@ func (api *Client) GetGroupInfoContext(ctx context.Context, group string) (*Grou // timer before making the call. In this way, any further updates needed during the timeout will not generate extra // calls (just one per channel). This is useful for when reading scroll-back history, or following a busy live // channel. A timeout of 5 seconds is a good starting point. Be sure to flush these calls on shutdown/logout. +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetGroupReadMark(group, ts string) error { return api.SetGroupReadMarkContext(context.Background(), group, ts) } // SetGroupReadMarkContext sets the read mark on a private group with a custom context // For more details see SetGroupReadMark +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetGroupReadMarkContext(ctx context.Context, group, ts string) (err error) { values := url.Values{ "token": {api.token}, @@ -272,11 +410,23 @@ func (api *Client) SetGroupReadMarkContext(ctx context.Context, group, ts string } // OpenGroup opens a private group +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) OpenGroup(group string) (bool, bool, error) { return api.OpenGroupContext(context.Background(), group) } // OpenGroupContext opens a private group with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) OpenGroupContext(ctx context.Context, group string) (bool, bool, error) { values := url.Values{ "token": {api.token}, @@ -293,11 +443,23 @@ func (api *Client) OpenGroupContext(ctx context.Context, group string) (bool, bo // RenameGroup renames a group // XXX: They return a channel, not a group. What is this crap? :( // Inconsistent api it seems. +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) RenameGroup(group, name string) (*Channel, error) { return api.RenameGroupContext(context.Background(), group, name) } // RenameGroupContext renames a group with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) RenameGroupContext(ctx context.Context, group, name string) (*Channel, error) { values := url.Values{ "token": {api.token}, @@ -315,11 +477,23 @@ func (api *Client) RenameGroupContext(ctx context.Context, group, name string) ( } // SetGroupPurpose sets the group purpose +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetGroupPurpose(group, purpose string) (string, error) { return api.SetGroupPurposeContext(context.Background(), group, purpose) } // SetGroupPurposeContext sets the group purpose with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetGroupPurposeContext(ctx context.Context, group, purpose string) (string, error) { values := url.Values{ "token": {api.token}, @@ -335,11 +509,23 @@ func (api *Client) SetGroupPurposeContext(ctx context.Context, group, purpose st } // SetGroupTopic sets the group topic +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetGroupTopic(group, topic string) (string, error) { return api.SetGroupTopicContext(context.Background(), group, topic) } // SetGroupTopicContext sets the group topic with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) SetGroupTopicContext(ctx context.Context, group, topic string) (string, error) { values := url.Values{ "token": {api.token}, @@ -356,12 +542,24 @@ func (api *Client) SetGroupTopicContext(ctx context.Context, group, topic string // GetGroupReplies gets an entire thread (a message plus all the messages in reply to it). // see https://api.slack.com/methods/groups.replies +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetGroupReplies(channelID, thread_ts string) ([]Message, error) { return api.GetGroupRepliesContext(context.Background(), channelID, thread_ts) } // GetGroupRepliesContext gets an entire thread (a message plus all the messages in reply to it) with a custom context // see https://api.slack.com/methods/groups.replies +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetGroupRepliesContext(ctx context.Context, channelID, thread_ts string) ([]Message, error) { values := url.Values{ "token": {api.token}, diff --git a/vendor/github.com/slack-go/slack/im.go b/vendor/github.com/slack-go/slack/im.go index ee784fef..a884b295 100644 --- a/vendor/github.com/slack-go/slack/im.go +++ b/vendor/github.com/slack-go/slack/im.go @@ -21,6 +21,12 @@ type imResponseFull struct { } // IM contains information related to the Direct Message channel +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api type IM struct { Conversation IsUserDeleted bool `json:"is_user_deleted"` @@ -37,11 +43,23 @@ func (api *Client) imRequest(ctx context.Context, path string, values url.Values } // CloseIMChannel closes the direct message channel +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) CloseIMChannel(channel string) (bool, bool, error) { return api.CloseIMChannelContext(context.Background(), channel) } // CloseIMChannelContext closes the direct message channel with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) CloseIMChannelContext(ctx context.Context, channel string) (bool, bool, error) { values := url.Values{ "token": {api.token}, @@ -57,12 +75,24 @@ func (api *Client) CloseIMChannelContext(ctx context.Context, channel string) (b // OpenIMChannel opens a direct message channel to the user provided as argument // Returns some status and the channel ID +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) OpenIMChannel(user string) (bool, bool, string, error) { return api.OpenIMChannelContext(context.Background(), user) } // OpenIMChannelContext opens a direct message channel to the user provided as argument with a custom context // Returns some status and the channel ID +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) OpenIMChannelContext(ctx context.Context, user string) (bool, bool, string, error) { values := url.Values{ "token": {api.token}, @@ -77,11 +107,23 @@ func (api *Client) OpenIMChannelContext(ctx context.Context, user string) (bool, } // MarkIMChannel sets the read mark of a direct message channel to a specific point +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) MarkIMChannel(channel, ts string) (err error) { return api.MarkIMChannelContext(context.Background(), channel, ts) } // MarkIMChannelContext sets the read mark of a direct message channel to a specific point with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) MarkIMChannelContext(ctx context.Context, channel, ts string) error { values := url.Values{ "token": {api.token}, @@ -94,11 +136,23 @@ func (api *Client) MarkIMChannelContext(ctx context.Context, channel, ts string) } // GetIMHistory retrieves the direct message channel history +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetIMHistory(channel string, params HistoryParameters) (*History, error) { return api.GetIMHistoryContext(context.Background(), channel, params) } // GetIMHistoryContext retrieves the direct message channel history with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetIMHistoryContext(ctx context.Context, channel string, params HistoryParameters) (*History, error) { values := url.Values{ "token": {api.token}, @@ -136,11 +190,23 @@ func (api *Client) GetIMHistoryContext(ctx context.Context, channel string, para } // GetIMChannels returns the list of direct message channels +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetIMChannels() ([]IM, error) { return api.GetIMChannelsContext(context.Background()) } // GetIMChannelsContext returns the list of direct message channels with a custom context +// +// Deprecated: channels.*, groups.* im.* and mpim.* methods will be deprecated in the next version. +// In Slack, these API are no longer available for newly Apps created after June 10th, 2020. +// Also, existing applications will not be able to use these APIs after February 24th, 2021. +// +// See also: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api func (api *Client) GetIMChannelsContext(ctx context.Context) ([]IM, error) { values := url.Values{ "token": {api.token}, diff --git a/vendor/github.com/slack-go/slack/internal/errorsx/errorsx.go b/vendor/github.com/slack-go/slack/internal/errorsx/errorsx.go index cb850577..0182ec68 100644 --- a/vendor/github.com/slack-go/slack/internal/errorsx/errorsx.go +++ b/vendor/github.com/slack-go/slack/internal/errorsx/errorsx.go @@ -6,3 +6,12 @@ type String string func (t String) Error() string { return string(t) } + +// Is reports whether String matches with the target error +func (t String) Is(target error) bool { + if target == nil { + return false + } + + return t.Error() == target.Error() +} diff --git a/vendor/github.com/slack-go/slack/logger.go b/vendor/github.com/slack-go/slack/logger.go index 6a3533a9..90cb3caa 100644 --- a/vendor/github.com/slack-go/slack/logger.go +++ b/vendor/github.com/slack-go/slack/logger.go @@ -18,7 +18,7 @@ type ilogger interface { Println(...interface{}) } -type debug interface { +type Debug interface { Debug() bool // Debugf print a formatted debug line. diff --git a/vendor/github.com/slack-go/slack/misc.go b/vendor/github.com/slack-go/slack/misc.go index a5ca51bc..336f0afb 100644 --- a/vendor/github.com/slack-go/slack/misc.go +++ b/vendor/github.com/slack-go/slack/misc.go @@ -88,7 +88,7 @@ func fileUploadReq(ctx context.Context, path string, values url.Values, r io.Rea return req, nil } -func downloadFile(client httpClient, token string, downloadURL string, writer io.Writer, d debug) error { +func downloadFile(client httpClient, token string, downloadURL string, writer io.Writer, d Debug) error { if downloadURL == "" { return fmt.Errorf("received empty download URL") } @@ -142,7 +142,7 @@ func jsonReq(endpoint string, body interface{}) (req *http.Request, err error) { return req, nil } -func parseResponseBody(body io.ReadCloser, intf interface{}, d debug) error { +func parseResponseBody(body io.ReadCloser, intf interface{}, d Debug) error { response, err := ioutil.ReadAll(body) if err != nil { return err @@ -155,7 +155,7 @@ func parseResponseBody(body io.ReadCloser, intf interface{}, d debug) error { return json.Unmarshal(response, intf) } -func postLocalWithMultipartResponse(ctx context.Context, client httpClient, method, fpath, fieldname string, values url.Values, intf interface{}, d debug) error { +func postLocalWithMultipartResponse(ctx context.Context, client httpClient, method, fpath, fieldname string, values url.Values, intf interface{}, d Debug) error { fullpath, err := filepath.Abs(fpath) if err != nil { return err @@ -169,7 +169,7 @@ func postLocalWithMultipartResponse(ctx context.Context, client httpClient, meth return postWithMultipartResponse(ctx, client, method, filepath.Base(fpath), fieldname, values, file, intf, d) } -func postWithMultipartResponse(ctx context.Context, client httpClient, path, name, fieldname string, values url.Values, r io.Reader, intf interface{}, d debug) error { +func postWithMultipartResponse(ctx context.Context, client httpClient, path, name, fieldname string, values url.Values, r io.Reader, intf interface{}, d Debug) error { pipeReader, pipeWriter := io.Pipe() wr := multipart.NewWriter(pipeWriter) errc := make(chan error) @@ -216,7 +216,7 @@ func postWithMultipartResponse(ctx context.Context, client httpClient, path, nam } } -func doPost(ctx context.Context, client httpClient, req *http.Request, parser responseParser, d debug) error { +func doPost(ctx context.Context, client httpClient, req *http.Request, parser responseParser, d Debug) error { req = req.WithContext(ctx) resp, err := client.Do(req) if err != nil { @@ -233,7 +233,7 @@ func doPost(ctx context.Context, client httpClient, req *http.Request, parser re } // post JSON. -func postJSON(ctx context.Context, client httpClient, endpoint, token string, json []byte, intf interface{}, d debug) error { +func postJSON(ctx context.Context, client httpClient, endpoint, token string, json []byte, intf interface{}, d Debug) error { reqBody := bytes.NewBuffer(json) req, err := http.NewRequest("POST", endpoint, reqBody) if err != nil { @@ -246,7 +246,7 @@ func postJSON(ctx context.Context, client httpClient, endpoint, token string, js } // post a url encoded form. -func postForm(ctx context.Context, client httpClient, endpoint string, values url.Values, intf interface{}, d debug) error { +func postForm(ctx context.Context, client httpClient, endpoint string, values url.Values, intf interface{}, d Debug) error { reqBody := strings.NewReader(values.Encode()) req, err := http.NewRequest("POST", endpoint, reqBody) if err != nil { @@ -256,7 +256,7 @@ func postForm(ctx context.Context, client httpClient, endpoint string, values ur return doPost(ctx, client, req, newJSONParser(intf), d) } -func getResource(ctx context.Context, client httpClient, endpoint string, values url.Values, intf interface{}, d debug) error { +func getResource(ctx context.Context, client httpClient, endpoint string, values url.Values, intf interface{}, d Debug) error { req, err := http.NewRequest("GET", endpoint, nil) if err != nil { return err @@ -267,12 +267,12 @@ func getResource(ctx context.Context, client httpClient, endpoint string, values return doPost(ctx, client, req, newJSONParser(intf), d) } -func parseAdminResponse(ctx context.Context, client httpClient, method string, teamName string, values url.Values, intf interface{}, d debug) error { +func parseAdminResponse(ctx context.Context, client httpClient, method string, teamName string, values url.Values, intf interface{}, d Debug) error { endpoint := fmt.Sprintf(WEBAPIURLFormat, teamName, method, time.Now().Unix()) return postForm(ctx, client, endpoint, values, intf, d) } -func logResponse(resp *http.Response, d debug) error { +func logResponse(resp *http.Response, d Debug) error { if d.Debug() { text, err := httputil.DumpResponse(resp, true) if err != nil { @@ -300,7 +300,7 @@ func timerReset(t *time.Timer, d time.Duration) { t.Reset(d) } -func checkStatusCode(resp *http.Response, d debug) error { +func checkStatusCode(resp *http.Response, d Debug) error { if resp.StatusCode == http.StatusTooManyRequests { retry, err := strconv.ParseInt(resp.Header.Get("Retry-After"), 10, 64) if err != nil { diff --git a/vendor/github.com/slack-go/slack/reminders.go b/vendor/github.com/slack-go/slack/reminders.go index de1170a6..f312af3f 100644 --- a/vendor/github.com/slack-go/slack/reminders.go +++ b/vendor/github.com/slack-go/slack/reminders.go @@ -3,17 +3,16 @@ package slack import ( "context" "net/url" - "time" ) type Reminder struct { - ID string `json:"id"` - Creator string `json:"creator"` - User string `json:"user"` - Text string `json:"text"` - Recurring bool `json:"recurring"` - Time time.Time `json:"time"` - CompleteTS int `json:"complete_ts"` + ID string `json:"id"` + Creator string `json:"creator"` + User string `json:"user"` + Text string `json:"text"` + Recurring bool `json:"recurring"` + Time int `json:"time"` + CompleteTS int `json:"complete_ts"` } type reminderResp struct { diff --git a/vendor/github.com/slack-go/slack/security.go b/vendor/github.com/slack-go/slack/security.go index dbe8fb2d..45103529 100644 --- a/vendor/github.com/slack-go/slack/security.go +++ b/vendor/github.com/slack-go/slack/security.go @@ -20,6 +20,7 @@ const ( // SecretsVerifier contains the information needed to verify that the request comes from Slack type SecretsVerifier struct { + d Debug signature []byte hmac hash.Hash } @@ -75,6 +76,11 @@ func NewSecretsVerifier(header http.Header, secret string) (sv SecretsVerifier, return sv, err } +func (v *SecretsVerifier) WithDebug(d Debug) *SecretsVerifier { + v.d = d + return v +} + func (v *SecretsVerifier) Write(body []byte) (n int, err error) { return v.hmac.Write(body) } @@ -86,8 +92,10 @@ func (v SecretsVerifier) Ensure() error { if hmac.Equal(computed, v.signature) { return nil } - - return fmt.Errorf("Expected signing signature: %s, but computed: %s", hex.EncodeToString(v.signature), hex.EncodeToString(computed)) + if v.d != nil && v.d.Debug() { + v.d.Debugln(fmt.Sprintf("Expected signing signature: %s, but computed: %s", hex.EncodeToString(v.signature), hex.EncodeToString(computed))) + } + return fmt.Errorf("Computed unexpected signature of: %s", hex.EncodeToString(computed)) } func abs64(n int64) int64 { diff --git a/vendor/github.com/slack-go/slack/users.go b/vendor/github.com/slack-go/slack/users.go index cdef4242..c2ee8713 100644 --- a/vendor/github.com/slack-go/slack/users.go +++ b/vendor/github.com/slack-go/slack/users.go @@ -513,7 +513,7 @@ func (api *Client) DeleteUserPhotoContext(ctx context.Context) (err error) { // // For more information see SetUserRealNameContextWithUser func (api *Client) SetUserRealName(realName string) error { - return api.SetUserRealNameContextWithUser(context.Background(), realName, realName) + return api.SetUserRealNameContextWithUser(context.Background(), "", realName) } // SetUserRealNameContextWithUser will set a real name for the provided user with a custom context @@ -531,11 +531,15 @@ func (api *Client) SetUserRealNameContextWithUser(ctx context.Context, user, rea } values := url.Values{ - "user": {user}, "token": {api.token}, "profile": {string(profile)}, } + // optional field. It should not be set if empty + if user != "" { + values["user"] = []string{user} + } + response := &userResponseFull{} if err = api.postMethod(ctx, "users.profile.set", values, response); err != nil { return err @@ -557,7 +561,7 @@ func (api *Client) SetUserCustomStatus(statusText, statusEmoji string, statusExp // // For more information see SetUserCustomStatus func (api *Client) SetUserCustomStatusContext(ctx context.Context, statusText, statusEmoji string, statusExpiration int64) error { - return api.SetUserCustomStatusContextWithUser(context.Background(), "", statusText, statusEmoji, statusExpiration) + return api.SetUserCustomStatusContextWithUser(ctx, "", statusText, statusEmoji, statusExpiration) } // SetUserCustomStatusWithUser will set a custom status and emoji for the provided user. @@ -598,11 +602,15 @@ func (api *Client) SetUserCustomStatusContextWithUser(ctx context.Context, user, } values := url.Values{ - "user": {user}, "token": {api.token}, "profile": {string(profile)}, } + // optional field. It should not be set if empty + if user != "" { + values["user"] = []string{user} + } + response := &userResponseFull{} if err = api.postMethod(ctx, "users.profile.set", values, response); err != nil { return err |