Documentation
¶
Index ¶
- type TelegramOptionFunc
- func WithBotToken(token string) TelegramOptionFunc
- func WithChatID(chatID int64) TelegramOptionFunc
- func WithDisableLinkPreview(disable bool) TelegramOptionFunc
- func WithLogger(logger plugin.Logger) TelegramOptionFunc
- func WithOperatorUserIDs(ids ...int64) TelegramOptionFunc
- func WithParseMode(mode string) TelegramOptionFunc
- func WithRetryConfig(maxRetries int, initialBackoff, maxBackoff time.Duration) TelegramOptionFunc
- func WithSettingsFile(path string) TelegramOptionFunc
- type TelegramOutput
- func (t *TelegramOutput) GetBot() *bot.Bot
- func (t *TelegramOutput) GetChatID() int64
- func (t *TelegramOutput) Role() plugin.PluginType
- func (t *TelegramOutput) SendMessage(message string) error
- func (t *TelegramOutput) SetStatusProvider(provider func() bool)
- func (t *TelegramOutput) Start() error
- func (t *TelegramOutput) StartContext(ctx context.Context) error
- func (t *TelegramOutput) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TelegramOptionFunc ¶
type TelegramOptionFunc func(*TelegramOutput)
TelegramOptionFunc is a function type for configuring TelegramOutput
func WithBotToken ¶
func WithBotToken(token string) TelegramOptionFunc
WithBotToken specifies the Telegram Bot API token This token is obtained from @BotFather on Telegram
func WithChatID ¶
func WithChatID(chatID int64) TelegramOptionFunc
WithChatID specifies the chat ID to send messages to This can be a user ID, group ID, or channel ID For groups/channels, the ID is typically negative
func WithDisableLinkPreview ¶
func WithDisableLinkPreview(disable bool) TelegramOptionFunc
WithDisableLinkPreview disables link preview in messages
func WithLogger ¶
func WithLogger(logger plugin.Logger) TelegramOptionFunc
WithLogger specifies the logger object to use for logging messages
func WithOperatorUserIDs ¶ added in v0.47.0
func WithOperatorUserIDs(ids ...int64) TelegramOptionFunc
WithOperatorUserIDs allows the listed Telegram users to change group preferences.
func WithParseMode ¶
func WithParseMode(mode string) TelegramOptionFunc
WithParseMode specifies the message parse mode Options: HTML, Markdown (legacy), MarkdownV2 (default markdown)
func WithRetryConfig ¶
func WithRetryConfig( maxRetries int, initialBackoff, maxBackoff time.Duration, ) TelegramOptionFunc
WithRetryConfig specifies the retry configuration for message delivery
func WithSettingsFile ¶ added in v0.47.0
func WithSettingsFile(path string) TelegramOptionFunc
WithSettingsFile sets the local YAML file used for notification preferences.
type TelegramOutput ¶
TelegramOutput implements the Plugin interface for sending events to Telegram
func New ¶
func New(options ...TelegramOptionFunc) (*TelegramOutput, error)
New creates a new TelegramOutput with the provided options
func (*TelegramOutput) GetBot ¶
func (t *TelegramOutput) GetBot() *bot.Bot
GetBot returns the underlying Telegram bot instance for advanced usage
func (*TelegramOutput) GetChatID ¶
func (t *TelegramOutput) GetChatID() int64
GetChatID returns the configured chat ID
func (*TelegramOutput) Role ¶ added in v0.46.0
func (t *TelegramOutput) Role() plugin.PluginType
Role identifies this plugin as a pipeline output.
func (*TelegramOutput) SendMessage ¶
func (t *TelegramOutput) SendMessage(message string) error
SendMessage sends a message to the configured Telegram chat
func (*TelegramOutput) SetStatusProvider ¶ added in v0.47.0
func (t *TelegramOutput) SetStatusProvider(provider func() bool)
SetStatusProvider supplies the pipeline running state shown by /status. Configure it before starting the Telegram output.
func (*TelegramOutput) StartContext ¶ added in v0.46.0
func (t *TelegramOutput) StartContext(ctx context.Context) error
StartContext starts the plugin with ctx governing setup and run operations. Call Stop to wait for workers and release resources, including after cancellation.