Documentation
¶
Overview ¶
Package telegram implements the gateway.NotificationAdapter for Telegram Bot API.
Index ¶
- type Adapter
- func (a *Adapter) AddChat(chatID int64, name string)
- func (a *Adapter) Channels() []gateway.ChannelInfo
- func (a *Adapter) DiscoverViaUpdate() error
- func (a *Adapter) HTTPHandler() http.Handler
- func (a *Adapter) Name() string
- func (a *Adapter) Send(_ context.Context, channelID, sender, content string) error
- func (a *Adapter) Start(ctx context.Context, handler func(gateway.Notification)) error
- func (a *Adapter) Status() gateway.AdapterStatus
- func (a *Adapter) Stop() error
- func (a *Adapter) Type() gateway.AdapterType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements gateway.NotificationAdapter for Telegram. It also supports outbound messaging via the Send method.
func NewNamed ¶ added in v0.2.0
NewNamed creates a Telegram adapter with a custom name (e.g. "telegram:trade_research"). This allows registering multiple Telegram bots in the same gateway manager.
func (*Adapter) Channels ¶
func (a *Adapter) Channels() []gateway.ChannelInfo
Channels returns discovered channels.
func (*Adapter) DiscoverViaUpdate ¶
DiscoverViaUpdate processes a single getUpdates call to discover groups the bot has been added to. Called before Start to populate initial channels.
func (*Adapter) HTTPHandler ¶ added in v0.2.1
HTTPHandler returns nil since Telegram uses polling, not webhooks.
func (*Adapter) Status ¶
func (a *Adapter) Status() gateway.AdapterStatus
Status returns the current connection state.
func (*Adapter) Type ¶ added in v0.2.1
func (a *Adapter) Type() gateway.AdapterType
Type returns AdapterSocket since Telegram uses long-polling that blocks like a socket.