Documentation
¶
Overview ¶
Package bridge implements the two directions of the support bridge: a client's private messages become a forum topic in the support group, and whatever the operators write in that topic comes back to the client as a message from the bot.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge wires the Telegram client, the store and the message catalogs together.
func New ¶
func New(cfg config.Config, st store.Store, client *tg.Client, texts *i18n.Bundle, botUsername string, loc *time.Location, log *slog.Logger) *Bridge
New builds a bridge. botUsername lets it tell its own commands from those addressed to another bot in the group; loc is the timezone dates are shown in; texts carries the message catalogs.
func (*Bridge) Handle ¶
Handle is the single entry point for updates. It only routes: the actual work is queued so the polling loop never blocks on an API call.
Register it with bot.RegisterHandlerMatchFunc and run the bot with bot.WithNotAsyncHandlers, so that updates reach the queue in arrival order.