bot

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 19 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 bot runs snagbox's Telegram intake bot: allowlisted users send text and photos, which become inbox issues that can be tagged to a project via inline buttons.

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
}

Bot is the Telegram intake bot. It turns allowlisted users' messages into inbox issues and offers inline buttons to tag them to a project.

func New

func New(cfg config.Config, st *store.Store, bl *blob.Store, loginSvc LoginLinkService, logger *slog.Logger) (*Bot, error)

New builds a Bot, wiring the Telegram client, its handlers and the album buffer. loginSvc may be nil to disable the /login dashboard flow. It does not start polling; call Start for that.

func (*Bot) Client

func (b *Bot) Client() *tgbot.Bot

Client returns the underlying Telegram client.

func (*Bot) SendText

func (b *Bot) SendText(ctx context.Context, chatID int64, text string) error

SendText sends a plain-text message to a chat, used by the daily digest.

func (*Bot) Start

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

Start records the base context for background flush timers and blocks polling Telegram until ctx is canceled.

type LoginLinkService

type LoginLinkService interface {
	CreateLoginLink(ctx context.Context, in authkit.CreateLoginLinkInput) (authkit.CreateLoginLinkOutput, error)
}

LoginLinkService issues bot-first login links for the admin dashboard. It is satisfied by *authkit.AuthService and may be nil when login is disabled.

Jump to

Keyboard shortcuts

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