package stream.flarebot.flarebot.commands.music;

import com.arsenarsen.lavaplayerbridge.PlayerManager;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.TextChannel;
import net.dv8tion.jda.core.entities.User;
import stream.flarebot.flarebot.FlareBot;
import stream.flarebot.flarebot.commands.Command;
import stream.flarebot.flarebot.commands.CommandType;
import stream.flarebot.flarebot.objects.GuildWrapper;
import stream.flarebot.flarebot.util.MessageUtils;

public class ResumeCommand implements Command {

    private final PlayerManager musicManager = FlareBot.getInstance().getMusicManager();

    @Override
    public void onCommand(User sender, GuildWrapper guild, TextChannel channel, Message message, String[] args, Member member) {
        if (musicManager.getPlayer(channel.getGuild().getId()).getPlayingTrack() == null &&
                (musicManager.getPlayer(channel.getGuild().getId()).getPaused())) {
            MessageUtils.sendErrorMessage("There is no music playing!", channel);
        } else {
            musicManager.getPlayer(channel.getGuild().getId()).play();
            channel.sendMessage("Resuming...!").queue();
        }
    }

    @Override
    public String getCommand() {
        return "resume";
    }

    @Override
    public String getDescription() {
        return "Resumes your playlist";
    }

    @Override
    public String getUsage() {
        return "`{%}resume` - Resumes the playlist.";
    }

    @Override
    public CommandType getType() {
        return CommandType.MUSIC;
    }

}

@@ -93,24 +93,78 @@
 yerManager;%0A
+import com.arsenarsen.lavaplayerbridge.player.Player;%0A
 import net.d
@@ -422,69 +422,9 @@
 nds.
-Command;%0Aimport stream.flarebot.flarebot.commands.CommandType
+*
 ;%0Aim
@@ -580,98 +580,8 @@
  %7B%0A%0A
-    private final PlayerManager musicManager = FlareBot.getInstance().getMusicManager();%0A%0A
     
@@ -731,13 +731,51 @@
     
-if (m
+Player player = FlareBot.getInstance().getM
 usic
@@ -773,32 +773,34 @@
 .getMusicManager
+()
 .getPlayer(chann
@@ -786,39 +786,37 @@
 ger().getPlayer(
-channel
+guild
 .getGuild().getI
@@ -804,35 +804,49 @@
 ild.getGuild
-().getId())
+Id());%0A        if (player
 .getPlayingT
@@ -863,11 +863,11 @@
 null
- &&
+) %7B
 %0A   
@@ -879,63 +879,104 @@
     
-    (musicManager.getPlayer(channel.getGuild().getId())
+MessageUtils.sendErrorMessage(%22There is no music playing!%22, channel);%0A        %7D else if (!player
 .get
@@ -984,17 +984,16 @@
 aused())
-)
  %7B%0A     
@@ -1029,38 +1029,38 @@
 Message(%22The
-re is no music
+ music is only
  playing!%22, 
@@ -1102,91 +1102,59 @@
     
-musicManager.getPlayer(channel.getGuild().getId()).play();%0A            channel.send
+player.play();%0A            MessageUtils.sendSuccess
 Mess
@@ -1175,16 +1175,17 @@
 ..!%22
-).queue(
+, channel
 );%0A 

Optimise resume command