package de.yannicpunktdee.yoshibot.command.commands;

import de.yannicpunktdee.yoshibot.command.YoshiCommand;
import de.yannicpunktdee.yoshibot.command.YoshiCommandContext;
import de.yannicpunktdee.yoshibot.main.YoshiBot;
import net.dv8tion.jda.api.entities.VoiceChannel;

public class SayCommand extends YoshiCommand {
	
	
	protected final String[] requiredArguments = {"text", "channel"};
	
	
	public SayCommand(YoshiCommandContext context) {
		super(context);
	}
	
	@Override
	public boolean execute() {
		if (!super.execute()) return false;
		context.getEvent().getMessage().getTextChannel().sendMessage(
				"Danke, " + context.getEvent().getMessage().getAuthor().getName() + ". Ich werde nun " +
				"abspielen:\n" + context.getArgument("text")).queue();
		return YoshiBot.getInstance().sayTTS(context.getArgument("text"), getVoiceChannelByParam());
	}
	
}
