slack

package
v1.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2026 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Overview

Package slack provides request/response/payload types, and Timpani activity names and wrapper functions, for interacting with Slack and GovSlack.

Index

Constants

View Source
const (
	BookmarksAddActivityName    = "slack.bookmarks.add"
	BookmarksEditActivityName   = "slack.bookmarks.edit"
	BookmarksListActivityName   = "slack.bookmarks.list"
	BookmarksRemoveActivityName = "slack.bookmarks.remove"
)
View Source
const (
	ChatDeleteActivityName        = "slack.chat.delete"
	ChatGetPermalinkActivityName  = "slack.chat.getPermalink"
	ChatPostEphemeralActivityName = "slack.chat.postEphemeral"
	ChatPostMessageActivityName   = "slack.chat.postMessage"
	ChatUpdateActivityName        = "slack.chat.update"

	TimpaniPostApprovalWorkflowName = "slack.timpani.postApproval"
)
View Source
const (
	ConversationsArchiveActivityName    = "slack.conversations.archive"
	ConversationsCloseActivityName      = "slack.conversations.close"
	ConversationsCreateActivityName     = "slack.conversations.create"
	ConversationsHistoryActivityName    = "slack.conversations.history"
	ConversationsInfoActivityName       = "slack.conversations.info"
	ConversationsInviteActivityName     = "slack.conversations.invite"
	ConversationsJoinActivityName       = "slack.conversations.join"
	ConversationsKickActivityName       = "slack.conversations.kick"
	ConversationsLeaveActivityName      = "slack.conversations.leave"
	ConversationsListActivityName       = "slack.conversations.list"
	ConversationsMembersActivityName    = "slack.conversations.members"
	ConversationsOpenActivityName       = "slack.conversations.open"
	ConversationsRenameActivityName     = "slack.conversations.rename"
	ConversationsRepliesActivityName    = "slack.conversations.replies"
	ConversationsSetPurposeActivityName = "slack.conversations.setPurpose"
	ConversationsSetTopicActivityName   = "slack.conversations.setTopic"
)
View Source
const (
	FilesCompleteUploadExternalActivityName = "slack.files.completeUploadExternal"
	FilesDeleteActivityName                 = "slack.files.delete"
	FilesGetUploadURLExternalActivityName   = "slack.files.getUploadURLExternal"

	TimpaniUploadExternalActivityName = "slack.timpani.uploadExternal"
)
View Source
const (
	ReactionsAddActivityName    = "slack.reactions.add"
	ReactionsGetActivityName    = "slack.reactions.get"
	ReactionsListActivityName   = "slack.reactions.list"
	ReactionsRemoveActivityName = "slack.reactions.remove"
)
View Source
const (
	UserGroupsListActivityName      = "slack.usergroups.list"
	UserGroupsUsersListActivityName = "slack.usergroups.users.list"
)
View Source
const (
	UsersConversationsActivityName = "slack.users.conversations"
	UsersGetPresenceActivityName   = "slack.users.getPresence"
	UsersInfoActivityName          = "slack.users.info"
	UsersListActivityName          = "slack.users.list"
	UsersLookupByEmailActivityName = "slack.users.lookupByEmail"
	UsersProfileGetActivityName    = "slack.users.profile.get"
)
View Source
const (
	AuthTestActivityName = "slack.auth.test"
)
View Source
const (
	BotsInfoActivityName = "slack.bots.info"
)

Variables

This section is empty.

Functions

func BookmarksAdd added in v1.5.0

func BookmarksAdd(ctx workflow.Context, channelID, title, url, emoji string) error

BookmarksAdd is based on: https://docs.slack.dev/reference/methods/bookmarks.add/

func BookmarksEditTitle added in v1.5.0

func BookmarksEditTitle(ctx workflow.Context, channelID, bookmarkID, title string) error

BookmarksEditTitle is based on: https://docs.slack.dev/reference/methods/bookmarks.edit/

func BookmarksRemove added in v1.5.0

func BookmarksRemove(ctx workflow.Context, channelID, bookmarkID string) error

BookmarksRemove is based on: https://docs.slack.dev/reference/methods/bookmarks.remove/

func ChatDelete added in v1.5.0

func ChatDelete(ctx workflow.Context, channelID, timestamp string) error

ChatDelete is based on: https://docs.slack.dev/reference/methods/chat.delete/

func ChatGetPermalink(ctx workflow.Context, channelID, timestamp string) (string, error)

ChatGetPermalink is based on: https://docs.slack.dev/reference/methods/chat.getPermalink/

func ChatPostEphemeral added in v1.5.0

func ChatPostEphemeral(ctx workflow.Context, req ChatPostEphemeralRequest) error

ChatPostEphemeral is based on: https://docs.slack.dev/reference/methods/chat.postEphemeral/

func ChatUpdate added in v1.5.0

func ChatUpdate(ctx workflow.Context, req ChatUpdateRequest) error

ChatUpdate is based on: https://docs.slack.dev/reference/methods/chat.update/

func ConversationsArchive added in v1.5.0

func ConversationsArchive(ctx workflow.Context, channelID string) error

ConversationsArchive is based on: https://docs.slack.dev/reference/methods/conversations.archive/

func ConversationsCreate added in v1.5.0

func ConversationsCreate(ctx workflow.Context, name string, private bool) (string, error)

ConversationsCreate is based on: https://docs.slack.dev/reference/methods/conversations.create/

func ConversationsInfo added in v1.5.0

func ConversationsInfo(ctx workflow.Context, channelID string, locale, numMembers bool) (map[string]any, error)

ConversationsInfo is based on: https://docs.slack.dev/reference/methods/conversations.info/

