sochix / TLSharp

Telegram client library implemented in C#
1k stars 380 forks source link

Code in SMS #828

Open Arbuzzzzzz opened 5 years ago

Arbuzzzzzz commented 5 years ago

Hello! I'm using

var sentCode = await client.SendRequestAsync(new TLRequestSendCode() { PhoneNumber = maskedTextBox1.Text, Flags = 0, <- this flag, to send sms (0, 1 or 5 told in api documentation) ApiId = xxxx, ApiHash = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", } ); to send code via SMS, but code deliveren in Telegramm.

Please, teal me, what I'm doing wrong? Thanks. ;-)

mkellerman commented 5 years ago

This is not TLSharp's implementation. This is caused by Telegram itself.

Please see: https://telegram.org/faq#getting-a-code-via-telegram

If you have recently used one of our apps on another device (it could also be a different app on the same device), we may send the login code via Telegram instead of SMS.