telegrambot

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 27 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 telegrambot routes allowlisted Telegram messages to regular workers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetUpdates(context.Context, int64, int) ([]telegram.Update, error)
	SendMessage(context.Context, int64, string) (telegram.Message, error)
	SendDocument(context.Context, int64, string, []byte) (
		telegram.Message, error,
	)
	Download(context.Context, string, int64) ([]byte, error)
}

type Engine

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

func New

func New(options Options) (*Engine, error)

func (*Engine) Close

func (e *Engine) Close()

func (*Engine) Handle

func (e *Engine) Handle(ctx context.Context, update telegram.Update) error

Handle admits at most one task per chat. Turns run outside the polling loop.

func (*Engine) NotifyCron

func (e *Engine) NotifyCron(
	ctx context.Context, notification control.CronNotification,
) error

func (*Engine) Run

func (e *Engine) Run(ctx context.Context) error

type Options

type Options struct {
	Client               Client
	Runner               Runner
	Sessions             Sessions
	SessionReader        SessionReader
	Store                *telegramstore.Store
	Policy               config.TelegramPolicy
	Workspace            string
	AgentSpace           string
	Models               []string
	MaxMessageBytes      int
	MaxSystemPromptBytes int
	MaxFileBytes         int64
	MaxImageBytes        int
	MaxImages            int
}

type Runner

type Runner interface {
	Run(context.Context, control.ConversationRequest) (
		*control.ConversationResult, error,
	)
}

type SessionReader

type SessionReader interface {
	Get(context.Context, uuid.UUID) (*models.Session, error)
}

type Sessions

type Sessions interface {
	Open(context.Context, string, string) (control.OpenResult, error)
	ResolveWorkspace(string) (string, error)
	ValidateWorkspaceSession(context.Context, uuid.UUID) error
	ReadWorkspaceFile(context.Context, uuid.UUID, string) (
		control.WorkspaceFileContent, error,
	)
	WriteWorkspaceFile(context.Context, uuid.UUID, string, string, bool) (
		control.WorkspaceFileEntry, error,
	)
}

Jump to

Keyboard shortcuts

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