telegram

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromCmdlineOptions

func NewFromCmdlineOptions() plugin.Plugin

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

type TelegramOutput

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

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

func (t *TelegramOutput) ErrorChan() <-chan error

ErrorChan returns the plugin's error channel

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

func (t *TelegramOutput) InputChan() chan<- event.Event

InputChan returns the input event channel

func (*TelegramOutput) OutputChan

func (t *TelegramOutput) OutputChan() <-chan event.Event

OutputChan always returns nil

func (*TelegramOutput) SendMessage

func (t *TelegramOutput) SendMessage(message string) error

SendMessage sends a message to the configured Telegram chat

func (*TelegramOutput) Start

func (t *TelegramOutput) Start() error

Start the Telegram output

func (*TelegramOutput) Stop

func (t *TelegramOutput) Stop() error

Stop the Telegram output

Jump to

Keyboard shortcuts

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