OpenTl / OpenTl.ClientApi

The Api client library that implements the MtProto 2.0. To connect to servers, such as Telegram
MIT License
80 stars 22 forks source link

not working #31

Closed komailghasemi closed 5 years ago

komailghasemi commented 5 years ago

i copied this code in my C# program 👇👇👇

var settings = new FactorySettings
{
                AppHash = "49dcbd65b7929a909e4dc955307be7c8",
                AppId = 193693,
                ServerAddress = "185.213.165.19",
                ServerPublicKey = "b0cbcef5a486d9636472ac27f8e11a9d", 
                ServerPort = 443,
                SessionTag = "session", 
                Properties = new ApplicationProperties() 
            };

            clientApi = await ClientFactory.BuildClientAsync(settings);

            if (!clientApi.AuthService.CurrentUserId.HasValue)
            {

                var phone = txtNumber.Text;
                var sentCode = await clientApi.AuthService.SendCodeAsync(phone);
            }

But didnt send telegrams code to me !!!

djonasdev commented 5 years ago

ServerPublicKey seems to be in wrong format! PhoneNumber must start with a leading +. For example +49 for germany

komailghasemi commented 5 years ago

ServerPublicKey seems to be in wrong format! PhoneNumber must start with a leading +. For example +49 for germany

i know about number but about ServerPublicKey ServerPublicKey is not mtproto secret key ????

djonasdev commented 5 years ago

You get the ServerPublicKey from https://my.telegram.org/apps

See: https://github.com/OpenTl/OpenTl.ClientApi/wiki/Quick-Start

komailghasemi commented 5 years ago

You get the ServerPublicKey from https://my.telegram.org/apps

See: https://github.com/OpenTl/OpenTl.ClientApi/wiki/Quick-Start

oh oh yea ... thx alot im going to test it ❤❤❤

komailghasemi commented 5 years ago

You get the ServerPublicKey from https://my.telegram.org/apps

See: https://github.com/OpenTl/OpenTl.ClientApi/wiki/Quick-Start

            var settings = new FactorySettings
            {
                AppHash = "731...2411417",
                AppId = 1...2,
                ServerAddress = "167.99.44.8",
                ServerPublicKey = @"MIIBCgKCAQEAwVACPi9w23mF3tBkdZz.......SIXklHwIDAQAB",
                ServerPort = 80,
                SessionTag = "session", 
                Properties = new ApplicationProperties() 
            };
            clientApi = await ClientFactory.BuildClientAsync(settings);
            if (!clientApi.AuthService.CurrentUserId.HasValue)
            {
                var phone = txtNumber.Text; 
                var sentCode = await clientApi.AuthService.SendCodeAsync(phone);
            }

not working :((

didnt send me the code

komailghasemi commented 5 years ago

i wanna use mtproto proxy in my client how can i use it with this library ?????

emreordukaya commented 5 years ago

why did ou close. if u can use, can u write clean code here please?