go-tdlib icon indicating copy to clipboard operation
go-tdlib copied to clipboard

login with session

Open FunkyYang opened this issue 7 months ago • 3 comments

how to do that

FunkyYang avatar Sep 03 '25 10:09 FunkyYang

not username/password use logined session files replaced

FunkyYang avatar Sep 03 '25 11:09 FunkyYang

or like sessionPath ? I view document and didn't find

type SetTdlibParametersRequest struct {
	request
	// Pass true to use Telegram test environment instead of the production environment
	UseTestDc bool `json:"use_test_dc"`
	// The path to the directory for the persistent database; if empty, the current working directory will be used
	DatabaseDirectory string `json:"database_directory"`
	// The path to the directory for storing files; if empty, database_directory will be used
	FilesDirectory string `json:"files_directory"`
	// Encryption key for the database. If the encryption key is invalid, then an error with code 401 will be returned
	DatabaseEncryptionKey []byte `json:"database_encryption_key"`
	// Pass true to keep information about downloaded and uploaded files between application restarts
	UseFileDatabase bool `json:"use_file_database"`
	// Pass true to keep cache of users, basic groups, supergroups, channels and secret chats between restarts. Implies use_file_database
	UseChatInfoDatabase bool `json:"use_chat_info_database"`
	// Pass true to keep cache of chats and messages between restarts. Implies use_chat_info_database
	UseMessageDatabase bool `json:"use_message_database"`
	// Pass true to enable support for secret chats
	UseSecretChats bool `json:"use_secret_chats"`
	// Application identifier for Telegram API access, which can be obtained at https://my.telegram.org
	ApiId int32 `json:"api_id"`
	// Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org
	ApiHash string `json:"api_hash"`
	// IETF language tag of the user's operating system language; must be non-empty
	SystemLanguageCode string `json:"system_language_code"`
	// Model of the device the application is being run on; must be non-empty
	DeviceModel string `json:"device_model"`
	// Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib
	SystemVersion string `json:"system_version"`
	// Application version; must be non-empty
	ApplicationVersion string `json:"application_version"`
}

FunkyYang avatar Sep 03 '25 13:09 FunkyYang

I copy windows session files to ubuntu and set databaseDirectory

FunkyYang avatar Sep 04 '25 00:09 FunkyYang