utils

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildResultStyling

func BuildResultStyling(ctx context.Context, resp *types.SearchResponse, botUsername ...string) []styling.StyledTextOption

func BuildSearchReplyMarkup

func BuildSearchReplyMarkup(ctx context.Context, currentPage int64, data types.SearchRequest) (*tg.ReplyInlineMarkup, error)

func GetChatDBFromUpdateArgs

func GetChatDBFromUpdateArgs(ctx *ext.Context, update *ext.Update) (*database.IndexChat, error)

func GetMessageByID added in v0.12.0

func GetMessageByID(ctx *ext.Context, chatID int64, msgID int) (*tg.Message, error)

func GetUpdateChatID added in v0.8.0

func GetUpdateChatID(u *ext.Update) int64

func GetUpdatePeerUser added in v0.8.0

func GetUpdatePeerUser(u *ext.Update) *tg.PeerUser

func MD5Hash

func MD5Hash(str string) string

func NewDownloader added in v0.12.0

func NewDownloader(file TGFile) *downloader.Builder

Types

type MessageMediaExtractResult added in v1.0.0

type MessageMediaExtractResult struct {
	Text  string
	Ocred string
	Type  types.MessageType
}

func ExtractMessageMediaText added in v0.17.1

func ExtractMessageMediaText(ctx context.Context, client *ext.Context, media tg.MessageMediaClass, enableOcr bool) *MessageMediaExtractResult

type TGFile added in v0.12.0

type TGFile interface {
	Location() tg.InputFileLocationClass
	Client() downloader.Client // witch client to use for downloading
	Size() int64
	Name() string
}

func FileFromMedia added in v0.12.0

func FileFromMedia(media tg.MessageMediaClass, client downloader.Client) (TGFile, error)

func NewTGFile added in v0.12.0

func NewTGFile(
	location tg.InputFileLocationClass,
	client downloader.Client,
	size int64,
	name string,
) TGFile

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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