telegram

package
v0.0.0-...-6886eff Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowedChats

func AllowedChats(ids []int64) tb.MiddlewareFunc

func LogErrors

func LogErrors(log *slog.Logger) tb.MiddlewareFunc

func Recover

func Recover(log *slog.Logger) tb.MiddlewareFunc

Types

type Bot

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

func NewBot

func NewBot(token string, repo dal.Repository, log *slog.Logger, middlewares ...tb.MiddlewareFunc) (*Bot, error)

func (*Bot) HandleCallback

func (b *Bot) HandleCallback(c tb.Context) error

func (*Bot) HandleRandom

func (b *Bot) HandleRandom(m tb.Context) error

func (*Bot) HandleStart

func (b *Bot) HandleStart(m tb.Context) error

func (*Bot) HandleStats

func (b *Bot) HandleStats(m tb.Context) error

func (*Bot) SendWordCheck

func (b *Bot) SendWordCheck(ctx context.Context, chatID int64) error

func (*Bot) Start

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

type Client

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

func NewClient

func NewClient(token string, log *slog.Logger) *Client

func (*Client) AskAuthConfirmation

func (c *Client) AskAuthConfirmation(ctx context.Context, chatID int64, token string) error

type InlineKeyboardButton

type InlineKeyboardButton struct {
	Text         string `json:"text"`
	CallbackData string `json:"callback_data,omitempty"`
}

type InlineKeyboardMarkup

type InlineKeyboardMarkup struct {
	InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
}

type Response

type Response struct {
	OK     bool `json:"ok"`
	Result struct {
		MessageID int `json:"message_id"`
	} `json:"result"`
}

type SendMessageRequest

type SendMessageRequest struct {
	ChatID      int64                `json:"chat_id"`
	Text        string               `json:"text"`
	ReplyMarkup InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}

Jump to

Keyboard shortcuts

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