Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix impossible to auth #65 #107

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion examples/auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {
// where to store session configuration. must be set
SessionFile: sessionFile,
// host address of mtproto server. Actually, it can be any mtproxy, not only official
ServerHost: "149.154.167.50:443",
ServerHost: "149.154.167.40:443",
// public keys file is path to file with public keys, which you must get from https://my.telegram.org
PublicKeysFile: publicKeys,
AppID: 94575, // app id, could be find at https://my.telegram.org
Expand All @@ -56,6 +56,19 @@ func main() {
os.Exit(0)
}

resp, err := client.InvokeWithLayer(telegram.ApiVersion, &telegram.InitConnectionParams{
ApiID: 94575,
DeviceModel: "Unknown",
SystemVersion: "linux/amd64",
AppVersion: "0.1.0",
// just use "en", any other language codes will receive error. See telegram docs for more info.
SystemLangCode: "en",
LangCode: "en",
// HelpGetConfig() is ACTUAL request, but wrapped in InvokeWithLayer
Query: &telegram.HelpGetConfigParams{},
})
fmt.Println(resp)

setCode, err := client.AuthSendCode(
phoneNumber, 94575, "a3406de8d171bb422bb6ddf3bbd800e2", &telegram.CodeSettings{},
)
Expand Down