bot

package
v0.0.0-...-32dd017 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

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(l logger.Logger, botToken string) (*Bot, error)

func (*Bot) API

func (b *Bot) API() *telego.Bot

Api returns the underlying telego Bot instance.

func (*Bot) AnswerCallbackQuery

func (b *Bot) AnswerCallbackQuery(ctx context.Context, callbackQueryID string, text string) error

AnswerCallbackQuery answers a callback query.

func (*Bot) DownloadFile

func (b *Bot) DownloadFile(ctx context.Context, fileID string) ([]byte, error)

DownloadFile downloads a file from Telegram by file ID and returns its bytes.

func (*Bot) EditMessageText

func (b *Bot) EditMessageText(ctx context.Context, chatID int64, messageID int, text string, buttons [][]telego.InlineKeyboardButton) error

EditMessageText edits the text of a message.

func (*Bot) Name

func (b *Bot) Name() string

Name returns the service name.

func (*Bot) OnUpdate

func (b *Bot) OnUpdate() <-chan telego.Update

OnUpdate registers a handler for incoming updates.

func (*Bot) SendChatAction

func (b *Bot) SendChatAction(ctx context.Context, chatID int64, action string) error

SendChatAction sends a chat action (e.g. "typing") to indicate the bot is processing.

func (*Bot) SendMessage

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

SendMessage sends a message to a chat. It tries Markdown parse mode first; on parse error it falls back to plain text.

func (*Bot) SendMessageWithButtons

func (b *Bot) SendMessageWithButtons(ctx context.Context, chatID int64, text string, buttons [][]telego.InlineKeyboardButton) error

SendMessageWithButtons sends a message with inline keyboard buttons.

func (*Bot) Start

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

Start starts the bot.

func (*Bot) Stop

func (b *Bot) Stop(ctx context.Context) error

Stop stops the bot.

Jump to

Keyboard shortcuts

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