zerobias / telegram-mtproto

Telegram client api (MTProto) library
MIT License
617 stars 136 forks source link

Flood wait! #215

Closed Jerry-swat closed 5 years ago

Jerry-swat commented 5 years ago

When I used auth. sendCode, I didn't respond for a long time, and then I tried to call another method and returned the following warning, stating that I was using version 3.2.11 image

slinker-hiwa commented 5 years ago

Version 3.2.11 is not good, let try telegram-mtproto@3.0.5-unstable, i am using this version. don't have any error. For this error. Maybe you call so much request. Please check your code.

Jerry-swat commented 5 years ago

@slinker-hiwa After I used the telegram-mtproto@3.0.4-unstable version, the problem of auth.sendCode was solved, but auth.signIn filled in the wrong validation code and couldn't catch the error. image image

slinker-hiwa commented 5 years ago
  1. auth.sendCode and auth.signIn must be in the same object MTProto. Without disconnection

  2. dev DC and live is different, so when you config {dev: true}, all API will call to dev DC, your phone didn't register on this DC

So please catch response API auth.sendCode field phone_registered: false or undefined.

if phone_registered = false, use "auth.signUp" instead "auth.signIn" with same params. Have fun.