telegram

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Direct = direct{}

Direct is a direct proxy: one that makes network connections directly.

Functions

This section is empty.

Types

type ChannelInfo

type ChannelInfo struct {
	ID         int64
	AccessHash int64
	LastMsgID  int64
}

type File

type File struct {
	ID       int64
	Name     string
	Format   file.Format
	Size     int64
	Document *tg.InputDocumentFileLocation
}

File is the file info from the telegram channel.

type Telegram

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

func New

func New(channelID, mobile string, appID int64, appHash string, sessionPath, proxy string) (*Telegram, error)

New will create a telegram client.

func (*Telegram) Authentication

func (t *Telegram) Authentication() error

Authentication is used for log into the telegram with a session support. Every telegram execution will require this method.

func (*Telegram) ChannelInfo

func (t *Telegram) ChannelInfo() (*ChannelInfo, error)

func (*Telegram) DownloadFile

func (t *Telegram) DownloadFile(f *File, writer io.Writer) error

func (*Telegram) ParseMessage

func (t *Telegram) ParseMessage(info *ChannelInfo, msgID int64) ([]File, error)

ParseMessage will parse the given message id.

Jump to

Keyboard shortcuts

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