monitor

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

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

Monitor manages a single Telegram user client that monitors multiple chats for ebook files.

func New

func New(appID int, appHash, sessionPath, downloadDir, convertedDir string) *Monitor

New creates a Monitor from Telegram config and paths.

func (*Monitor) AddChat

func (m *Monitor) AddChat(ctx context.Context, handle string, formats map[string]bool, uploader storage.Uploader) error

AddChat resolves a handle and adds it to the monitored set.

func (*Monitor) Ready

func (m *Monitor) Ready() <-chan struct{}

Ready returns a channel that is closed when the monitor is connected and authenticated. Callers should wait on this before calling AddChat.

func (*Monitor) RemoveChat

func (m *Monitor) RemoveChat(handle string)

RemoveChat removes a handle from the monitored set.

func (*Monitor) Run

func (m *Monitor) Run(ctx context.Context) error

Run connects to Telegram as a user, authenticates if needed, and listens for messages until ctx is cancelled.

Jump to

Keyboard shortcuts

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