Documentation
¶
Index ¶
- Constants
- Variables
- func Connect(...) error
- func ConvertSQLiteSessionToTelethonStringSession(sessionPath string) (string, error)
- func ConvertTDATAToTelethonStringSession(dirname string) (string, error)
- func DeleteProfilePictures(ctx context.Context, client *telegram.Client) error
- func EncodeSessionToTelethonString(sessionData *session.Data) (string, error)
- func GetNewDefaultAuthConversator(phone string, password string) auth.Flow
- func GetSessionString(dc int, addr string, port int, authkey []byte) (string, error)
- func SetProfilePicture(ctx context.Context, client *telegram.Client, file tg.InputFileClass) error
- func UpdateProfile(ctx context.Context, client *telegram.Client, username string, ...) error
- func Windows() telegram.DeviceConfig
- type DefaultAuthConversator
- func (DefaultAuthConversator) AcceptTermsOfService(ctx context.Context, tos tg.HelpTermsOfService) error
- func (k DefaultAuthConversator) Code(ctx context.Context, sentCode *tg.AuthSentCode) (string, error)
- func (k DefaultAuthConversator) Password(ctx context.Context) (string, error)
- func (k DefaultAuthConversator) Phone(_ context.Context) (string, error)
- func (DefaultAuthConversator) SignUp(ctx context.Context) (auth.UserInfo, error)
- type Device
- type Devices
- type MemorySession
- type SQLiteSession
Constants ¶
View Source
const ( TdesktopApiID = 2040 TdesktopApiHash = "b18441a1ff607e10a989891a5462e627" )
Variables ¶
View Source
var (
CodeRequiredError = errors.New("code is required")
)
Functions ¶
func DeleteProfilePictures ¶
DeleteProfilePictures delete all current user profile picture.
func GetSessionString ¶
func SetProfilePicture ¶
SetProfilePicture sets the current user profile picture. Use the `Uploader` struct in `github.com/gotd/td/telegram/uploader`
func UpdateProfile ¶
func UpdateProfile( ctx context.Context, client *telegram.Client, username string, firstName string, lastName string, description string, ) error
UpdateProfile updates common elements of the current user profile, like its username, first name, last name, and description.
func Windows ¶
func Windows() telegram.DeviceConfig
Types ¶
type DefaultAuthConversator ¶
func (DefaultAuthConversator) AcceptTermsOfService ¶
func (DefaultAuthConversator) AcceptTermsOfService(ctx context.Context, tos tg.HelpTermsOfService) error
func (DefaultAuthConversator) Code ¶
func (k DefaultAuthConversator) Code(ctx context.Context, sentCode *tg.AuthSentCode) (string, error)
func (DefaultAuthConversator) Password ¶
func (k DefaultAuthConversator) Password(ctx context.Context) (string, error)
type Devices ¶
type Devices struct {
Tdesktop struct {
ApiID int `json:"api_id"`
ApiHash string `json:"api_hash"`
SystemVersions []string `json:"system_versions"`
LangPack string `json:"lang_pack"`
DeviceModels []string `json:"device_models"`
AppVersion string `json:"app_version"`
LangCode string `json:"lang_code"`
SystemLangCode string `json:"system_lang_code"`
} `json:"tdesktop"`
}
type MemorySession ¶
type MemorySession struct {
// contains filtered or unexported fields
}
MemorySession implements in-memory session storage. Goroutine-safe.
func (*MemorySession) LoadSession ¶
func (s *MemorySession) LoadSession(context.Context) ([]byte, error)
LoadSession loads session from memory.
func (*MemorySession) StoreSession ¶
func (s *MemorySession) StoreSession(ctx context.Context, data []byte) error
StoreSession stores session to memory.
Click to show internal directories.
Click to hide internal directories.