slack_integration

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSignatureBlock added in v0.0.8

func CreateSignatureBlock(moduleName string) []slack.Block

CreateSignatureBlock creates a standardized signature block for Slack messages that includes metadata and a call for user feedback

Types

type Config

type Config struct {
	BotToken   string `split_words:"true" required:"true"`
	AppToken   string `split_words:"true" required:"true"`
	DevChannel string `split_words:"true" default:"ratchet-test"`
}

type Integration

type Integration interface {
	Run(ctx context.Context) error
	GetBotChannels() ([]slack.Channel, error)
	PostMessage(ctx context.Context, channelID string, messageBlocks ...slack.Block) error
	PostThreadReply(ctx context.Context, channelID, ts string, messageBlocks ...slack.Block) error
	Client() *slack.Client
	GetConversationInfo(ctx context.Context, channelID string) (*slack.Channel, error)
	GetConversationHistory(ctx context.Context, channelID string, lastNMsgs int) ([]slack.Message, error)
	GetConversationReplies(ctx context.Context, channelID, ts string) ([]slack.Message, error)
	BotUserID() string
	GetUserIDByEmail(ctx context.Context, email string) (string, error)
}

func New

func New(ctx context.Context, c Config, h handler) (Integration, error)

Jump to

Keyboard shortcuts

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