bridge

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func (b *Bridge) Handle(ctx context.Context, _ *bot.Bot, update *models.Update)

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.

func (*Bridge) Shutdown

func (b *Bridge) Shutdown(ctx context.Context) error

Shutdown waits for the queued updates to finish.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL