telegram

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package telegram is the Telegram frontend: it turns updates into core calls and implements core.UI.

Conversations are identified as "<chat id>:<thread id>", so each forum topic is its own conversation. Users are identified by their numeric id.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

func New

func New(cfg *config.Config, c *core.Core, opts ...bot.Option) (*Bot, error)

New creates the bot. Extra options are passed to the Telegram client (tests use them to point it at a fake API server).

func (*Bot) AskApproval

func (b *Bot) AskApproval(conv core.ConvID, id string, p agent.Permission) core.Approval

func (*Bot) Notice

func (b *Bot) Notice(conv core.ConvID, text string)

func (*Bot) Reply

func (b *Bot) Reply(conv core.ConvID, md string)

func (*Bot) Run

func (b *Bot) Run(ctx context.Context)

Run blocks until ctx is cancelled.

func (*Bot) SendFile

func (b *Bot) SendFile(ctx context.Context, conv core.ConvID, path, caption string) error

func (*Bot) SendVoice

func (b *Bot) SendVoice(ctx context.Context, conv core.ConvID, ogg []byte) error

func (*Bot) StartProgress

func (b *Bot) StartProgress(conv core.ConvID) core.Progress

Jump to

Keyboard shortcuts

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