我使用 Telegram API 的官方 Java 库:https ://github.com/ex3ndr/telegram-api对于测试,我使用来自 Telegram Bot 的代码:https ://github.com/ex3ndr/telegram-bot
有问题。当我尝试授权时,库会引发以下异常:
Use test DC? (write test for test servers): yes
Using production servers
Loading fresh DC list...Exception in thread "Connection#2026789660" java.lang.RuntimeException: Unknown dispatcherId 'connection'
at com.droidkit.actors.ActorSystem.actorOf(ActorSystem.java:121)
at com.droidkit.actors.ActorSystem.actorOf(ActorSystem.java:93)
at org.telegram.mtproto.transport.TransportTcpPool.<init>(TransportTcpPool.java:62)
at org.telegram.mtproto.MTProto.<init>(MTProto.java:116)
at org.telegram.api.engine.TelegramApi$ConnectionThread.waitForDc(TelegramApi.java:895)
at org.telegram.api.engine.TelegramApi$ConnectionThread.run(TelegramApi.java:946)
Exception in thread "main" org.telegram.api.engine.TimeoutException
at org.telegram.api.engine.TelegramApi.doRpcCall(TelegramApi.java:364)
at org.telegram.api.engine.TelegramApi.doRpcCallNonAuth(TelegramApi.java:428)
at org.telegram.api.engine.TelegramApi.doRpcCallNonAuth(TelegramApi.java:420)
at org.telegram.bot.Application.login(Application.java:380)
at org.telegram.bot.Application.main(Application.java:40)
我google了一下,发现这是一个常见的老问题。所以有一个问题 - 我可以将这个库用于我使用 Telegram 的应用程序吗?也许有人找到了修复这个库的方法?