<commit_before>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;
    }

}
<commit_msg>Optimise resume command<commit_after>package stream.flarebot.flarebot.commands.music;

import com.arsenarsen.lavaplayerbridge.PlayerManager;
import com.arsenarsen.lavaplayerbridge.player.Player;
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.*;
import stream.flarebot.flarebot.objects.GuildWrapper;
import stream.flarebot.flarebot.util.MessageUtils;

public class ResumeCommand implements Command {

    @Override
    public void onCommand(User sender, GuildWrapper guild, TextChannel channel, Message message, String[] args, Member member) {
        Player player = FlareBot.getInstance().getMusicManager().getPlayer(guild.getGuildId());
        if (player.getPlayingTrack() == null) {
            MessageUtils.sendErrorMessage("There is no music playing!", channel);
        } else if (!player.getPaused()) {
            MessageUtils.sendErrorMessage("The music is only playing!", channel);
        } else {
            player.play();
            MessageUtils.sendSuccessMessage("Resuming...!", channel);
        }
    }

    @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;
    }

}

{'fraction_non_alphanumeric': 0.11247318418633159, 'fraction_numerical': 0.002451731535396874, 'mean_word_length': 3.477366255144033, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1465415', 'n_tokens_mistral': 975, 'n_tokens_neox': 931, 'n_words': 187}