Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifySlackRequest ¶
func VerifySlackRequest(ctx context.Context, key string, headers map[string]string, body string) bool
https://api.slack.com/authentication/verifying-requests-from-slack
Types ¶
type Kit ¶
type Kit struct {
// contains filtered or unexported fields
}
func NewKit ¶
func NewKit(token string, config RetryConfig) Kit
func (*Kit) GetAllChannels ¶
https://api.slack.com/docs/conversations-api https://api.slack.com/methods/conversations.list
Required scopes:
- channels:read (public channels)
- groups:read (private channels)
func (*Kit) GetFullCommandRequest ¶
GetFullCommandRequest to retrieve correct channel name for "private group"s. Before March 2021, a private channel was "private group" in Slack implementation. And slash command payloads which Slack sends to us, contains wrong channel name info for private groups. So we need retrieve the correct channel name via Slack API. https://api.slack.com/types/group
func (Kit) PostMessage ¶
type PostMessageResult ¶ added in v1.0.8
type PostMessageResult struct { Type PostMessageResultType // Only when Type is ServerFailure StatusCode int Body string // Only when Type is DomainFailure Reason string ChannelID string ChannelName string }
Pack all neccessary fields into one struct to work-around no enum.
type PostMessageResultType ¶ added in v1.0.8
type PostMessageResultType int
const ( PostMessageResultOK PostMessageResultType = iota PostMessageResultServerTimeoutFailure PostMessageResultServerFailure PostMessageResultDomainFailure )
type RetryConfig ¶ added in v1.0.7
type SlashCommandRequest ¶
type SlashCommandRequest struct { OriginalSlashCommandRequest ChannelName string Supported bool }
Click to show internal directories.
Click to hide internal directories.