bot

package
v0.0.0-...-fb31c22 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 20 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	API    *tgbot.Bot
	Client *transmission.TransmissionClient
	Config *config.Config
	Logger *slog.Logger
	// contains filtered or unexported fields
}

Bot manages the Telegram bot and Transmission client interaction.

func New

func New(ctx context.Context, cfg *config.Config, client *transmission.TransmissionClient, logger *slog.Logger) (*Bot, error)

New creates a new Bot instance and performs the Telegram startup calls.

func (*Bot) ChatID

func (b *Bot) ChatID() int64

ChatID returns the current chat ID atomically (used by the notify package).

func (*Bot) Send

func (b *Bot) Send(ctx context.Context, text string, chatID int64, markdown bool) int

Send sends a message to a chat, splitting long messages safely. Returns the message ID of the last sent message.

func (*Bot) SendWithKeyboard

func (b *Bot) SendWithKeyboard(ctx context.Context, text string, chatID int64, markdown bool, markup models.ReplyMarkup) int

SendWithKeyboard sends a message with an optional inline keyboard markup.

func (*Bot) Start

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

Start starts the bot polling loop (blocks until context is cancelled).

Jump to

Keyboard shortcuts

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