zerobias / telegram-mtproto

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

Confusion about which telegram-mtproto version to use? #167

Closed kessnerch closed 5 years ago

kessnerch commented 6 years ago

Hi there!

Quick question - I do have several problems with telegram-mtproto.
I built myself a shell client based on the blessed ui library, but for some reason I have various different results using the lib. 
I started to using the mtproto-fs-storage module to keep auth requests low, everything works fine with the telegram-mtproto@alpha (i guess, version 2.2.2) on the dev mode server, but as soon as I go to the productive server I do get various problems regarding FLOOD_WAIT and being banned after a couple of minutes for 24h. I even added a couple of wait and sleep methods between each of the mtproto calls (+ I only issue one after the other to ensure that I am not flooding the server), still, getting banned regulary. 
With the mtproto3 I was not able to login at all to the productive server.

Now this poses the question:
Which mtproto version should we (as developers) use and develop against for now? I know v3 is comming whenever it is stable enough to work with, but does the v2 have such grave bugs that causes me to lose connection with the productive server?

Version     Problem       
1           not working  
2(.2.2)     working, but getting banned after some minutes 
3           cannot login

Thanks, and sorry if I may be rumbling.
- Christian
goodmind commented 6 years ago

try 3.1.3

kessnerch commented 6 years ago

Sadly no success. Maybe I am doing something wrong? I added a little test.js, which basically checks if the user is still authed by either calling getWallpapers or account.authorizations.

Gist: https://gist.github.com/kessnerch/9d661a368e483b768d9bfffd25c2482f

Expected result: a error to catch Result: nothing, totally dead after the key exchange.

Also there is no way I could wait until the key exchange finished, that's why I used a async / await sleep function.

Package.json:

  "dependencies": {
    "blessed": "^0.1.81",
    "i18n": "^0.8.3",
    "mtproto-storage-fs": "^0.3.1",
    "npm": "^5.8.0",
    "telegram-mt-node": "^0.9.7",
    "telegram-mtproto": "^3.1.3",
    "webpack": "^4.6.0"
  }
KylinWu commented 6 years ago

Same issue here. In my case: version 2.2.2 It can login with both production server and dev server. version 3.1.3 It can only login with dev server. version 3.2.11 It can NOT login with both servers.

iceflash commented 6 years ago

In my case too. Currently use 2.x version? but have some bug: MT[406] NETWORK_BAD_REQUEST unhandled rejection

alirezafarvardin commented 6 years ago

Hi. Which on is the OFFICIAL Telegram MTProto version? I see several distribiotion of MTProto on the GitHub. Please send me official link.

goodmind commented 6 years ago

@venusbahar https://github.com/tdlib/td