bot

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SlackButtonFormType     string = "form"
	SlackButtonApprovalType string = "approval"
)

Variables

This section is empty.

Functions

This section is empty.

Types

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) AddReaction added in v0.4.7

func (s *Slack) AddReaction(channelID, timestamp, name string) error

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

func (*Slack) Debug added in v0.1.0

func (s *Slack) Debug(msg string, args ...any)

func (*Slack) DeleteMessage added in v0.7.0

func (s *Slack) DeleteMessage(channel, ID string) error

func (*Slack) Error added in v0.1.0

func (s *Slack) Error(msg string, args ...any)

func (*Slack) Info added in v0.0.3

func (s *Slack) Info(msg string, args ...any)

func (*Slack) Name

func (s *Slack) Name() string

func (*Slack) PostMessage added in v0.7.0

func (s *Slack) PostMessage(channel string, text string, attachments []*common.Attachment, user common.User, parent common.Message, response common.Response) error

func (*Slack) ReadMessage added in v0.7.0

func (s *Slack) ReadMessage(channel, ID string) (string, error)

func (*Slack) Start

func (t *Slack) Start(wg *sync.WaitGroup)

func (*Slack) UpdateMessage added in v0.7.0

func (s *Slack) UpdateMessage(channel, ID, message string) error

func (*Slack) Warn added in v0.1.0

func (s *Slack) Warn(msg string, args ...any)

type SlackButton added in v0.7.0

type SlackButton struct {
	Type      string
	Timestamp string
	ThreadTS  string
	ChannelID string
	UserID    string
	Text      string
	Command   string
	Group     string
	Params    common.ExecuteParams
	Wrapped   string
	Wrapper   string
}

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 SlackFile added in v0.1.0

type SlackFile struct {
	URL string `json:"url,omitempty"`
	ID  string `json:"id,omitempty"`
}

type SlackFileBlock added in v0.2.2

type SlackFileBlock struct {
	Type       slack.MessageBlockType `json:"type"`
	ExternalID string                 `json:"external_id"`
	Source     string                 `json:"source"`
	BlockID    string                 `json:"block_id,omitempty"`
}

func (SlackFileBlock) BlockType added in v0.2.2

func (s SlackFileBlock) BlockType() slack.MessageBlockType

SlackFileBlock

type SlackFileResponseFull added in v0.1.0

type SlackFileResponseFull struct {
	slack.File   `json:"file"`
	slack.Paging `json:"paging"`
	Comments     []slack.Comment        `json:"comments"`
	Files        []slack.File           `json:"files"`
	Metadata     slack.ResponseMetadata `json:"response_metadata"`
	slack.SlackResponse
}

type SlackImageBlock added in v0.1.0

type SlackImageBlock struct {
	Type      slack.MessageBlockType `json:"type"`
	SlackFile *SlackFile             `json:"slack_file"`
	AltText   string                 `json:"alt_text"`
	BlockID   string                 `json:"block_id,omitempty"`
	Title     *slack.TextBlockObject `json:"title,omitempty"`
}

func (SlackImageBlock) BlockType added in v0.1.0

func (s SlackImageBlock) BlockType() slack.MessageBlockType

SlackImageBlock

type SlackMessage added in v0.2.0

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

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) ParentID added in v0.4.2

func (sm *SlackMessage) ParentID() 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 SlackOptions

type SlackOptions struct {
	BotToken         string
	AppToken         string
	Debug            bool
	DefaultCommand   string
	HelpCommand      string
	GroupPermissions string
	UserPermissions  string
	Timeout          int
	PublicChannel    string

	ApprovalAllowed bool
	ApprovalMessage string

	AttachmentColor string
	ErrorColor      string

	TitleConfirmation string
	ApprovedMessage   string
	RejectedMessage   string

	ReactionDoing    string
	ReactionDone     string
	ReactionFailed   string
	ReactionDialog   string
	ReactionApproved string
	ReactionRejected string

	ButtonSubmitCaption  string
	ButtonSubmitStyle    string
	ButtonCancelCaption  string
	ButtonCancelStyle    string
	ButtonConfirmCaption string
	ButtonRejectCaption  string
	ButtonApproveCaption string

	CacheTTL        string
	MaxQueryOptions int
	MinQueryLength  int
}

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) 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 SlackUser

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

func (*SlackUser) Commands added in v0.6.10

func (su *SlackUser) Commands() []string

func (*SlackUser) ID

func (su *SlackUser) ID() string

func (*SlackUser) Name

func (su *SlackUser) Name() string

func (*SlackUser) TimeZone added in v0.1.1

func (su *SlackUser) TimeZone() string

type Telegram

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

func NewTelegram

func NewTelegram(options TelegramOptions, observability *common.Observability, processors *common.Processors) *Telegram

func (*Telegram) Name

func (t *Telegram) Name() string

func (*Telegram) Start

func (t *Telegram) Start(wg *sync.WaitGroup)

type TelegramOptions

type TelegramOptions struct {
	BotToken string
	Debug    bool
	Timeout  int
	Offset   int
}

Jump to

Keyboard shortcuts

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