slack

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBookmarkActivity

func AddBookmarkActivity(ctx workflow.Context, cmd *cli.Command, channelID, title, url string)

https://docs.slack.dev/reference/methods/bookmarks.add

func KickUserFromChannelActivity added in v0.2.0

func KickUserFromChannelActivity(ctx workflow.Context, cmd *cli.Command, channelID, userID string) error

https://docs.slack.dev/reference/methods/conversations.kick

func NormalizeChannelName

func NormalizeChannelName(name string, maxLen int) string

NormalizeChannelName transforms arbitrary text into a valid Slack channel name. Based on: https://docs.slack.dev/reference/methods/conversations.create#naming.

Types

type Channel added in v0.2.0

type Channel struct {
	ID string `json:"id"`
}

type ChatDeleteRequest added in v0.2.0

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

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

https://docs.slack.dev/reference/methods/chat.delete

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

https://docs.slack.dev/reference/methods/chat.postMessage

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

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

type ReactionsAddRequest added in v0.2.0

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

https://docs.slack.dev/reference/methods/reactions.add

type ReactionsRemoveRequest added in v0.2.0

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

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

https://docs.slack.dev/reference/methods/reactions.remove

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

func UserInfoActivity added in v0.2.0

func UserInfoActivity(ctx workflow.Context, cmd *cli.Command, userID string) (*User, error)

https://docs.slack.dev/reference/methods/users.info

Jump to

Keyboard shortcuts

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