我正在使用该代码:
import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.JDABuilder;
import net.dv8tion.jda.core.OnlineStatus;
import net.dv8tion.jda.core.entities.Game;
public class Main {
static JDA jda;
public static void main(String[] args) {
JDABuilder jb = new JDABuilder();
jb.setToken("My Bot Token");
jb.setStatus(OnlineStatus.ONLINE);
jb.setGame(Game.playing("Hello"));
//jb.setAutoReconnect(true);
jb.addEventListener(new tl());
try {
jda = jb.build();
System.out.println(jda.getStatus());
} catch (Exception e) {
e.printStackTrace();
}
}
}
和tl.java是:
import net.dv8tion.jda.core.events.ReadyEvent;
import net.dv8tion.jda.core.hooks.ListenerAdapter;
public class tl extends ListenerAdapter {
@Override
public void onReady(ReadyEvent event) {
System.out.println("Finish Loading!");
}
}
如果我使用旧机器人的令牌,那么我什么也没得到。但是,如果我使用新的机器人令牌,则会收到“完成加载!”。是否有一些jda问题?