func ConversationsInvite added in v1.5.0

func ConversationsInvite(ctx workflow.Context, channelID string, users []string, force bool) error

ConversationsInvite is based on: https://docs.slack.dev/reference/methods/conversations.invite/

func ConversationsKick added in v1.5.0

func ConversationsKick(ctx workflow.Context, channelID, userID string) error

ConversationsKick is based on: https://docs.slack.dev/reference/methods/conversations.kick/

func ConversationsRename added in v1.5.0

func ConversationsRename(ctx workflow.Context, channelID, name string) error

ConversationsRename is based on: https://docs.slack.dev/reference/methods/conversations.rename/

func ConversationsSetPurpose added in v1.5.0

func ConversationsSetPurpose(ctx workflow.Context, channelID, purpose string) error

ConversationsSetPurpose is based on: https://docs.slack.dev/reference/methods/conversations.setPurpose/

func ConversationsSetTopic added in v1.5.0

func ConversationsSetTopic(ctx workflow.Context, channelID, topic string) error

ConversationsSetTopic is based on: https://docs.slack.dev/reference/methods/conversations.setTopic/

func FilesDelete added in v1.6.0

func FilesDelete(ctx workflow.Context, file string) error

FilesDelete is based on: https://docs.slack.dev/reference/methods/files.delete/

func FilesGetUploadURLExternal added in v1.5.0

func FilesGetUploadURLExternal(ctx workflow.Context, length int, filename, snippetType, altTxt string) (string, string, error)

FilesGetUploadURLExternal is based on: https://docs.slack.dev/reference/methods/files.getuploadurlexternal/

func ReactionsAdd added in v1.5.0

func ReactionsAdd(ctx workflow.Context, channelID, timestamp, name string) error

ReactionsAdd is based on: https://docs.slack.dev/reference/methods/reactions.add/

func ReactionsGet added in v1.5.0

func ReactionsGet(ctx workflow.Context, channelID, timestamp string) (map[string]any, error)

ReactionsGet is based on: https://docs.slack.dev/reference/methods/reactions.get/

func ReactionsRemove added in v1.5.0

func ReactionsRemove(ctx workflow.Context, channelID, timestamp, name string) error

ReactionsRemove is based on: https://docs.slack.dev/reference/methods/reactions.remove/

func TimpaniPostApprovalWorkflow

func TimpaniPostApprovalWorkflow(ctx workflow.Context, req TimpaniPostApprovalRequest) (map[string]any, error)

TimpaniPostApprovalWorkflow is a convenience wrapper over ChatPostMessage. It sends an interactive message to a user/group/channel with a short header, a markdown message, and 2 buttons. It then waits for (and returns) the user selection.

For message formatting tips, see https://docs.slack.dev/messaging/formatting-message-text.

func TimpaniUploadExternal added in v1.5.0

func TimpaniUploadExternal(ctx workflow.Context, url, mimeType string, content []byte) error

TimpaniUploadExternal is based on: https://docs.slack.dev/messaging/working-with-files/

func UserGroupsUsersList added in v1.7.0

func UserGroupsUsersList(ctx workflow.Context, usergroup string, includeDisabled bool) ([]string, error)

UserGroupsUsersList is based on: https://docs.slack.dev/reference/methods/usergroups.users.list/

Types

type AuthTestResponse added in v0.3.0

type AuthTestResponse struct {
	Response

	URL                 string `json:"url,omitempty"`
	Team                string `json:"team,omitempty"`
	User                string `json:"user,omitempty"`
	TeamID              string `json:"team_id,omitempty"`
	UserID              string `json:"user_id,omitempty"`
	BotID               string `json:"bot_id,omitempty"`
	EnterpriseID        string `json:"enterprise_id,omitempty"`
	IsEnterpriseInstall bool   `json:"is_enterprise_install,omitempty"`
}

AuthTestResponse is based on: https://docs.slack.dev/reference/methods/auth.test/

func AuthTest added in v1.5.0

func AuthTest(ctx workflow.Context) (*AuthTestResponse, error)

AuthTest is based on: https://docs.slack.dev/reference/methods/auth.test/

type Bookmark

type Bookmark struct {
	ID        string `json:"id"`
	ChannelID string `json:"channel_id"`
	Title     string `json:"title"`
	Type      string `json:"type"`

	Link     *string `json:"link,omitempty"`
	Emoji    *string `json:"emoji,omitempty"`
	IconURL  *string `json:"icon_url,omitempty"`
	EntityID *string `json:"entity_id,omitempty"`

	DateCreated         int64  `json:"date_created"`
	DateUpdated         int64  `json:"date_updated"`
	Rank                string `json:"rank"`
	LastUpdatedByUserID string `json:"last_updated_by_user_id"`
	LastUpdatedByTeamID string `json:"last_updated_by_team_id"`

	ShortcutID  string `json:"shortcut_id"`
	AppID       string `json:"app_id"`
	AppActionID string `json:"app_action_id"`
}

Bookmark is based on:

func BookmarksList added in v1.5.0

func BookmarksList(ctx workflow.Context, channelID string) ([]Bookmark, error)

BookmarksList is based on: https://docs.slack.dev/reference/methods/bookmarks.list/

type BookmarksAddRequest

type BookmarksAddRequest struct {
	ChannelID string `json:"channel_id"`
	Title     string `json:"title"`
	Type      string `json:"type"`

	Link        string `json:"link,omitempty"`
	Emoji       string `json:"emoji,omitempty"`
	EntityID    string `json:"entity_id,omitempty"`
	AccessLevel string `json:"access_level,omitempty"`
	ParentID    string `json:"parent_id,omitempty"`
}

