3bl3gamer / tgclient

Telegram (mtproto) client written in golang
MIT License
19 stars 5 forks source link

Can't sign in on Windows #25

Open Layerex opened 5 months ago

Layerex commented 5 months ago

Code used to sign in

Error:

panic: interface conversion: mtproto.TL is mtproto.TL_bad_msg_notification, not mtproto.VectorObject

goroutine 1 [running]:
main.(*Telegram).SignIn(0xc0000d2000, 0x43c5, {0xc4fb06, 0x20}, {0xc000036400, 0x3c})
        C:/Users/xd/Downloads/telegram-export-gifs-master/client.go:55 +0x326
main.main()
        C:/Users/xd/Downloads/telegram-export-gifs-master/main.go:102 +0xfe

No output, besides error.

On Linux, works perfectly.

3bl3gamer commented 3 months ago

I've tried to run the gif exporter twice in a row and got these errors:

$ ./telegram-export-gifs.exe
Enter phone number: 123...
Enter code: panic: RPC: mtproto.TL_rpc_error{ErrorCode:400, ErrorMessage:"PHONE_CODE_INVALID"}

<stack>

$ ./telegram-export-gifs.exe
panic: interface conversion: mtproto.TL is mtproto.TL_bad_msg_notification, not mtproto.VectorObject

<stack>

Looks like the actual problem is in outdated ScanfAuthDataProvider which reads empty confirmation code and fails on Windows. This was fixed in v0.143.1 and your tool uses v0.138.2.

The TL_bad_msg_notification error is known but rare. It sometimes occurs after interrupted authorization, is platform independent and goes away after client reconnection.