Missing files in last commit
This commit is contained in:
1 parent
15497a09ab
commit
66957f0eeb
2 files changed
+19
-9
No files matched your search
@@ -14,9 +14,7 @@ import com.sedmelluq.discord.lavaplayer.source.AudioSourceManagers;
|
||||
import com.sedmelluq.discord.lavaplayer.tools.FriendlyException;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioPlaylist;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.entities.VoiceChannel;
|
||||
import net.dv8tion.jda.core.entities.*;
|
||||
import netneutrality.MusicBot;
|
||||
import netneutrality.handler.LogHandler;
|
||||
import netneutrality.utils.MessageFunction;
|
||||
@@ -85,6 +83,8 @@ public class MusicManager {
|
||||
stopMusic();
|
||||
}
|
||||
|
||||
scheduler.resetTopic();
|
||||
|
||||
Guild guild = MusicBot.getJDA().getGuildById(guildId);
|
||||
if (guild != null) {
|
||||
guild.getAudioManager().closeAudioConnection();
|
||||
@@ -93,9 +93,7 @@ public class MusicManager {
|
||||
}
|
||||
|
||||
public synchronized void stopMusic() {
|
||||
if (scheduler.getTextChannel() != null)
|
||||
scheduler.getTextChannel().getManager().setTopic(scheduler.topic).queue();
|
||||
|
||||
scheduler.resetTopic();
|
||||
player.destroy();
|
||||
}
|
||||
|
||||
@@ -105,7 +103,7 @@ public class MusicManager {
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void play(String url, TextChannel channel, boolean silent ) {
|
||||
public synchronized void play(String url, TextChannel channel, Member user, boolean silent ) {
|
||||
|
||||
String identifier = SourceFinder.getIdentifier(url, channel);
|
||||
System.out.println(identifier);
|
||||
@@ -116,7 +114,7 @@ public class MusicManager {
|
||||
@Override
|
||||
public void trackLoaded(AudioTrack audioTrack) {
|
||||
if (!silent)
|
||||
channel.sendMessage(MessageFunction.buildAddingTrackMessage(audioTrack)).queue();
|
||||
channel.sendMessage(MessageFunction.buildAddingTrackMessage(audioTrack, user)).queue();
|
||||
|
||||
|
||||
scheduler.queue(audioTrack);
|
||||
|
||||
@@ -41,13 +41,25 @@ public class TrackScheduler extends AudioEventAdapter {
|
||||
|
||||
public void setTextChannel(TextChannel channel) {
|
||||
this.channel = channel;
|
||||
topic = channel.getTopic();
|
||||
|
||||
if (this.topic == null) {
|
||||
this.topic = channel.getTopic();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public TextChannel getTextChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void resetTopic() {
|
||||
if (this.channel != null) {
|
||||
this.channel.getManager().setTopic(this.topic).queue();
|
||||
}
|
||||
|
||||
this.topic = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the next track, stopping the current one if it is playing.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user