BookmarksAddRequest is based on: https://docs.slack.dev/reference/methods/bookmarks.add/

type BookmarksAddResponse

type BookmarksAddResponse struct {
	Response

	Bookmark *Bookmark `json:"bookmark,omitempty"`
}

BookmarksAddResponse is based on: https://docs.slack.dev/reference/methods/bookmarks.add/

type BookmarksEditRequest

type BookmarksEditRequest struct {
	ChannelID  string `json:"channel_id"`
	BookmarkID string `json:"bookmark_id"`

	Title string `json:"title,omitempty"`
	Link  string `json:"link,omitempty"`
	Emoji string `json:"emoji,omitempty"`
}

BookmarksEditRequest is based on: https://docs.slack.dev/reference/methods/bookmarks.edit/

type BookmarksEditResponse

type BookmarksEditResponse struct {
	Response

	Bookmark *Bookmark `json:"bookmark,omitempty"`
}

BookmarksEditResponse is based on: https://docs.slack.dev/reference/methods/bookmarks.edit/

type BookmarksListRequest

type BookmarksListRequest struct {
	ChannelID string `json:"channel_id"`
}

BookmarksListRequest is based on: https://docs.slack.dev/reference/methods/bookmarks.list/

type BookmarksListResponse

type BookmarksListResponse struct {
	Response

	Bookmarks []Bookmark `json:"bookmarks,omitempty"`
}

BookmarksListResponse is based on: https://docs.slack.dev/reference/methods/bookmarks.list/

type BookmarksRemoveRequest

type BookmarksRemoveRequest struct {
	ChannelID  string `json:"channel_id"`
	BookmarkID string `json:"bookmark_id"`

	QuipSectionID string `json:"quip_section_id,omitempty"`
}

BookmarksRemoveRequest is based on: https://docs.slack.dev/reference/methods/bookmarks.remove/

type BookmarksRemoveResponse

type BookmarksRemoveResponse Response

BookmarksRemoveResponse is based on: https://docs.slack.dev/reference/methods/bookmarks.remove/

type Bot

type Bot struct {
	ID      string `json:"id"`
	TeamID  string `json:"team_id"`
	Name    string `json:"name"`
	AppID   string `json:"app_id"`
	UserID  string `json:"user_id"`
	Deleted bool   `json:"deleted"`
	Updated int64  `json:"updated"`
}

Bot is based on: https://docs.slack.dev/reference/methods/bots.info/

func BotsInfo added in v1.5.0

func BotsInfo(ctx workflow.Context, botID string) (*Bot, error)

BotsInfo is based on: https://docs.slack.dev/reference/methods/bots.info/

type BotsInfoRequest

type BotsInfoRequest struct {
	Bot string `json:"bot"`

	TeamID string `json:"team_id,omitempty"`
}

BotsInfoRequest is based on: https://docs.slack.dev/reference/methods/bots.info/

type BotsInfoResponse

type BotsInfoResponse struct {
	Response

	Bot *Bot `json:"bot,omitempty"`
}

BotsInfoResponse is based on: https://docs.slack.dev/reference/methods/bots.info/

type ChatDeleteRequest

type ChatDeleteRequest struct {
	Channel string `json:"channel"`
	TS      string `json:"ts"`

	AsUser bool `json:"as_user,omitempty"`
}

ChatDeleteRequest is based on: https://docs.slack.dev/reference/methods/chat.delete/

type ChatDeleteResponse

type ChatDeleteResponse struct {
	Response

	Channel string `json:"channel,omitempty"`
	TS      string `json:"ts,omitempty"`
}

ChatDeleteResponse is based on: https://docs.slack.dev/reference/methods/chat.delete/

type ChatGetPermalinkRequest

type ChatGetPermalinkRequest struct {
	Channel   string `json:"channel"`
	MessageTS string `json:"message_ts"`
}

ChatGetPermalinkRequest is based on: https://docs.slack.dev/reference/methods/chat.getPermalink/

type ChatGetPermalinkResponse

type ChatGetPermalinkResponse struct {
	Response

	Channel   string `json:"channel,omitempty"`
	Permalink string `json:"permalink,omitempty"`
}

ChatGetPermalinkResponse is based on: https://docs.slack.dev/reference/methods/chat.getPermalink/

type ChatPostEphemeralRequest

type ChatPostEphemeralRequest struct {
	Channel string `json:"channel"`
	User    string `json:"user"`

	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"`

	IconEmoji string `json:"icon_emoji,omitempty"`
	IconURL   string `json:"icon_url,omitempty"`

	LinkNames bool   `json:"link_names,omitempty"`
	Parse     string `json:"parse,omitempty"`
	Username  string `json:"username,omitempty"`
}

ChatPostEphemeralRequest is based on: https://docs.slack.dev/reference/methods/chat.postEphemeral/

type ChatPostEphemeralResponse

type ChatPostEphemeralResponse struct {
	Response

	MessageTS string `json:"message_ts,omitempty"`
}

ChatPostEphemeralResponse is based on: https://docs.slack.dev/reference/methods/chat.postEphemeral/

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"`
	Username  string `json:"username,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"`
}

ChatPostMessageRequest is based on: https://docs.slack.dev/reference/methods/chat.postMessage/

type ChatPostMessageResponse

type ChatPostMessageResponse struct {
	Response

	Channel string         `json:"channel,omitempty"`
	TS      string         `json:"ts,omitempty"`
	Message map[string]any `json:"message,omitempty"`
}

ChatPostMessageResponse is based on: https://docs.slack.dev/reference/methods/chat.postMessage/

func ChatPostMessage added in v1.5.0

