tfile

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDownloader added in v0.25.0

func NewDownloader(file TGFile) *downloader.Builder

Types

type TGFile

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

func FromMedia

func FromMedia(media tg.MessageMediaClass, client downloader.Client, opts ...TGFileOptions) (TGFile, error)

func NewTGFile

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

type TGFileMessage

type TGFileMessage interface {
	TGFile
	Message() *tg.Message
}

func FromMediaMessage

func FromMediaMessage(media tg.MessageMediaClass, client downloader.Client, msg *tg.Message, opts ...TGFileOptions) (TGFileMessage, error)

type TGFileOptions

type TGFileOptions func(*tgFile)

func WithMessage

func WithMessage(msg *tg.Message) TGFileOptions

func WithName

func WithName(name string) TGFileOptions

func WithNameIfEmpty

func WithNameIfEmpty(name string) TGFileOptions

func WithSize

func WithSize(size int64) TGFileOptions

func WithSizeIfZero

func WithSizeIfZero(size int64) TGFileOptions

Jump to

Keyboard shortcuts

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