Search in sources :

Example 46 with AudioManager

use of net.dv8tion.jda.api.managers.AudioManager in project radio by toadless.

the class GuildMusicManager method leave.

public void leave(@NotNull Guild guild) {
    AudioManager manager = guild.getAudioManager();
    manager.closeAudioConnection();
}
Also used : AudioManager(net.dv8tion.jda.api.managers.AudioManager)

Example 47 with AudioManager

use of net.dv8tion.jda.api.managers.AudioManager in project radio by toadless.

the class GuildMusicManager method playAll.

public void playAll(VoiceChannel channel, List<AudioTrack> tracks, User user) {
    AudioManager manager = channel.getGuild().getAudioManager();
    manager.openAudioConnection(channel);
    tracks.forEach(track -> scheduler.queue(track, user));
    player.setVolume(volume);
}
Also used : AudioManager(net.dv8tion.jda.api.managers.AudioManager)

Example 48 with AudioManager

use of net.dv8tion.jda.api.managers.AudioManager in project radio by toadless.

the class GuildMusicManager method play.

public void play(VoiceChannel channel, AudioTrack track, User user) {
    AudioManager manager = channel.getGuild().getAudioManager();
    manager.openAudioConnection(channel);
    scheduler.queue(track, user);
    player.setVolume(volume);
}
Also used : AudioManager(net.dv8tion.jda.api.managers.AudioManager)

Aggregations

AudioManager (net.dv8tion.jda.api.managers.AudioManager)48 GuildVoiceState (net.dv8tion.jda.api.entities.GuildVoiceState)12 Member (net.dv8tion.jda.api.entities.Member)10 EmbedBuilder (net.dv8tion.jda.api.EmbedBuilder)9 Guild (net.dv8tion.jda.api.entities.Guild)9 List (java.util.List)8 VoiceChannel (net.dv8tion.jda.api.entities.VoiceChannel)8 Logger (org.slf4j.Logger)7 LoggerFactory (org.slf4j.LoggerFactory)7 AudioPlayer (com.sedmelluq.discord.lavaplayer.player.AudioPlayer)5 EventWaiter (com.jagrosh.jdautilities.commons.waiter.EventWaiter)4 Nonnull (javax.annotation.Nonnull)4 GuildMusicManager (me.fero.ascent.lavaplayer.GuildMusicManager)4 Permission (net.dv8tion.jda.api.Permission)4 ArrayList (java.util.ArrayList)3 Collections (java.util.Collections)3 Consumer (java.util.function.Consumer)3 Collectors (java.util.stream.Collectors)3 net.dv8tion.jda.api.entities (net.dv8tion.jda.api.entities)3 OptionMapping (net.dv8tion.jda.api.interactions.commands.OptionMapping)3