ChatPostMessage is based on: https://docs.slack.dev/reference/methods/chat.postMessage/

type ChatUpdateRequest

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"`

	FileIDs        []string       `json:"file_ids,omitempty"`
	Metadata       map[string]any `json:"metadata,omitempty"`
	ReplyBroadcast bool           `json:"reply_broadcast,omitempty"`

	AsUser    bool   `json:"as_user,omitempty"`
	LinkNames bool   `json:"link_names,omitempty"`
	Parse     string `json:"parse,omitempty"`
}

ChatUpdateRequest is based on: https://docs.slack.dev/reference/methods/chat.update/

type ChatUpdateResponse

type ChatUpdateResponse struct {
	Response

	Channel string         `json:"channel,omitempty"`
	TS      string         `json:"ts,omitempty"`
	Text    string         `json:"text,omitempty"`
	Message map[string]any `json:"message,omitempty"`
}

ChatUpdateResponse is based on: https://docs.slack.dev/reference/methods/chat.update/

type ConversationsArchiveRequest

type ConversationsArchiveRequest struct {
	Channel string `json:"channel"`
}

ConversationsArchiveRequest is based on: https://docs.slack.dev/reference/methods/conversations.archive/

type ConversationsArchiveResponse

type ConversationsArchiveResponse Response

ConversationsArchiveResponse is based on: https://docs.slack.dev/reference/methods/conversations.archive/

type ConversationsCloseRequest

type ConversationsCloseRequest struct {
	Channel string `json:"channel"`
}

ConversationsCloseRequest is based on: https://docs.slack.dev/reference/methods/conversations.close/

type ConversationsCloseResponse

type ConversationsCloseResponse struct {
	Response

	NoOp          bool `json:"no_op,omitempty"`
	AlreadyClosed bool `json:"already_closed,omitempty"`
}

ConversationsCloseResponse is based on: https://docs.slack.dev/reference/methods/conversations.close/

type ConversationsCreateRequest

type ConversationsCreateRequest struct {
	Name string `json:"name"`

	IsPrivate bool   `json:"is_private,omitempty"`
	TeamID    string `json:"team_id,omitempty"`
}

ConversationsCreateRequest is based on: https://docs.slack.dev/reference/methods/conversations.create/

type ConversationsCreateResponse

type ConversationsCreateResponse struct {
	Response

	// https://docs.slack.dev/reference/objects/conversation-object/
	Channel map[string]any `json:"channel,omitempty"`
}

ConversationsCreateResponse is based on: https://docs.slack.dev/reference/methods/conversations.create/

type ConversationsHistoryRequest

type ConversationsHistoryRequest struct {
	Channel string `json:"channel"`

	IncludeAllMetadata bool   `json:"include_all_metadata,omitempty"`
	Inclusive          bool   `json:"inclusive,omitempty"`
	Latest             string `json:"latest,omitempty"`
	Oldest             string `json:"oldest,omitempty"`

	Limit  int    `json:"limit,omitempty"`
	Cursor string `json:"cursor,omitempty"`
}

ConversationsHistoryRequest is based on: https://docs.slack.dev/reference/methods/conversations.history/

type ConversationsHistoryResponse

type ConversationsHistoryResponse struct {
	Response

	Messages  []map[string]any `json:"messages,omitempty"`
	Latest    string           `json:"latest,omitempty"`
	HasMore   bool             `json:"has_more,omitempty"`
	IsLimited bool             `json:"is_limited,omitempty"`
	PinCount  int              `json:"pin_count,omitempty"`
}

ConversationsHistoryResponse is based on: https://docs.slack.dev/reference/methods/conversations.history/

type ConversationsInfoRequest

type ConversationsInfoRequest struct {
	Channel string `json:"channel"`

	IncludeLocale     bool `json:"include_locale,omitempty"`
	IncludeNumMembers bool `json:"include_num_members,omitempty"`
}

ConversationsInfoRequest is based on: https://docs.slack.dev/reference/methods/conversations.info/

type ConversationsInfoResponse

type ConversationsInfoResponse struct {
	Response

	// https://docs.slack.dev/reference/objects/conversation-object/
	Channel map[string]any `json:"channel,omitempty"`
}

ConversationsInfoResponse is based on: https://docs.slack.dev/reference/methods/conversations.info/

type ConversationsInviteRequest

type ConversationsInviteRequest struct {
	Channel string `json:"channel"`
	Users   string `json:"users"`

	Force bool `json:"force,omitempty"`
}

ConversationsInviteRequest is based on: https://docs.slack.dev/reference/methods/conversations.invite/

type ConversationsInviteResponse

type ConversationsInviteResponse struct {
	Response

	// https://docs.slack.dev/reference/objects/conversation-object/
	Channel map[string]any `json:"channel,omitempty"`
}

ConversationsInviteResponse is based on: https://docs.slack.dev/reference/methods/conversations.invite/

type ConversationsJoinRequest

type ConversationsJoinRequest struct {
	Channel string `json:"channel"`
}

ConversationsJoinRequest is based on: https://docs.slack.dev/reference/methods/conversations.join/

type ConversationsJoinResponse

type ConversationsJoinResponse struct {
	Response

	// https://docs.slack.dev/reference/objects/conversation-object/
	Channel map[string]any `json:"channel,omitempty"`
}

ConversationsJoinResponse is based on: https://docs.slack.dev/reference/methods/conversations.join/

type ConversationsKickRequest

type ConversationsKickRequest struct {
	Channel string `json:"channel"`
	User    string `json:"user"`
}

ConversationsKickRequest is based on: https://docs.slack.dev/reference/methods/conversations.kick/

