tg

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ClientContinue = false
View Source
const ClientStop = true

Variables

View Source
var (
	TaskQueue = make(chan func() bool, 100)
)

Functions

func GetCode

func GetCode(phone string) (string, error)

func GetFullMediaByte

func GetFullMediaByte(info MediaInfo, sizeType string) ([]byte, error)

func GetMediaByteChunck

func GetMediaByteChunck(info MediaInfo, sizeType string, offsetNum int) ([]byte, error)

func GetStatus

func GetStatus() (bool, error)

func IsClientRunning

func IsClientRunning() bool

func LoginWithCode

func LoginWithCode(phone, code, phoneCodeHash string) error

func RemoveSession

func RemoveSession()

func StartTelegramClient

func StartTelegramClient(appID int, appHash string, address string, auth *proxy.Auth, successChan chan bool) error

Types

type ChatInfo

type ChatInfo struct {
	ID         int64
	AccessHash int64
	Type       string // "channel" or "chat" or "user"
}

func GetChatInfoByID

func GetChatInfoByID(id int64) (*ChatInfo, error)

func GetChatInfoByUsername

func GetChatInfoByUsername(username string) (*ChatInfo, error)

type MediaInfo

type MediaInfo struct {
	MediaType     string // photo, document
	MediaID       int64
	MessageID     int
	AccessHash    int64
	FileReference []byte
	PhotoSizes    []PhotoSizeInfo
	VideoSize     int64
	Date          int
	Duration      float64
}

func GetHistory

func GetHistory(chatType string, id, accessHash int64, offset, limit int) ([]MediaInfo, error)

type PhotoSizeInfo

type PhotoSizeInfo struct {
	SizeType string // s, m, x, y, z, a, b, c, d
	Width    int
	Height   int
	Chunks   []int // increase step by step
}

Jump to

Keyboard shortcuts

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