我使用JDA API为我的服务器创建了一个机器人Discord,但是,当我运行该程序时,我收到了很多错误:
Received a channel for a guild that isn't a text or voice channel. JSON: {"permission_overwrites": /*other*/}
堆栈跟踪:
Encountered an exception:
java.lang.RuntimeException: Got permission_override for unknown channel with id: 361465678508851200
at net.dv8tion.jda.core.entities.EntityBuilder.createGuildChannelPass(EntityBuilder.java:394)
at net.dv8tion.jda.core.entities.EntityBuilder.createGuildFirstPass(EntityBuilder.java:281)
at net.dv8tion.jda.core.handle.GuildCreateHandler.handleInternally(GuildCreateHandler.java:39)
at net.dv8tion.jda.core.handle.SocketHandler.handle(SocketHandler.java:38)
at net.dv8tion.jda.core.requests.WebSocketClient.handleEvent(WebSocketClient.java:770)
at net.dv8tion.jda.core.requests.WebSocketClient.onTextMessage(WebSocketClient.java:500)
at net.dv8tion.jda.core.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:803)
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:368)
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:270)
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:990)
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:749)
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)
我像这样运行我的应用程序:
JDABuilder builder = new JDABuilder(AccountType.BOT);
builder.setToken("Token");
builder.setAutoReconnect(true);
builder.setStatus(OnlineStatus.DO_NOT_DISTURB);
jda = builder.buildBlocking(); //With try and catch block
机器人仍能正常工作,但很奇怪。
答案 0 :(得分:0)
我遵循了一个教程,得到了相同的结果,即频道类别打破了JDA。
我必须查看JDA Github并更改我的pom以匹配最新版本。
将JDA的版本更改为3.3.1_313。这是撰写本文时的最新版本。这应该解决它,因为渠道类别是最新的。如果您不使用maven,只需重新下载jar
即可