type ConversationsKickResponse

type ConversationsKickResponse Response

ConversationsKickResponse is based on: https://docs.slack.dev/reference/methods/conversations.kick/

type ConversationsLeaveRequest

type ConversationsLeaveRequest struct {
	Channel string `json:"channel"`
}

ConversationsLeaveRequest is based on: https://docs.slack.dev/reference/methods/conversations.leave/

type ConversationsLeaveResponse

type ConversationsLeaveResponse struct {
	Response

	NotInChannel bool `json:"not_in_channel,omitempty"`
}

ConversationsLeaveResponse is based on: https://docs.slack.dev/reference/methods/conversations.leave/

type ConversationsListRequest

type ConversationsListRequest struct {
	Types           string `json:"types,omitempty"`
	ExcludeArchived bool   `json:"exclude_archived,omitempty"`

	Limit  int    `json:"limit,omitempty"`
	Cursor string `json:"cursor,omitempty"`

	TeamID string `json:"team_id,omitempty"`
}

ConversationsListRequest is based on: https://docs.slack.dev/reference/methods/conversations.list/

type ConversationsListResponse

type ConversationsListResponse struct {
	Response

	// https://docs.slack.dev/reference/objects/conversation-object/
	Channels []map[string]any `json:"channels,omitempty"`
}

ConversationsListResponse is based on: https://docs.slack.dev/reference/methods/conversations.list/

type ConversationsMembersRequest

type ConversationsMembersRequest struct {
	Channel string `json:"channel"`

	Limit  int    `json:"limit,omitempty"`
	Cursor string `json:"cursor,omitempty"`
}

ConversationsMembersRequest is based on: https://docs.slack.dev/reference/methods/conversations.members/

type ConversationsMembersResponse

type ConversationsMembersResponse struct {
	Response

	Members []string `json:"members,omitempty"`
}

ConversationsMembersResponse is based on: https://docs.slack.dev/reference/methods/conversations.members/

type ConversationsOpenRequest

type ConversationsOpenRequest struct {
	Channel         string `json:"channel,omitempty"`
	ReturnIM        bool   `json:"return_im,omitempty"`
	Users           string `json:"users,omitempty"`
	PreventCreation bool   `json:"prevent_creation,omitempty"`
}

ConversationsOpenRequest is based on: https://docs.slack.dev/reference/methods/conversations.open/

type ConversationsOpenResponse

type ConversationsOpenResponse struct {
	Response

	NoOp        bool `json:"no_op,omitempty"`
	AlreadyOpen bool `json:"already_open,omitempty"`
	// https://docs.slack.dev/reference/objects/conversation-object/
	Channel map[string]any `json:"channel,omitempty"`
}

ConversationsOpenResponse is based on: https://docs.slack.dev/reference/methods/conversations.open/

type ConversationsRenameRequest

type ConversationsRenameRequest struct {
	Channel string `json:"channel"`
	Name    string `json:"name"`
}

ConversationsRenameRequest is based on: https://docs.slack.dev/reference/methods/conversations.rename/

type ConversationsRenameResponse

type ConversationsRenameResponse struct {
	Response

	// https://docs.slack.dev/reference/objects/conversation-object/
	Channel map[string]any `json:"channel,omitempty"`
}

ConversationsRenameResponse is based on: https://docs.slack.dev/reference/methods/conversations.rename/

type ConversationsRepliesRequest

type ConversationsRepliesRequest struct {
	Channel string `json:"channel"`
	TS      string `json:"ts"`

	IncludeAllMetadata bool   `json:"include_all_metadata,omitempty"`
	Inclusive          bool   `json:"inclusive,omitempty"`
	Latest             string `json:"latest,omitempty"`
	Oldest             string `json:"oldest,omitempty"`

	Limit  int    `json:"limit,omitempty"`
	Cursor string `json:"cursor,omitempty"`
}

ConversationsRepliesRequest is based on: https://docs.slack.dev/reference/methods/conversations.replies/

type ConversationsRepliesResponse

type ConversationsRepliesResponse struct {
	Response

	Messages []map[string]any `json:"messages,omitempty"`
	HasMore  bool             `json:"has_more,omitempty"`
}

ConversationsRepliesResponse is based on: https://docs.slack.dev/reference/methods/conversations.replies/

type ConversationsSetPurposeRequest

type ConversationsSetPurposeRequest struct {
	Channel string `json:"channel"`
	Purpose string `json:"purpose"`
}

ConversationsSetPurposeRequest is based on: https://docs.slack.dev/reference/methods/conversations.setPurpose/

type ConversationsSetPurposeResponse

type ConversationsSetPurposeResponse struct {
	Response

	// https://docs.slack.dev/reference/objects/conversation-object/
	Channel map[string]any `json:"channel,omitempty"` // Empirically different from the documentation.
}

ConversationsSetPurposeResponse is based on: https://docs.slack.dev/reference/methods/conversations.setPurpose/

type ConversationsSetTopicRequest

type ConversationsSetTopicRequest struct {
	Channel string `json:"channel"`
	Topic   string `json:"topic"`
}

ConversationsSetTopicRequest is based on: https://docs.slack.dev/reference/methods/conversations.setTopic/

type ConversationsSetTopicResponse

type ConversationsSetTopicResponse struct {
	Response

	// https://docs.slack.dev/reference/objects/conversation-object/
	Channel map[string]any `json:"channel,omitempty"`
}

ConversationsSetTopicResponse is based on: https://docs.slack.dev/reference/methods/conversations.setTopic/

type File added in v1.2.0

