Documentation
¶
Index ¶
- type FileWithURL
- type Slack
- func (s *Slack) AddAction(channelID, timestamp string, action common.Action) error
- func (s *Slack) AddActions(channelID, timestamp string, actions []common.Action) error
- func (s *Slack) AddDivider(channelID, message string) error
- func (s *Slack) AddReaction(channelID, timestamp, name string) error
- func (s *Slack) ClearActions(channelID, timestamp string) error
- func (s *Slack) Command(channel, text string, user common.User, parent common.Message, ...) error
- func (s *Slack) Debug(msg string, args ...any)
- func (s *Slack) DeleteMessage(channel, ID string) error
- func (s *Slack) Error(msg string, args ...any)
- func (s *Slack) FindMessagesByTag(key, value string) map[string]string
- func (s *Slack) Info(msg string, args ...any)
- func (s *Slack) Name() string
- func (s *Slack) PostMessage(channel string, message string, attachments []*common.Attachment, ...) (string, error)
- func (s *Slack) ReadMessage(channel, messageTS, threadTS string) (string, error)
- func (s *Slack) ReadThread(channel, threadTS string) ([]string, error)
- func (s *Slack) RemoveAction(channelID, timestamp, name string) error
- func (s *Slack) RemoveReaction(channelID, timestamp, name string) error
- func (s *Slack) SendImage(channelID, threadTS string, fileContent []byte, ...) error
- func (t *Slack) Start(wg *sync.WaitGroup)
- func (t *Slack) Stop()
- func (s *Slack) TagMessage(channelID, timestamp string, tags map[string]string) error
- func (s *Slack) UpdateMessage(channel, ID, message string) error
- func (s *Slack) Warn(msg string, args ...any)
- type SlackChannel
- type SlackCompleteUploadExternalResponse
- type SlackFileResponseFull
- type SlackMessage
- func (sm *SlackMessage) Caller() common.User
- func (sm *SlackMessage) Channel() common.Channel
- func (sm *SlackMessage) ID() string
- func (sm *SlackMessage) OriginalID() string
- func (sm *SlackMessage) ParentID() string
- func (sm *SlackMessage) SetParentID(threadTS string)
- func (sm *SlackMessage) User() common.User
- func (sm *SlackMessage) Visible() bool
- type SlackMessageCache
- type SlackMessageField
- func (smf *SlackMessageField) Default() string
- func (smf *SlackMessageField) Dependencies() []string
- func (smf *SlackMessageField) Filter() string
- func (smf *SlackMessageField) Hint() string
- func (smf *SlackMessageField) Label() string
- func (smf *SlackMessageField) Name() string
- func (smf *SlackMessageField) Required() bool
- func (smf *SlackMessageField) Type() common.FieldType
- func (smf *SlackMessageField) Value() string
- func (smf *SlackMessageField) Values() []string
- func (smf *SlackMessageField) Visible() bool
- type SlackMessageFields
- type SlackMessageKey
- type SlackOptions
- type SlackResponse
- type SlackRichTextQuote
- type SlackRichTextQuoteElement
- type SlackUploadURLExternalResponse
- type SlackUser
- type SlackUserGroups
- type Telegram
- type TelegramOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileWithURL ¶ added in v0.12.3
type Slack ¶
type Slack struct {
// contains filtered or unexported fields
}
func NewSlack ¶
func NewSlack(options SlackOptions, observability *common.Observability, processors *common.Processors) *Slack
func (*Slack) AddActions ¶ added in v0.10.0
func (*Slack) AddDivider ¶ added in v0.11.7
func (*Slack) AddReaction ¶ added in v0.4.7
func (*Slack) ClearActions ¶ added in v0.10.0
func (*Slack) Command ¶ added in v0.5.0
func (s *Slack) Command(channel, text string, user common.User, parent common.Message, response common.Response) error
this method primarily used in custom command executions
func (*Slack) DeleteMessage ¶ added in v0.7.0
func (*Slack) FindMessagesByTag ¶ added in v0.12.12
func (*Slack) PostMessage ¶ added in v0.7.0
func (s *Slack) PostMessage(channel string, message string, attachments []*common.Attachment, actions []common.Action, user common.User, parent common.Message, response common.Response) (string, error)
this method is needed to post custom messages
func (*Slack) ReadMessage ¶ added in v0.7.0
func (*Slack) ReadThread ¶ added in v0.11.15
func (*Slack) RemoveAction ¶ added in v0.10.0
func (*Slack) RemoveReaction ¶ added in v0.9.2
func (*Slack) Stop ¶ added in v0.12.1
func (t *Slack) Stop()
Stop gracefully shuts down the Slack bot and saves the cache
func (*Slack) TagMessage ¶ added in v0.12.12
TagMessage adds tags to an existing message in cache
func (*Slack) UpdateMessage ¶ added in v0.7.0
type SlackChannel ¶ added in v0.2.0
type SlackChannel struct {
// contains filtered or unexported fields
}
func (*SlackChannel) ID ¶ added in v0.2.0
func (sc *SlackChannel) ID() string
type SlackCompleteUploadExternalResponse ¶ added in v0.1.0
type SlackCompleteUploadExternalResponse struct {
Files []slack.FileSummary `json:"files"`
slack.SlackResponse
}
type SlackFileResponseFull ¶ added in v0.1.0
type SlackMessage ¶ added in v0.2.0
type SlackMessage struct {
// contains filtered or unexported fields
}
func FromSlackMessageCache ¶ added in v0.12.1
func FromSlackMessageCache(cache *SlackMessageCache, slack *Slack) (*SlackMessage, error)
FromSlackMessageCache converts a SlackMessageCache back to a SlackMessage Note: This requires the Slack instance to fully reconstruct, as some fields need to be re-populated by the Slack instance
func (*SlackMessage) Caller ¶ added in v0.10.0
func (sm *SlackMessage) Caller() common.User
func (*SlackMessage) Channel ¶ added in v0.3.9
func (sm *SlackMessage) Channel() common.Channel
func (*SlackMessage) ID ¶ added in v0.2.0
func (sm *SlackMessage) ID() string
func (*SlackMessage) OriginalID ¶ added in v0.11.1
func (sm *SlackMessage) OriginalID() string
func (*SlackMessage) ParentID ¶ added in v0.4.2
func (sm *SlackMessage) ParentID() string
func (*SlackMessage) SetParentID ¶ added in v0.9.3
func (sm *SlackMessage) SetParentID(threadTS string)
func (*SlackMessage) User ¶ added in v0.2.0
func (sm *SlackMessage) User() common.User
func (*SlackMessage) Visible ¶ added in v0.2.0
func (sm *SlackMessage) Visible() bool
type SlackMessageCache ¶ added in v0.12.1
type SlackMessageCache struct {
// Basic identification
Type string `json:"type"`
CommandText string `json:"command_text,omitempty"`
CommandName string `json:"command_name,omitempty"`
WrapperName string `json:"wrapper_name,omitempty"`
// Keys
OriginChannelID string `json:"origin_channel_id,omitempty"`
OriginTimestamp string `json:"origin_timestamp,omitempty"`
OriginThreadTS string `json:"origin_thread_ts,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
ThreadTS string `json:"thread_ts,omitempty"`
// User information
UserID string `json:"user_id,omitempty"`
UserName string `json:"user_name,omitempty"`
UserTimeZone string `json:"user_timezone,omitempty"`
CallerID string `json:"caller_id,omitempty"`
CallerName string `json:"caller_name,omitempty"`
CallerTimeZone string `json:"caller_timezone,omitempty"`
BotID string `json:"bot_id,omitempty"`
// Message properties
Visible bool `json:"visible"`
ResponseURL string `json:"response_url,omitempty"`
// Serialized fields (complex types serialized to JSON strings)
SerializedBlocks string `json:"blocks,omitempty"`
SerializedActions string `json:"actions,omitempty"`
SerializedParams string `json:"params,omitempty"`
SerializedFields string `json:"fields,omitempty"`
// Message tags for grouping and bulk operations
Tags map[string]string `json:"tags,omitempty"`
// Timestamp for when this cache entry was created
CachedAt time.Time `json:"cached_at"`
}
SlackMessageCache is a simplified version of SlackMessage for caching purposes. It contains only the essential fields needed for caching and is designed for easy serialization.
func ToSlackMessageCache ¶ added in v0.12.1
func ToSlackMessageCache(sm *SlackMessage) (*SlackMessageCache, error)
ToSlackMessageCache converts a SlackMessage to a SlackMessageCache for serialization
type SlackMessageField ¶ added in v0.11.0
type SlackMessageField struct {
// contains filtered or unexported fields
}
func (*SlackMessageField) Default ¶ added in v0.11.0
func (smf *SlackMessageField) Default() string
func (*SlackMessageField) Dependencies ¶ added in v0.11.0
func (smf *SlackMessageField) Dependencies() []string
func (*SlackMessageField) Filter ¶ added in v0.11.0
func (smf *SlackMessageField) Filter() string
func (*SlackMessageField) Hint ¶ added in v0.11.0
func (smf *SlackMessageField) Hint() string
func (*SlackMessageField) Label ¶ added in v0.11.0
func (smf *SlackMessageField) Label() string
func (*SlackMessageField) Name ¶ added in v0.11.0
func (smf *SlackMessageField) Name() string
func (*SlackMessageField) Required ¶ added in v0.11.0
func (smf *SlackMessageField) Required() bool
func (*SlackMessageField) Type ¶ added in v0.11.0
func (smf *SlackMessageField) Type() common.FieldType
func (*SlackMessageField) Value ¶ added in v0.11.0
func (smf *SlackMessageField) Value() string
func (*SlackMessageField) Values ¶ added in v0.11.0
func (smf *SlackMessageField) Values() []string
func (*SlackMessageField) Visible ¶ added in v0.11.4
func (smf *SlackMessageField) Visible() bool
type SlackMessageFields ¶ added in v0.11.0
type SlackMessageFields struct {
// contains filtered or unexported fields
}
type SlackMessageKey ¶ added in v0.10.0
type SlackMessageKey struct {
// contains filtered or unexported fields
}
func (*SlackMessageKey) String ¶ added in v0.10.0
func (smk *SlackMessageKey) String() string
type SlackOptions ¶
type SlackOptions struct {
BotToken string
AppToken string
Debug bool
DefaultCommand string
HelpCommand string
GroupPermissions string
UserPermissions string
Timeout int
PublicChannel string
ApprovalAny bool
ApprovalReply string
ApprovalReasons string
ApprovalDescription string
AttachmentColor string
ErrorColor string
TitleConfirmation string
ApprovedMessage string
RejectedMessage string
WaitingMessage string
ReactionDoing string
ReactionDone string
ReactionFailed string
ReactionForm string
ReactionApproval string
ReactionApproved string
ReactionRejected string
ButtonSubmitCaption string
ButtonSubmitStyle string
ButtonCancelCaption string
ButtonCancelStyle string
ButtonConfirmCaption string
ButtonRejectCaption string
ButtonApproveCaption string
CacheTTL string
CacheTagMessagesTTL string
MaxQueryOptions int
MinQueryLength int
UserGroupsInterval int
CacheFileName string
}
type SlackResponse ¶ added in v0.6.4
type SlackResponse struct {
// contains filtered or unexported fields
}
func (*SlackResponse) Duration ¶ added in v0.6.4
func (r *SlackResponse) Duration() bool
func (*SlackResponse) Error ¶ added in v0.6.4
func (r *SlackResponse) Error() bool
func (*SlackResponse) IconURL ¶ added in v0.12.6
func (r *SlackResponse) IconURL() string
func (*SlackResponse) Original ¶ added in v0.6.4
func (r *SlackResponse) Original() bool
func (*SlackResponse) Visible ¶ added in v0.6.4
func (r *SlackResponse) Visible() bool
type SlackRichTextQuote ¶
type SlackRichTextQuote struct {
Type slack.RichTextElementType `json:"type"`
Elements []*SlackRichTextQuoteElement `json:"elements"`
}
func (SlackRichTextQuote) RichTextElementType ¶
func (r SlackRichTextQuote) RichTextElementType() slack.RichTextElementType
SlackRichTextQuote
type SlackRichTextQuoteElement ¶
type SlackRichTextQuoteElement struct {
Type slack.RichTextElementType `json:"type"`
Text string `json:"text,omitempty"`
UserID string `json:"user_id,omitempty"`
}
func (SlackRichTextQuoteElement) RichTextElementType ¶
func (r SlackRichTextQuoteElement) RichTextElementType() slack.RichTextElementType
type SlackUploadURLExternalResponse ¶ added in v0.1.0
type SlackUploadURLExternalResponse struct {
UploadURL string `json:"upload_url"`
FileID string `json:"file_id"`
slack.SlackResponse
}
type SlackUserGroups ¶ added in v0.10.0
type SlackUserGroups struct {
// contains filtered or unexported fields
}
type Telegram ¶
type Telegram struct {
// contains filtered or unexported fields
}
func NewTelegram ¶
func NewTelegram(options TelegramOptions, observability *common.Observability, processors *common.Processors) *Telegram