Documentation
¶
Index ¶
Constants ¶
const Version = "0.1.3"
Variables ¶
var ErrNotLoggedIn = errors.New("not logged in")
ErrNotLoggedIn means the session is not authorized and no headless credentials were supplied; the user should run `<cmd> initialize`.
Functions ¶
func BotOptions ¶ added in v0.1.1
BotOptions derives the companion bot settings from cfg. initialize uses it too, so its login lands in the session file run reads.
func EnsureAuth ¶
EnsureAuth returns nil when the session is authorized, logs in headlessly when PAPERVALET_PHONE is set, and returns ErrNotLoggedIn otherwise.
func NewTelegramClient ¶ added in v0.1.1
NewTelegramClient builds the gotd client with PaperValet's device info. initialize uses it too, so the login session matches what run expects.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the top-level orchestrator.
func (*App) GetPluginLoader ¶
GetPluginLoader returns the external plugin loader.
func (*App) SetConfigPath ¶ added in v0.1.1
SetConfigPath tells the backup plugin which config file to include.
type PeerRegistry ¶ added in v0.1.1
PeerRegistry receives access hashes harvested from updates.
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) SetPeerRegistry ¶ added in v0.1.1
func (h *UpdateHandler) SetPeerRegistry(r PeerRegistry)
SetPeerRegistry wires the cache that learns access hashes from updates. Without it, replies in channels and supergroups fail with CHANNEL_INVALID.
func (*UpdateHandler) SetSelfUserID ¶
func (h *UpdateHandler) SetSelfUserID(id int64)