type File struct {
	ID    string `json:"id,omitempty"`
	Title string `json:"title,omitempty"`

	Created      int64  `json:"created,omitempty"`
	Updated      int64  `json:"updated,omitempty"`
	Size         int    `json:"size,omitempty"`
	Name         string `json:"name,omitempty"`
	FileType     string `json:"filetype,omitempty"`
	MimeType     string `json:"mimetype,omitempty"`
	PrettyType   string `json:"pretty_type,omitempty"`
	ExternalType string `json:"external_type,omitempty"`

	UserTeam string `json:"user_team,omitempty"`
	User     string `json:"user,omitempty"`

	Channels []string `json:"channels,omitempty"`
	Groups   []string `json:"groups,omitempty"`
	IMs      []string `json:"ims,omitempty"`
	PinnedTo []string `json:"pinned_to,omitempty"`

	Mode       string `json:"mode,omitempty"`
	FileAccess string `json:"file_access,omitempty"`
	Lines      int    `json:"lines,omitempty"`
	LinesMore  int    `json:"lines_more,omitempty"`

	Editable           bool `json:"editable,omitempty"`
	HasMoreShares      bool `json:"has_more_shares,omitempty"`
	HasRichPreview     bool `json:"has_rich_preview,omitempty"`
	IsExternal         bool `json:"is_external,omitempty"`
	IsPublic           bool `json:"is_public,omitempty"`
	PreviewIsTruncated bool `json:"preview_is_truncated,omitempty"`
	PublicURLShared    bool `json:"public_url_shared,omitempty"`

	EditLink           string `json:"edit_link,omitempty"`
	Permalink          string `json:"permalink,omitempty"`
	PermalinkPublic    string `json:"permalink_public,omitempty"`
	URLPrivate         string `json:"url_private,omitempty"`
	URLPrivateDownload string `json:"url_private_download,omitempty"`

	Preview          string `json:"preview,omitempty"`
	PreviewHighlight string `json:"preview_highlight,omitempty"`

	Shares map[string]map[string][]FileShare `json:"shares,omitempty"` // "private"/"public" -> channel ID -> []FileShare.
}

File is based on: https://docs.slack.dev/reference/objects/file-object/#types

func FilesCompleteUploadExternal added in v1.5.0

func FilesCompleteUploadExternal(ctx workflow.Context, req FilesCompleteUploadExternalRequest) ([]File, error)

FilesCompleteUploadExternal is based on: https://docs.slack.dev/reference/methods/files.completeuploadexternal/

type FileShare added in v1.3.0

type FileShare struct {
	ChannelName string `json:"channel_name,omitempty"`
	ShareUserID string `json:"share_user_id,omitempty"`
	TeamID      string `json:"team_id,omitempty"`
	TS          string `json:"ts,omitempty"`

	IsSilentShare bool   `json:"is_silent_share,omitempty"`
	Source        string `json:"source,omitempty"`
}

FileShare is based on: https://docs.slack.dev/reference/objects/file-object/#types

type FilesCompleteUploadExternalRequest added in v1.2.0

type FilesCompleteUploadExternalRequest struct {
	Files []File `json:"files"`

	ChannelID      string `json:"channel_id,omitempty"`
	ThreadTS       string `json:"thread_ts,omitempty"`
	Channels       string `json:"channels,omitempty"`
	InitialComment string `json:"initial_comment,omitempty"`
	Blocks         string `json:"blocks,omitempty"`
}

FilesCompleteUploadExternalRequest is based on: https://docs.slack.dev/reference/methods/files.completeuploadexternal/

type FilesCompleteUploadExternalResponse added in v1.2.0

type FilesCompleteUploadExternalResponse struct {
	Response

	Files []File `json:"files,omitempty"`
}

FilesCompleteUploadExternalResponse is based on: https://docs.slack.dev/reference/methods/files.completeuploadexternal/

type FilesDeleteRequest added in v1.6.0

type FilesDeleteRequest struct {
	File string `json:"file"`
}

FilesDeleteRequest is based on: https://docs.slack.dev/reference/methods/files.delete/

type FilesDeleteResponse added in v1.6.0

type FilesDeleteResponse Response

FilesDeleteResponse is based on: https://docs.slack.dev/reference/methods/files.delete/

type FilesGetUploadURLExternalRequest added in v1.2.0

type FilesGetUploadURLExternalRequest struct {
	Length   int    `json:"length"`
	Filename string `json:"filename"`

	SnippetType string `json:"snippet_type,omitempty"`
	AltTxt      string `json:"alt_txt,omitempty"`
}

FilesGetUploadURLExternalRequest is based on: https://docs.slack.dev/reference/methods/files.getuploadurlexternal/

type FilesGetUploadURLExternalResponse added in v1.2.0

type FilesGetUploadURLExternalResponse struct {
	Response

	UploadURL string `json:"upload_url,omitempty"`
	FileID    string `json:"file_id,omitempty"`
}

FilesGetUploadURLExternalResponse is based on: https://docs.slack.dev/reference/methods/files.getuploadurlexternal/

type Prefs added in v1.7.0

type Prefs struct {
	Channels []string `json:"channels,omitempty"`
	Groups   []string `json:"groups,omitempty"`
}

Prefs is based on: https://docs.slack.dev/reference/objects/usergroup-object/

type Profile

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"`
}

Profile is based on: https://docs.slack.dev/reference/objects/user-object/#profile

func UsersProfileGet added in v1.5.0

func UsersProfileGet(ctx workflow.Context, userID string) (*Profile, error)

UsersProfileGet is based on: https://docs.slack.dev/reference/methods/users.profile.get/

type ReactionsAddRequest

type ReactionsAddRequest struct {
	Channel   string `json:"channel"`
	Timestamp string `json:"timestamp"`
	Name      string `json:"name"`
}

