Files
mautrix-telegram/pkg/gotd/session/tdesktop/tdesktop_example_test.go
T
2025-06-27 20:03:37 -07:00

29 lines
502 B
Go

package tdesktop_test
import (
"fmt"
"os"
"path/filepath"
"go.mau.fi/mautrix-telegram/pkg/gotd/session/tdesktop"
)
func ExampleRead() {
home, err := os.UserHomeDir()
if err != nil {
panic(err)
}
root := filepath.Join(home, "Downloads", "Telegram", "tdata")
accounts, err := tdesktop.Read(root, nil)
if err != nil {
panic(err)
}
for _, account := range accounts {
auth := account.Authorization
cfg := account.Config
fmt.Println(auth.UserID, auth.MainDC, cfg.Environment)
}
}