handler

package
v0.0.0-...-914f9a4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoKeyboard               = errors.New("no keyboard")
	ErrKeyboardHasAlreadyActive = errors.New("keyboard has already active")
)
View Source
var (
	UnknownPhoto *telebot.Photo
	NoPhoto      *telebot.Photo
)
View Source
var CurrentInlineKeywordMark = "✅"
View Source
var ErrDownloadPhotoNotFound = errors.New("download photo not found")
View Source
var ErrInvalidTelegramProxyURL = errors.New("invalid telegram proxy url")

Functions

func CacheAssetsClear

func CacheAssetsClear(ctx telebot.Context) error

func Help

func Help(ctx telebot.Context) error

func Reply

func Reply(ctx telebot.Context, message string) error

func ReplyPhoto

func ReplyPhoto(ctx telebot.Context, message *telebot.Photo) error

func ReportError

func ReportError(ctx telebot.Context, format string, a ...any)

func Respond

func Respond(ctx telebot.Context, resp ...*telebot.CallbackResponse) error

func Send

func Send(ctx telebot.Context, message string) error

func SendPhoto

func SendPhoto(ctx telebot.Context, message *telebot.Photo) error

func Trace

func Trace(ctx telebot.Context) error

func UpdateCurrentInlineKeyboard

func UpdateCurrentInlineKeyboard(sel *telebot.ReplyMarkup, uniq string) error

Types

type Bot

type Bot struct {
	Bot        *telebot.Bot
	AdminIDs   []int64
	AdminUsers []telebot.User
}

func NewBot

func NewBot() (*Bot, error)

type MessageType

type MessageType int
const (
	MessageText MessageType = iota + 1
	MessageEmbed
	MessagePhoto
	MessageCachedPhoto
	MessagePhotoID
)

type PhotoButton

type PhotoButton struct {
	Title       string
	Dir         string
	Name        string
	Message     any
	MessageType MessageType
}

type PhotoResponseHandler

type PhotoResponseHandler struct {
	Buttons        []PhotoButton
	NoPhotoMessage any
}

func (PhotoResponseHandler) Get

func (h PhotoResponseHandler) Get(ctx telebot.Context, relFilePath string) (MessageType, any)

func (PhotoResponseHandler) GetByButton

func (h PhotoResponseHandler) GetByButton(ctx telebot.Context, fb PhotoButton) (MessageType, any)

func (PhotoResponseHandler) Handle

func (h PhotoResponseHandler) Handle(ctx telebot.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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