0
我正在使用JDA(Java)爲Discord創建一個bot。我試圖讓我的機器人在我的語音通道中播放音樂時遇到問題。JDA setSendingHandler未定義類型公會
的問題是在下面的代碼
public static void startPlaying(net.dv8tion.jda.core.entities.Guild guild) {
//Player player = getMyURLPlayer(guild.getJDA());
FilePlayer player = getMyFilePlayer();
//DiscordBot.bot.getAudioManager(guild).setSendingHandler(player);
guild.setSendingHandler(player);
System.out.println("Player.play is getting executed...");
player.play();
}
在上面的代碼中,以下行是根據不正確的蝕
guild.setSendingHandler(player);
它說
The method setSendingHandler(FilePlayer) is undefined for the type Guild