ReactionsAddRequest is based on: https://docs.slack.dev/reference/methods/reactions.add/

type ReactionsAddResponse

type ReactionsAddResponse Response

ReactionsAddResponse is based on: https://docs.slack.dev/reference/methods/reactions.add/

type ReactionsGetRequest

type ReactionsGetRequest struct {
	Channel     string `json:"channel,omitempty"`
	Timestamp   string `json:"timestamp,omitempty"`
	File        string `json:"file,omitempty"`
	FileComment string `json:"file_comment,omitempty"`
	Full        bool   `json:"full,omitempty"`
}

ReactionsGetRequest is based on: https://docs.slack.dev/reference/methods/reactions.get/

type ReactionsGetResponse

type ReactionsGetResponse struct {
	Response

	Type        string         `json:"type,omitempty"`
	Message     map[string]any `json:"message,omitempty"`
	File        map[string]any `json:"file,omitempty"`
	FileComment map[string]any `json:"file_comment,omitempty"`
	Channel     string         `json:"channel,omitempty"`
}

ReactionsGetResponse is based on: https://docs.slack.dev/reference/methods/reactions.get/

type ReactionsListRequest

type ReactionsListRequest struct {
	User string `json:"user,omitempty"`

	Full   bool   `json:"full,omitempty"`
	Count  int    `json:"count,omitempty"`
	Page   int    `json:"page,omitempty"`
	Limit  int    `json:"limit,omitempty"`
	Cursor string `json:"cursor,omitempty"`

	TeamID string `json:"team_id,omitempty"`
}

ReactionsListRequest is based on: https://docs.slack.dev/reference/methods/reactions.list/

type ReactionsListResponse

type ReactionsListResponse struct {
	Response

	Items []map[string]any `json:"items,omitempty"`
}

ReactionsListResponse is based on: https://docs.slack.dev/reference/methods/reactions.list/

type ReactionsRemoveRequest

type ReactionsRemoveRequest struct {
	Name string `json:"name"`

	Channel     string `json:"channel,omitempty"`
	Timestamp   string `json:"timestamp,omitempty"`
	File        string `json:"file,omitempty"`
	FileComment string `json:"file_comment,omitempty"`
}

ReactionsRemoveRequest is based on: https://docs.slack.dev/reference/methods/reactions.remove/

type ReactionsRemoveResponse

type ReactionsRemoveResponse Response

ReactionsRemoveResponse is based on: https://docs.slack.dev/reference/methods/reactions.remove/

type Response

type Response struct {
	OK               bool              `json:"ok"`
	Error            string            `json:"error,omitempty"`
	Errors           any               `json:"errors,omitempty"`   // More details (partially undocumented).
	Needed           string            `json:"needed,omitempty"`   // Scope errors (undocumented).
	Provided         string            `json:"provided,omitempty"` // Scope errors (undocumented).
	Warning          string            `json:"warning,omitempty"`
	ResponseMetadata *ResponseMetadata `json:"response_metadata,omitempty"`
}

type ResponseMetadata

type ResponseMetadata struct {
	Messages   []string `json:"messages,omitempty"`
	Warnings   []string `json:"warnings,omitempty"`
	NextCursor string   `json:"next_cursor,omitempty"`
}

type TimpaniPostApprovalRequest

type TimpaniPostApprovalRequest struct {
	Channel string `json:"channel"`

	Header      string `json:"header"`
	Message     string `json:"message"`
	GreenButton string `json:"green_button,omitempty"`
	RedButton   string `json:"red_button,omitempty"`

	ThreadTS       string         `json:"thread_ts,omitempty"`
	ReplyBroadcast bool           `json:"reply_broadcast,omitempty"`
	Metadata       map[string]any `json:"metadata,omitempty"`

	Timeout string `json:"timeout,omitempty"`
}

TimpaniPostApprovalRequest is similar to ChatPostMessageRequest. If button labels are not specified here, their default values are "Approve" and "Deny".

type TimpaniPostApprovalResponse

type TimpaniPostApprovalResponse struct {
	Response

	InteractionEvent map[string]any `json:"interaction_event,omitempty"`
}

TimpaniPostApprovalResponse is based on: https://docs.slack.dev/reference/interaction-payloads/

type TimpaniUploadExternalRequest added in v1.2.1

type TimpaniUploadExternalRequest struct {
	URL      string `json:"url"`
	MimeType string `json:"mime_type"`
	Content  []byte `json:"content"`
}

TimpaniUploadExternalRequest is based on: https://docs.slack.dev/messaging/working-with-files/

type User

type User struct {
	ID       string `json:"id"`
	TeamID   string `json:"team_id"`
	RealName string `json:"real_name"`
	IsBot    bool   `json:"is_bot,omitempty"`

	TZ       string `json:"tz"`
	TZLabel  string `json:"tz_label"`
	TZOffset int    `json:"tz_offset"`

	Updated int64 `json:"updated"`

	Profile Profile `json:"profile"`
}

User is based on: https://docs.slack.dev/reference/objects/user-object/

func UsersInfo added in v1.5.0

func UsersInfo(ctx workflow.Context, userID string) (*User, error)

UsersInfo is based on: https://docs.slack.dev/reference/methods/users.info/

func UsersLookupByEmail added in v1.5.0

func UsersLookupByEmail(ctx workflow.Context, email string) (*User, error)

UsersLookupByEmail is based on: https://docs.slack.dev/reference/methods/users.lookupByEmail/

type UserGroup added in v1.7.0

