slack

package
v1.12.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGreenButton = "Approve"
	DefaultRedButton   = "Deny"
)

Variables

This section is empty.

Functions

func Register

func Register(l zerolog.Logger, cmd *cli.Command, w worker.Worker)

Register exposes Temporal activities and workflows via the Timpani worker.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func (*API) FilesGetUploadURLExternalActivity added in v1.10.0

func (a *API) FilesGetUploadURLExternalActivity(ctx context.Context, req slack.FilesGetUploadURLExternalRequest) (*slack.FilesGetUploadURLExternalResponse, error)

https://docs.slack.dev/reference/methods/files.getUploadURLExternal/

Note: according to Slack documentation, this should be an HTTP POST request, but that doesn't work in tests ("invalid_arguments" API error), so using GET instead.

func (*API) TimpaniPostApprovalWorkflow

func (a *API) TimpaniPostApprovalWorkflow(ctx workflow.Context, req slack.TimpaniPostApprovalRequest) (*slack.TimpaniPostApprovalResponse, error)

TimpaniPostApprovalWorkflow is a convenience wrapper over [ChatPostMessageActivity]. 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 (*API) TimpaniUploadExternalActivity added in v1.10.0

func (a *API) TimpaniUploadExternalActivity(ctx context.Context, req slack.TimpaniUploadExternalRequest) error

TimpaniUploadExternalActivity uploads a file to Slack. It should be called after [FilesGetUploadURLExternalActivity] and before [FilesCompleteUploadExternalActivity].

Jump to

Keyboard shortcuts

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