Documentation
¶
Index ¶
- Constants
- func DecodeConfig(raw map[string]any) (pkgchannel.TelegramConfig, error)
- func NewManagedRuntime(deps RuntimeDeps) pkgplugins.Runtime
- func RedactConfig(raw map[string]any) map[string]any
- func SetRuntimeFactoryForTesting(factory func(platform pkgplugins.Platform) (pkgplugins.Runtime, error)) func()
- type Bot
- type Config
- type RuntimeDeps
Constants ¶
View Source
const ( PluginID = "channel/telegram" RuntimeName = "bot" )
Variables ¶
This section is empty.
Functions ¶
func DecodeConfig ¶
func DecodeConfig(raw map[string]any) (pkgchannel.TelegramConfig, error)
func NewManagedRuntime ¶
func NewManagedRuntime(deps RuntimeDeps) pkgplugins.Runtime
func SetRuntimeFactoryForTesting ¶
func SetRuntimeFactoryForTesting(factory func(platform pkgplugins.Platform) (pkgplugins.Runtime, error)) func()
SetRuntimeFactoryForTesting swaps the Telegram managed runtime factory for tests.
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot wraps a Telegram bot with agent pool integration. It implements channel.Channel.
type Config ¶
type Config struct {
InstanceID string // configured channel instance ID
Token string // bot token
ChannelID string // broadcast channel ID or @username
GroupMode string // "mention" | "always" | "disabled"
}
Config holds Telegram bot settings.
type RuntimeDeps ¶
type RuntimeDeps struct {
Parent context.Context
Handler pkgchannel.Handler
Notifications pkgplugins.ChannelRegistry
Now func() time.Time
NewChannel func(pkgchannel.TelegramConfig, pkgchannel.Handler) (pkgchannel.Channel, error)
}
Click to show internal directories.
Click to hide internal directories.