utils

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2025 License: GPL-3.0 Imports: 19 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.MessageSearchResponse, botUsername ...string) []styling.StyledTextOption

func BuildSearchReplyMarkup

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

func ExtraMessageMediaText

func ExtraMessageMediaText(media tg.MessageMediaClass) (string, types.MessageType)

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 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