type UserGroup struct {
	ID                  string `json:"id,omitempty"`
	TeamID              string `json:"team_id,omitempty"`
	EnterpriseSubteamID string `json:"enterprise_subteam_id,omitempty"`

	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Handle      string `json:"handle,omitempty"`
	AutoType    string `json:"auto_type,omitempty"`

	DateCreate int64 `json:"date_create,omitempty"`
	DateUpdate int64 `json:"date_update,omitempty"`
	DateDelete int64 `json:"date_delete,omitempty"`

	Prefs Prefs    `json:"prefs"`
	Users []string `json:"users,omitempty"`

	UserCount    int `json:"user_count,omitempty"`
	ChannelCount int `json:"channel_count,omitempty"`
}

UserGroup is based on: https://docs.slack.dev/reference/objects/usergroup-object/

func UserGroupsList added in v1.7.0

func UserGroupsList(ctx workflow.Context, count, disabled, users bool) ([]UserGroup, error)

UserGroupsList is based on: https://docs.slack.dev/reference/methods/usergroups.list/

type UserGroupsListRequest added in v1.7.0

type UserGroupsListRequest struct {
	IncludeCount    bool `json:"include_count,omitempty"`
	IncludeDisabled bool `json:"include_disabled,omitempty"`
	IncludeUsers    bool `json:"include_users,omitempty"`

	TeamID string `json:"team_id,omitempty"`
}

UserGroupsListRequest is based on: https://docs.slack.dev/reference/methods/usergroups.list/

type UserGroupsListResponse added in v1.7.0

type UserGroupsListResponse struct {
	Response

	Usergroups []UserGroup `json:"usergroups,omitempty"`
}

UserGroupsListResponse is based on: https://docs.slack.dev/reference/methods/usergroups.list/

type UserGroupsUsersListRequest added in v1.7.0

type UserGroupsUsersListRequest struct {
	Usergroup string `json:"usergroup"`

	IncludeDisabled bool   `json:"include_disabled,omitempty"`
	TeamID          string `json:"team_id,omitempty"`
}

UserGroupsUsersListRequest is based on: https://docs.slack.dev/reference/methods/usergroups.users.list/

type UserGroupsUsersListResponse added in v1.7.0

type UserGroupsUsersListResponse struct {
	Response

	Users []string `json:"users,omitempty"`
}

UserGroupsUsersListResponse is based on: https://docs.slack.dev/reference/methods/usergroups.users.list/

type UsersConversationsRequest

type UsersConversationsRequest struct {
	Types           string `json:"types,omitempty"`
	User            string `json:"user,omitempty"`
	ExcludeArchived bool   `json:"exclude_archived,omitempty"`

	Limit  int    `json:"limit,omitempty"`
	Cursor string `json:"cursor,omitempty"`

	TeamID string `json:"team_id,omitempty"`
}

UsersConversationsRequest is based on: https://docs.slack.dev/reference/methods/users.conversations/

type UsersConversationsResponse

type UsersConversationsResponse struct {
	Response

	Channels []map[string]any `json:"channels,omitempty"`
}

UsersConversationsResponse is based on: https://docs.slack.dev/reference/methods/users.conversations/

type UsersGetPresenceRequest

type UsersGetPresenceRequest struct {
	User string `json:"user,omitempty"`
}

UsersGetPresenceRequest is based on: https://docs.slack.dev/reference/methods/users.getPresence/

type UsersGetPresenceResponse

type UsersGetPresenceResponse struct {
	Response

	Presence string `json:"presence,omitempty"`
}

UsersGetPresenceResponse is based on: https://docs.slack.dev/reference/methods/users.getPresence/

type UsersInfoRequest

type UsersInfoRequest struct {
	User string `json:"user"`

	IncludeLocale bool `json:"include_locale,omitempty"`
}

UsersInfoRequest is based on: https://docs.slack.dev/reference/methods/users.info/

type UsersInfoResponse

type UsersInfoResponse struct {
	Response

	User *User `json:"user,omitempty"`
}

UsersInfoResponse is based on: https://docs.slack.dev/reference/methods/users.info/

type UsersListRequest

type UsersListRequest struct {
	IncludeLocale bool `json:"include_locale,omitempty"`

	Limit  int    `json:"limit,omitempty"`
	Cursor string `json:"cursor,omitempty"`

	TeamID string `json:"team_id,omitempty"`
}

UsersListRequest is based on: https://docs.slack.dev/reference/methods/users.list/

type UsersListResponse

type UsersListResponse struct {
	Response

	Members []map[string]any `json:"members,omitempty"`
	CacheTS int64            `json:"cache_ts,omitempty"`
}

UsersListResponse is based on: https://docs.slack.dev/reference/methods/users.list/

type UsersLookupByEmailRequest

type UsersLookupByEmailRequest struct {
	Email string `json:"email"`
}

UsersLookupByEmailRequest is based on: https://docs.slack.dev/reference/methods/users.lookupByEmail/

type UsersLookupByEmailResponse

type UsersLookupByEmailResponse struct {
	Response

	User *User `json:"user,omitempty"`
}

UsersLookupByEmailResponse is based on: https://docs.slack.dev/reference/methods/users.lookupByEmail/

type UsersProfileGetRequest

type UsersProfileGetRequest struct {
	User string `json:"user"`

	IncludeLabels bool `json:"include_labels,omitempty"`
}

UsersProfileGetRequest is based on: https://docs.slack.dev/reference/methods/users.profile.get/

type UsersProfileGetResponse

type UsersProfileGetResponse struct {
	Response

	Profile *Profile `json:"profile,omitempty"`
}

UsersProfileGetResponse is based on: https://docs.slack.dev/reference/methods/users.profile.get/

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL