app

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.1.0"

Variables

This section is empty.

Functions

func EnsureAuth

func EnsureAuth(ctx context.Context, client *telegram.Client, phone string) error

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is the top-level orchestrator.

func New

func New(cfg *config.Config) (*App, error)

func (*App) GetI18n

func (a *App) GetI18n() *i18n.Manager

GetI18n returns the i18n manager.

func (*App) GetPluginLoader

func (a *App) GetPluginLoader() *loader.Loader

GetPluginLoader returns the external plugin loader.

func (*App) Run

func (a *App) Run(ctx context.Context) error

Run connects, authenticates, loads plugins, and blocks until ctx is cancelled.

func (*App) Shutdown

func (a *App) Shutdown(ctx context.Context) error

Shutdown gracefully stops the app.

type TerminalAuth

type TerminalAuth struct {
	// contains filtered or unexported fields
}

TerminalAuth implements auth.UserAuthenticator with env-var fallback for non-interactive environments (containers, CI, automated installs).

func (TerminalAuth) AcceptTermsOfService

func (a TerminalAuth) AcceptTermsOfService(_ context.Context, tos tg.HelpTermsOfService) error

func (TerminalAuth) Code

func (TerminalAuth) Password

func (a TerminalAuth) Password(_ context.Context) (string, error)

func (TerminalAuth) Phone

func (a TerminalAuth) Phone(_ context.Context) (string, error)

func (TerminalAuth) SignUp

func (a TerminalAuth) SignUp(_ context.Context) (auth.UserInfo, error)

type UpdateHandler

type UpdateHandler struct {
	// contains filtered or unexported fields
}

UpdateHandler processes Telegram updates and emits events.

func NewUpdateHandler

func NewUpdateHandler(bus *eventbus.Bus) *UpdateHandler

func (*UpdateHandler) Handle

func (h *UpdateHandler) Handle(ctx context.Context, u tg.UpdatesClass) error

func (*UpdateHandler) SetSelfUserID

func (h *UpdateHandler) SetSelfUserID(id int64)

Jump to

Keyboard shortcuts

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