package de.blackcraze.grb.commands;

import de.blackcraze.grb.core.BotConfig;
import net.dv8tion.jda.core.entities.TextChannel;

import java.util.List;
import java.util.Optional;

public class Speaker {

	public static class Reaction {
		public final static String SUCCESS = "✔";
		public final static String FAILURE = "✖";
	}

	public static void say(List<TextChannel> channels, String text) {
		Optional<TextChannel> optionalChannel = channels.stream()
				.filter(channel -> BotConfig.CHANNEL.equalsIgnoreCase(channel.getName()))
				.findFirst();
		if (!optionalChannel.isPresent()) {
			System.err.printf("No channel found matching name:%s%n", BotConfig.CHANNEL);
			return;
		}
		TextChannel textChannel = optionalChannel.get();
		say(textChannel, text);
	}

	public static void say(TextChannel textChannel, String text) {
		if (!textChannel.canTalk()) {
			System.err.printf("Can not talk in: %s/%s%n", textChannel.getGuild().getName(), textChannel.getName());
		}
		textChannel.sendMessage(text).queue();
	}

}

@@ -34,49 +34,8 @@
 s;%0A%0A
-import de.blackcraze.grb.core.BotConfig;%0A
 impo
@@ -85,59 +85,8 @@
 l;%0A%0A
-import java.util.List;%0Aimport java.util.Optional;%0A%0A
 publ
@@ -233,445 +233,8 @@
 %09%7D%0A%0A
-%09public static void say(List%3CTextChannel%3E channels, String text) %7B%0A%09%09Optional%3CTextChannel%3E optionalChannel = channels.stream()%0A%09%09%09%09.filter(channel -%3E BotConfig.CHANNEL.equalsIgnoreCase(channel.getName()))%0A%09%09%09%09.findFirst();%0A%09%09if (!optionalChannel.isPresent()) %7B%0A%09%09%09System.err.printf(%22No channel found matching name:%25s%25n%22, BotConfig.CHANNEL);%0A%09%09%09return;%0A%09%09%7D%0A%09%09TextChannel textChannel = optionalChannel.get();%0A%09%09say(textChannel, text);%0A%09%7D%0A%0A
 %09pub

Remove old multi-shoot say