英文:
Discord Bot connected to Websocket but not finished loading
问题
我正在开发一个类似于Discord机器人的项目,已经进行了2周的时间,一直没有出现问题...
但是现在,当我尝试启动机器人时,只显示如下内容:
1314 [主线程] 信息 net.dv8tion.jda.api.sharding.ShardManager - 登录成功!
2326 [JDA [0 / 1] MainWS-ReadThread] 信息 net.dv8tion.jda.internal.requests.WebSocketClient - 已连接到WebSocket
通常还会有至少一行类似于“加载完成”的内容,但现在这个信息不再显示了... 但我不知道为什么。
机器人已经在线,但是没有任何功能可用(命令等)。
英文:
I am working on a discord bot like for 2 weeks and all the time there were no problems...
but now when i was starting the bot, there is just standing this:
1314 [main] INFO net.dv8tion.jda.api.sharding.ShardManager - Login Successful!
2326 [JDA [0 / 1] MainWS-ReadThread] INFO net.dv8tion.jda.internal.requests.WebSocketClient - Connected to WebSocket
but normally there is at least one more line with something like "finished loading" and this is not there anymore... but i dont know why
The Bot is online but nothin works (commands, etc.)
答案1
得分: 2
new JDABuilder()
构造函数已被 JDA 弃用。
因此,您需要使用 createDefault()
、createLight()
或 create()
方法来代替 new JDABuilder()
。
英文:
The new JDABuilder()
constructor has deprecated by JDA.
So you need to use createDefault()
, createLight()
, or create()
methods instead of new JDABuilder()
.
答案2
得分: 0
正如Fasmos所说,您需要使用JDA = JDABuilder.createDefault("YOUR TOKEN").build();
而不是new JDABuilder
,只需添加令牌,无需其他任何内容
英文:
As Fasmos said, You will need to use JDA = JDABuilder.createDefault("YOUR TOKEN").build();
Instead of new JDABuilder
, Just adding that you must add the token, nothing else
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论