Documentation
¶
Overview ¶
Package telegram sends notification batches through the Telegram Bot API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidConfig indicates invalid client settings. ErrInvalidConfig = errors.New("invalid telegram configuration") // ErrInvalidChat indicates an invalid chat destination. ErrInvalidChat = errors.New("invalid telegram chat") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client[T any] struct { // contains filtered or unexported fields }
Client is a shared Telegram bot client.
type Config ¶
type Config struct {
// Token is the required BotFather token. Errors do not include it.
Token string
// APIBase overrides the Bot API endpoint.
APIBase string
// WebhookURL receives updates in webhook mode.
WebhookURL string
// WebhookPattern is the ServeMux pattern returned by Routes.
WebhookPattern string
// WebhookSecret authenticates webhook callbacks.
WebhookSecret string
// Polling selects long polling instead of webhook mode.
Polling bool
// HTTPClient overrides the default HTTP client used for Bot API requests (i.e. for proxy).
// Callers must not mutate it while in use.
HTTPClient *http.Client
// ProxyCACertPath adds a trusted CA for the Bot API connection.
ProxyCACertPath string
// ClientCertPath and ClientKeyPath configure mTLS and must be set together.
ClientCertPath string
ClientKeyPath string
}
Config defines Telegram API and update-delivery settings.
Click to show internal directories.
Click to hide internal directories.