🐛 Tout est patché
This commit is contained in:
parent
86600673e9
commit
92b762fdb0
@ -9,6 +9,7 @@ import com.sedmelluq.discord.lavaplayer.track.AudioPlaylist;
|
|||||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||||
import net.dv8tion.jda.api.entities.Guild;
|
import net.dv8tion.jda.api.entities.Guild;
|
||||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||||
|
import net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -39,7 +40,7 @@ public class PlayerManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadAndPlay(TextChannel channel, String url) {
|
public void loadAndPlay(GuildMessageChannel channel, String url) {
|
||||||
final GuildMusicManager musicManager = getMusicManager(channel.getGuild());
|
final GuildMusicManager musicManager = getMusicManager(channel.getGuild());
|
||||||
|
|
||||||
audioPlayerManager.loadItemOrdered(musicManager, url, new AudioLoadResultHandler() {
|
audioPlayerManager.loadItemOrdered(musicManager, url, new AudioLoadResultHandler() {
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package org.camelia.studio.kiss.shot.acerola.commands.utils;
|
package org.camelia.studio.kiss.shot.acerola.commands.utils;
|
||||||
|
|
||||||
import net.dv8tion.jda.api.entities.Guild;
|
|
||||||
import net.dv8tion.jda.api.entities.GuildVoiceState;
|
import net.dv8tion.jda.api.entities.GuildVoiceState;
|
||||||
import net.dv8tion.jda.api.entities.Member;
|
import net.dv8tion.jda.api.entities.Member;
|
||||||
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
|
|
||||||
import net.dv8tion.jda.api.entities.channel.unions.AudioChannelUnion;
|
|
||||||
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
|
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
|
||||||
import net.dv8tion.jda.api.interactions.commands.OptionType;
|
import net.dv8tion.jda.api.interactions.commands.OptionType;
|
||||||
import net.dv8tion.jda.api.interactions.commands.build.OptionData;
|
import net.dv8tion.jda.api.interactions.commands.build.OptionData;
|
||||||
@ -45,12 +42,11 @@ public class PlayAudioCommand implements ISlashCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VoiceChannel channel = voiceState.getChannel().asVoiceChannel();
|
|
||||||
|
|
||||||
AudioManager audioManager = event.getGuild().getAudioManager();
|
AudioManager audioManager = event.getGuild().getAudioManager();
|
||||||
audioManager.openAudioConnection(channel);
|
|
||||||
|
audioManager.openAudioConnection(voiceState.getChannel());
|
||||||
PlayerManager.getInstance().getMusicManager(event.getGuild()).audioPlayer.setVolume(25);
|
PlayerManager.getInstance().getMusicManager(event.getGuild()).audioPlayer.setVolume(25);
|
||||||
PlayerManager.getInstance().loadAndPlay(event.getChannel().asTextChannel(), url);
|
PlayerManager.getInstance().loadAndPlay(event.getChannel().asGuildMessageChannel(), url);
|
||||||
event.getHook().editOriginal("Chargement du fichier audio en cours...").queue();
|
event.getHook().editOriginal("Chargement du fichier audio en cours...").queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user