小编Bar*_*ney的帖子

Java电报API RpcCall超时

我对电报API有问题
每当我执行RpcCall时,它都会给我一个TimeoutException,除非我执行NonAuth调用。

我可以使用数字登录,并且在AbsApiState中将Authenticated设置为true,但仍然只能进行NonAuth调用

这是我的代码:

private void startApi() throws Exception
{
    api = new TelegramApi(new MyApiStorage(Moin.config.getProp("useTest").equalsIgnoreCase("true") ? true : false),
            new AppInfo(Moin.api_id, "console", "???", "???", "en"),
            new ApiCallback()
    {

        @Override
        public void onAuthCancelled(TelegramApi arg0) 
        {
            System.out.println("AuthCancelled");
        }

        @Override
        public void onUpdate(TLAbsUpdates update) 
        {
            System.out.println("Updated | " + update.getClass());
        }

        @Override
        public void onUpdatesInvalidated(TelegramApi arg0) 
        {
            System.out.println("Updatefailed");
        }

    });

    TLConfig config = null;
    config = api.doRpcCallNonAuth(new TLRequestHelpGetConfig());

    if(config != null)
        api.getState().updateSettings(config);
    else
        throw new Exception("config is null, could not update DC List"); …
Run Code Online (Sandbox Code Playgroud)

java timeout telegram

5
推荐指数
1
解决办法
2372
查看次数

标签 统计

java ×1

telegram ×1

timeout ×1