Documentation
¶
Overview ¶
Package telegram implements the gateway.Adapter for Telegram Bot API.
Index ¶
- type Adapter
- func (a *Adapter) AddChat(chatID int64, name string)
- func (a *Adapter) Channels(_ context.Context) ([]gateway.ExternalChannel, error)
- func (a *Adapter) DiscoverViaUpdate() error
- func (a *Adapter) Health(_ context.Context) error
- func (a *Adapter) Name() string
- func (a *Adapter) Send(_ context.Context, channelID, sender, content string) error
- func (a *Adapter) Start(ctx context.Context, onMessage func(gateway.InboundMessage)) error
- func (a *Adapter) Status() gateway.AdapterStatus
- func (a *Adapter) Stop(_ context.Context) error
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.Adapter for Telegram.
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) AddChat ¶
AddChat manually registers a chat ID → name mapping. Used when the bot hasn't received any messages yet but we know about the group.
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) Status ¶
func (a *Adapter) Status() gateway.AdapterStatus
Status returns the current connection state.
Click to show internal directories.
Click to hide internal directories.