如何解决如何将所有用户移动到 JDA 中的 VoiceChannel 和 DiscordAPI for Minecraft with Java?
几天来我一直在努力解决这个问题..我真的不知道为什么这不起作用。我在网上查了一下我是否遗漏了什么,但据我所知,一切都应该完美无缺。我没有看到任何错误,但机器人只是没有移动任何人。
我使用的 API 位于此处:https://www.spigotmc.org/resources/discord-bot-api-jda.49783/ 在 SPIGOTMC 1.16.5 上运行
我制作的机器人上的所有东西都运行得很好,但这个。
public void MoveUsers(boolean toChannel) {
if(toChannel) {
//Move players to channel and mute them.
for(VoiceChannel vc : bot.getBot().getVoiceChannels()) {
if(vc.getManager() != null) {
for(Member m : vc.getMembers()) {
if(m != null && m.getUser().getIdLong() != 813656916076527688L) {
if(channel != null && m.getGuild() != null)
botMove(m);
}
}
}else {
Main.getInstance().console.sendMessage("...");
}
}
}else {
//Move players out of channel and unmute them.
}
}
public void botMove(Member m) {
Main.getInstance().console.sendMessage(m.getUser().getName());
m.getGuild().getController().moveVoiceMember(m,channel);
}
在botMove中,我打印出我要移动的人的用户名以及所有调用。然而,机器人本身并没有移动用户。有没有人对此有任何解决方案?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。