Documentation
¶
Index ¶
- func AddBookmarkActivity(ctx workflow.Context, cmd *cli.Command, channelID, title, url string)
- func AddReactionActivityAsync(ctx workflow.Context, cmd *cli.Command, req ReactionsAddRequest) workflow.Future
- func ArchiveChannelActivity(ctx workflow.Context, cmd *cli.Command, channelID string) error
- func CreateChannelActivity(ctx workflow.Context, cmd *cli.Command, name, url string) (string, bool, error)
- func DeleteChatMessageActivityAsync(ctx workflow.Context, cmd *cli.Command, req ChatDeleteRequest) workflow.Future
- func InviteUsersToChannelActivity(ctx workflow.Context, cmd *cli.Command, channelID string, userIDs []string) error
- func KickUserFromChannelActivity(ctx workflow.Context, cmd *cli.Command, channelID, userID string) error
- func NormalizeChannelName(name string, maxLen int) string
- func PostChatMessageActivityAsync(ctx workflow.Context, cmd *cli.Command, req ChatPostMessageRequest) workflow.Future
- func RemoveReactionActivityAsync(ctx workflow.Context, cmd *cli.Command, req ReactionsRemoveRequest) workflow.Future
- func SetChannelDescriptionActivity(ctx workflow.Context, cmd *cli.Command, channelID, title, url string)
- func SetChannelTopicActivity(ctx workflow.Context, cmd *cli.Command, channelID, url string)
- func UpdateChatMessageActivityAsync(ctx workflow.Context, cmd *cli.Command, req ChatUpdateRequest) workflow.Future
- type Channel
- type ChatDeleteRequest
- type ChatPostMessageRequest
- type ChatPostMessageResponse
- type ChatUpdateRequest
- type ConversationsCreateResponse
- type Profile
- type ReactionsAddRequest
- type ReactionsRemoveRequest
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBookmarkActivity ¶
func AddReactionActivityAsync ¶ added in v0.2.0
func CreateChannelActivity ¶
func CreateChannelActivity(ctx workflow.Context, cmd *cli.Command, name, url string) (string, bool, error)
https://docs.slack.dev/reference/methods/conversations.create
func DeleteChatMessageActivityAsync ¶ added in v0.2.0
func InviteUsersToChannelActivity ¶
func InviteUsersToChannelActivity(ctx workflow.Context, cmd *cli.Command, channelID string, userIDs []string) error
https://docs.slack.dev/reference/methods/conversations.invite
func KickUserFromChannelActivity ¶ added in v0.2.0
func NormalizeChannelName ¶
NormalizeChannelName transforms arbitrary text into a valid Slack channel name. Based on: https://docs.slack.dev/reference/methods/conversations.create#naming.
func PostChatMessageActivityAsync ¶
func RemoveReactionActivityAsync ¶ added in v0.2.0
func SetChannelDescriptionActivity ¶
func SetChannelDescriptionActivity(ctx workflow.Context, cmd *cli.Command, channelID, title, url string)
https://docs.slack.dev/reference/methods/conversations.setPurpose
func UpdateChatMessageActivityAsync ¶ added in v0.2.0
Types ¶
type ChatDeleteRequest ¶ added in v0.2.0
type ChatPostMessageRequest ¶
type ChatPostMessageRequest struct {
Channel string `json:"channel"`
Blocks []map[string]any `json:"blocks,omitempty"`
Attachments []map[string]any `json:"attachments,omitempty"`
MarkdownText string `json:"markdown_text,omitempty"`
Text string `json:"text,omitempty"`
ThreadTS string `json:"thread_ts,omitempty"`
ReplyBroadcast bool `json:"reply_broadcast,omitempty"`
IconEmoji string `json:"icon_emoji,omitempty"`
IconURL string `json:"icon_url,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
LinkNames bool `json:"link_names,omitempty"`
// Ignoring "mrkdwn" for now, because it has an unusual default value (true).
Parse string `json:"parse,omitempty"`
UnfurlLinks bool `json:"unfurl_links,omitempty"`
UnfurlMedia bool `json:"unfurl_media,omitempty"`
Username string `json:"username,omitempty"`
}
type ChatPostMessageResponse ¶
type ChatPostMessageResponse struct {
Channel string `json:"channel,omitempty"`
TS string `json:"ts,omitempty"`
Message map[string]any `json:"message,omitempty"`
// contains filtered or unexported fields
}
https://docs.slack.dev/reference/methods/chat.postMessage
func PostChatMessageActivity ¶
func PostChatMessageActivity(ctx workflow.Context, cmd *cli.Command, req ChatPostMessageRequest) (*ChatPostMessageResponse, error)
type ChatUpdateRequest ¶ added in v0.2.0
type ChatUpdateRequest struct {
Channel string `json:"channel"`
TS string `json:"ts"`
Blocks []map[string]any `json:"blocks,omitempty"`
Attachments []map[string]any `json:"attachments,omitempty"`
MarkdownText string `json:"markdown_text,omitempty"`
Text string `json:"text,omitempty"`
AsUser bool `json:"as_user,omitempty"`
FileIDs []string `json:"file_ids,omitempty"`
LinkNames bool `json:"link_names,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Parse string `json:"parse,omitempty"`
ReplyBroadcast bool `json:"reply_broadcast,omitempty"`
}
https://docs.slack.dev/reference/methods/chat.update
https://docs.slack.dev/reference/methods/chat.postMessage#channels
type ConversationsCreateResponse ¶
type ConversationsCreateResponse struct {
Channel *Channel `json:"channel,omitempty"`
// contains filtered or unexported fields
}
https://docs.slack.dev/reference/methods/conversations.create
type Profile ¶ added in v0.2.0
type Profile struct {
DisplayName string `json:"display_name"`
DisplayNameNormalized string `json:"display_name_normalized"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
RealName string `json:"real_name"`
RealNameNormalized string `json:"real_name_normalized"`
Email string `json:"email"`
Team string `json:"team"`
Image24 string `json:"image_24"`
Image32 string `json:"image_32"`
Image48 string `json:"image_48"`
Image72 string `json:"image_72"`
Image192 string `json:"image_192"`
Image512 string `json:"image_512"`
APIAppID string `json:"api_app_id,omitempty"`
BotID string `json:"bot_id,omitempty"`
AlwaysActive bool `json:"always_active,omitempty"`
}
https://docs.slack.dev/reference/objects/user-object/#profile
func UserProfileActivity ¶ added in v0.2.0
type ReactionsAddRequest ¶ added in v0.2.0
type ReactionsRemoveRequest ¶ added in v0.2.0
type User ¶ added in v0.2.0
type User struct {
ID string `json:"id"`
TeamID string `json:"team_id"`
RealName string `json:"real_name"`
IsBot bool `json:"is_bot"`
TZ string `json:"tz"`
TZLabel string `json:"tz_label"`
TZOffset int `json:"tz_offset"`
Updated int `json:"updated"`
Profile Profile `json:"profile"`
}
https://docs.slack.dev/reference/objects/user-object/. A slimmer version can be found in "pkg/users/slack.go".