HandieBot/src/main/java/handiebot/command/commands/music/PlayCommand.java

27 lines
688 B
Java

package handiebot.command.commands.music;
import handiebot.HandieBot;
import handiebot.command.CommandContext;
import handiebot.command.types.ContextCommand;
/**
* @author Andrew Lalis
* Command to play a song from the queue or load a new song.
*/
public class PlayCommand extends ContextCommand {
public PlayCommand() {
super("play");
}
@Override
public void execute(CommandContext context) {
if (context.getArgs() == null || context.getArgs().length == 0){
HandieBot.musicPlayer.playQueue(context.getGuild());
} else {
HandieBot.musicPlayer.loadToQueue(context.getGuild(), context.getArgs()[0]);
}
}
}