From 833123a2f4888cd42e34f5fb821de1d4f35c4369 Mon Sep 17 00:00:00 2001 From: waybackarchiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 6 Aug 2021 00:12:07 +0000 Subject: [PATCH 1/2] Fix auth example --- examples/auth/main.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/examples/auth/main.go b/examples/auth/main.go index 350e5fa..321c122 100644 --- a/examples/auth/main.go +++ b/examples/auth/main.go @@ -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{}, ) From 23d76a549c91efb566985bd7740b9eab92eb75a9 Mon Sep 17 00:00:00 2001 From: waybackarchiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 6 Aug 2021 00:12:20 +0000 Subject: [PATCH 2/2] Using test configuration --- examples/auth/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/auth/main.go b/examples/auth/main.go index 321c122..f3fc744 100644 --- a/examples/auth/main.go +++ b/examples/auth/main.go @@ -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