slack

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionID

type ActionID string
const (
	// For alert
	ActionIDAckAlert     ActionID = "ack_alert"
	ActionIDBindAlert    ActionID = "bind_alert"
	ActionIDDeclineAlert ActionID = "decline_alert"
	ActionIDReopenAlert  ActionID = "reopen_alert"

	// For list
	ActionIDAckList  ActionID = "ack_list"
	ActionIDBindList ActionID = "bind_list"

	// For ticket
	ActionIDResolveTicket ActionID = "resolve_ticket"
	ActionIDSalvage       ActionID = "salvage"
	ActionIDEditTicket    ActionID = "edit_ticket"

	// For notice
	ActionIDEscalate ActionID = "escalate"

	// For refine
	ActionIDCreateTicketFromRefine ActionID = "create_ticket_from_refine"

	// For HITL
	ActionIDHITLApprove      ActionID = "hitl_approve"
	ActionIDHITLDeny         ActionID = "hitl_deny"
	ActionIDHITLSubmitAnswer ActionID = "hitl_submit_answer"
)

func (ActionID) String

func (id ActionID) String() string

type BlockAction

type BlockAction slack.BlockAction

type BlockActionID

type BlockActionID string

ActionID in block

const (
	BlockActionIDTicketSelect     BlockActionID = "ticket_select_input"
	BlockActionIDTicketID         BlockActionID = "ticket_id_input"
	BlockActionIDTicketComment    BlockActionID = "ticket_comment_input"
	BlockActionIDTicketConclusion BlockActionID = "ticket_conclusion_input"
	BlockActionIDTicketTags       BlockActionID = "ticket_tags_input"
	BlockActionIDSalvageThreshold BlockActionID = "salvage_threshold_input"
	BlockActionIDSalvageKeyword   BlockActionID = "salvage_keyword_input"
	BlockActionIDSalvageRefresh   BlockActionID = "salvage_refresh_button"
	BlockActionIDTicketTitle      BlockActionID = "ticket_title_input"
	BlockActionIDTicketDesc       BlockActionID = "ticket_description_input"
	BlockActionIDHITLComment      BlockActionID = "hitl_comment_input"
	BlockActionIDHITLAnswer       BlockActionID = "hitl_answer_input"
)

func (BlockActionID) String

func (id BlockActionID) String() string

type BlockID

type BlockID string
const (
	BlockIDTicketSelect     BlockID = "ticket_select_block"
	BlockIDTicketID         BlockID = "ticket_id_block"
	BlockIDTicketConclusion BlockID = "ticket_conclusion_block"
	BlockIDTicketComment    BlockID = "ticket_comment_block"
	BlockIDTicketTags       BlockID = "ticket_tags_block"
	BlockIDSalvageThreshold BlockID = "salvage_threshold_block"
	BlockIDSalvageKeyword   BlockID = "salvage_keyword_block"
	BlockIDHITLComment      BlockID = "hitl_comment_block"
	BlockIDHITLAnswer       BlockID = "hitl_answer_block"
)

func (BlockID) String

func (id BlockID) String() string

type CallbackID

type CallbackID string
const (
	CallbackSubmitResolveTicket CallbackID = "submit_resolve_ticket"
	CallbackSubmitBindAlert     CallbackID = "submit_bind_alert"
	CallbackSubmitBindList      CallbackID = "submit_bind_list"
	CallbackSubmitSalvage       CallbackID = "submit_salvage"
	CallbackEditTicket          CallbackID = "edit_ticket"
)

func (CallbackID) String

func (id CallbackID) String() string

type HistoryMessage added in v0.13.0

type HistoryMessage struct {
	UserID    string
	UserName  string
	Text      string
	Timestamp time.Time
	IsBot     bool
	IsThread  bool
}

HistoryMessage is a lightweight message model for embedding Slack conversation history into LLM system prompts. Unlike the full Message struct which includes parser functionality, this focuses on displayable content only.

type Mention

type Mention struct {
	UserID  string
	Message string
}

func ParseMention

func ParseMention(input string) []Mention

type Message

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

func NewMessage

func NewMessage(ctx context.Context, ev *slackevents.EventsAPIEvent) *Message

func NewTestMessage added in v0.8.0

func NewTestMessage(channelID, threadID, teamID, messageID, userID, text string) Message

NewTestMessage creates a Message for testing purposes. If threadID is empty, the message is treated as the first message in a thread (id becomes the threadID).

func NewTestMessageInThread added in v0.8.0

func NewTestMessageInThread(thread Thread, userID, text string) Message

NewTestMessageInThread creates a Message that is part of an existing thread. This is a convenience function for the common case of creating a reply message.

func (*Message) ChannelID

func (x *Message) ChannelID() string

func (*Message) ID

func (x *Message) ID() string

func (*Message) InThread

func (x *Message) InThread() bool

func (*Message) Mention

func (x *Message) Mention() []Mention

func (*Message) SlackURL added in v0.8.0

func (x *Message) SlackURL() string

SlackURL returns the Slack message URL Format: https://slack.com/archives/{channelID}/p{timestamp}

func (*Message) TeamID

func (x *Message) TeamID() string

func (*Message) Text

func (x *Message) Text() string

func (*Message) Thread

func (x *Message) Thread() Thread

func (*Message) ThreadID

func (x *Message) ThreadID() string

func (*Message) Timestamp

func (x *Message) Timestamp() string

func (*Message) User

func (x *Message) User() *User

type PayloadVerifier

type PayloadVerifier func(ctx context.Context, header http.Header, payload []byte) error

func NewPayloadVerifier

func NewPayloadVerifier(signingSecret string) PayloadVerifier

type StateValue

type StateValue map[string]map[string]BlockAction

func BlockActionFromValue

func BlockActionFromValue(value map[string]map[string]slack.BlockAction) StateValue

type Thread

type Thread struct {
	TeamID    string `json:"team_id"`
	ChannelID string `json:"channel_id"`
	ThreadID  string `json:"thread_id"`
}

type User

type User struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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