// Path: src/main/java/de/blackcraze/grb/util/CommandUtils.java
// public static Optional<String> parseStockName(Scanner scanner) {
//     if (!scanner.hasNext()) {
//         return Optional.empty();
//     }
//     StringBuilder stockName = new StringBuilder();
//     stockName.append(scanner.next());
//     while (scanner.hasNext() && !scanner.hasNextLong()) {
//         stockName.append(" ");
//         stockName.append(scanner.next());
//     }
//     return Optional.of(stockName.toString());
// }
// 
// Path: src/main/java/de/blackcraze/grb/util/CommandUtils.java
// public static Locale getResponseLocale(Message message) {
//     Locale channelLocale = getDefaultLocale();
//     Mate mate = getMateDao().getOrCreateMate(message, channelLocale);
//     if (mate != null && !StringUtils.isEmpty(mate.getLanguage())) {
//         return new Locale(mate.getLanguage());
//     }
//     return channelLocale;
// }
// 
// Path: src/main/java/de/blackcraze/grb/util/PrintUtils.java
// public static String prettyPrintStockTypes(List<StockType> stockTypes, Locale responseLocale) {
//     StringBuilder b = new StringBuilder();
//     if (stockTypes.isEmpty()) {
//         b.append(Resource.getError("NO_DATA", responseLocale));
//     }
//     for (StockType type : stockTypes) {
//         String resourceKey = type.getName();
//         String resourceName = Resource.getItem(resourceKey, responseLocale);
//         b.append(resourceName);
//         b.append("\n");
//     }
//     return b.toString();
// }
// 
// Path: src/main/java/de/blackcraze/grb/commands/BaseCommand.java
// public interface BaseCommand {
// 
//     void run(Scanner scanner, Message message);
// 
//     default String help(Message message) {
//         String className = this.getClass().getSimpleName();
//         String key = className.toUpperCase();
//         return Resource.getHelp(key, getResponseLocale(message), BotConfig.getConfig().PREFIX,
//                 "#" + BotConfig.getConfig().CHANNEL);
//     }
// 
//     static void checkPublic(Message message) {
//         if (!ChannelType.TEXT.equals(message.getChannelType())) {
//             Speaker.err(message,
//                     String.format(
//                             Resource.getError("PUBLIC_COMMAND_ONLY", getResponseLocale(message)),
//                             "#" + BotConfig.getConfig().CHANNEL));
//             throw new IllegalStateException("Public command only");
//         }
//     }
// 
//     static Collection<Class<BaseCommand>> getCommandClasses() {
//         ClassPath classPath;
//         try {
//             classPath = ClassPath.from(ClassLoader.getSystemClassLoader());
//         } catch (IOException e) {
//             e.printStackTrace();
//             return Collections.emptyList();
//         }
// 
//         @SuppressWarnings("unchecked")
//         Collection<Class<BaseCommand>> classes =
//                 classPath.getTopLevelClassesRecursive("de.blackcraze.grb.commands").stream()
//                         .map(aClassInfo -> ((Class<BaseCommand>) aClassInfo.load()))
//                         .collect(Collectors.toList());
//         return classes.stream().filter(BaseCommand.class::isAssignableFrom)
//                 .collect(Collectors.toList());
//     }
// }
// 
// Path: src/main/java/de/blackcraze/grb/core/Speaker.java
// public class Speaker {
// 
//     public static class Reaction {
//         public final static String SUCCESS = "✅";
//         public final static String FAILURE = "❌";
//     }
// 
//     public static void say(MessageChannel channel, String text) {
//         say(channel, text, "", "");
//     }
// 
//     public static void say(MessageChannel channel, List<String> texts) {
//         texts.forEach(text -> say(channel, text));
//     }
// 
//     public static void sayCode(MessageChannel channel, List<String> texts) {
//         texts.forEach(text -> sayCode(channel, text));
//     }
// 
//     public static void sayCode(MessageChannel channel, String text) {
//         say(channel, text, "```dsconfig\n", "\n```");
//     }
// 
//     private static void say(MessageChannel channel, String text, String prefix, String suffix) {
//         if (StringUtils.isEmpty(text)) {
//             return;
//         }
//         StringTokenizer t = new StringTokenizer(text, "\n", true);
//         StringBuffer b = new StringBuffer(prefix);
//         b.append(suffix);
//         while (t.hasMoreTokens()) {
//             String token = t.nextToken();
//             if (b.length() + token.length() <= 2000) {
//                 b.insert(b.length() - suffix.length(), token);
//             } else {
//                 channel.sendMessage(b.toString()).queue();
//                 b = new StringBuffer(prefix);
//                 b.append(token);
//                 b.append(suffix);
//             }
//         }
//         channel.sendMessage(b.toString()).queue();
//     }
// 
//     public static void err(Message message, String text) {
//         message.addReaction(Reaction.FAILURE).queue();
//         say(message.getChannel(), text);
//     }
// 
// }


import static de.blackcraze.grb.util.CommandUtils.parseStockName;
import static de.blackcraze.grb.util.CommandUtils.getResponseLocale;
import static de.blackcraze.grb.util.InjectorUtils.getStockTypeDao;
import static de.blackcraze.grb.util.PrintUtils.prettyPrintStockTypes;
import de.blackcraze.grb.commands.BaseCommand;
import de.blackcraze.grb.core.Speaker;
import de.blackcraze.grb.model.entity.StockType;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.Scanner;
import net.dv8tion.jda.api.entities.Message;

package de.blackcraze.grb.commands.concrete;



public class CheckTypes implements BaseCommand {
    public void run(Scanner scanner, Message message) {

// Path: src/main/java/de/blackcraze/grb/util/CommandUtils.java
// public static Optional<String> parseStockName(Scanner scanner) {
//     if (!scanner.hasNext()) {
//         return Optional.empty();
//     }
//     StringBuilder stockName = new StringBuilder();
//     stockName.append(scanner.next());
//     while (scanner.hasNext() && !scanner.hasNextLong()) {
//         stockName.append(" ");
//         stockName.append(scanner.next());
//     }
//     return Optional.of(stockName.toString());
// }
// 
// Path: src/main/java/de/blackcraze/grb/util/CommandUtils.java
// public static Locale getResponseLocale(Message message) {
//     Locale channelLocale = getDefaultLocale();
//     Mate mate = getMateDao().getOrCreateMate(message, channelLocale);
//     if (mate != null && !StringUtils.isEmpty(mate.getLanguage())) {
//         return new Locale(mate.getLanguage());
//     }
//     return channelLocale;
// }
// 
// Path: src/main/java/de/blackcraze/grb/util/PrintUtils.java
// public static String prettyPrintStockTypes(List<StockType> stockTypes, Locale responseLocale) {
//     StringBuilder b = new StringBuilder();
//     if (stockTypes.isEmpty()) {
//         b.append(Resource.getError("NO_DATA", responseLocale));
//     }
//     for (StockType type : stockTypes) {
//         String resourceKey = type.getName();
//         String resourceName = Resource.getItem(resourceKey, responseLocale);
//         b.append(resourceName);
//         b.append("\n");
//     }
//     return b.toString();
// }
// 
// Path: src/main/java/de/blackcraze/grb/commands/BaseCommand.java
// public interface BaseCommand {
// 
//     void run(Scanner scanner, Message message);
// 
//     default String help(Message message) {
//         String className = this.getClass().getSimpleName();
//         String key = className.toUpperCase();
//         return Resource.getHelp(key, getResponseLocale(message), BotConfig.getConfig().PREFIX,
//                 "#" + BotConfig.getConfig().CHANNEL);
//     }
// 
//     static void checkPublic(Message message) {
//         if (!ChannelType.TEXT.equals(message.getChannelType())) {
//             Speaker.err(message,
//                     String.format(
//                             Resource.getError("PUBLIC_COMMAND_ONLY", getResponseLocale(message)),
//                             "#" + BotConfig.getConfig().CHANNEL));
//             throw new IllegalStateException("Public command only");
//         }
//     }
// 
//     static Collection<Class<BaseCommand>> getCommandClasses() {
//         ClassPath classPath;
//         try {
//             classPath = ClassPath.from(ClassLoader.getSystemClassLoader());
//         } catch (IOException e) {
//             e.printStackTrace();
//             return Collections.emptyList();
//         }
// 
//         @SuppressWarnings("unchecked")
//         Collection<Class<BaseCommand>> classes =
//                 classPath.getTopLevelClassesRecursive("de.blackcraze.grb.commands").stream()
//                         .map(aClassInfo -> ((Class<BaseCommand>) aClassInfo.load()))
//                         .collect(Collectors.toList());
//         return classes.stream().filter(BaseCommand.class::isAssignableFrom)
//                 .collect(Collectors.toList());
//     }
// }
// 
// Path: src/main/java/de/blackcraze/grb/core/Speaker.java
// public class Speaker {
// 
//     public static class Reaction {
//         public final static String SUCCESS = "✅";
//         public final static String FAILURE = "❌";
//     }
// 
//     public static void say(MessageChannel channel, String text) {
//         say(channel, text, "", "");
//     }
// 
//     public static void say(MessageChannel channel, List<String> texts) {
//         texts.forEach(text -> say(channel, text));
//     }
// 
//     public static void sayCode(MessageChannel channel, List<String> texts) {
//         texts.forEach(text -> sayCode(channel, text));
//     }
// 
//     public static void sayCode(MessageChannel channel, String text) {
//         say(channel, text, "```dsconfig\n", "\n```");
//     }
// 
//     private static void say(MessageChannel channel, String text, String prefix, String suffix) {
//         if (StringUtils.isEmpty(text)) {
//             return;
//         }
//         StringTokenizer t = new StringTokenizer(text, "\n", true);
//         StringBuffer b = new StringBuffer(prefix);
//         b.append(suffix);
//         while (t.hasMoreTokens()) {
//             String token = t.nextToken();
//             if (b.length() + token.length() <= 2000) {
//                 b.insert(b.length() - suffix.length(), token);
//             } else {
//                 channel.sendMessage(b.toString()).queue();
//                 b = new StringBuffer(prefix);
//                 b.append(token);
//                 b.append(suffix);
//             }
//         }
//         channel.sendMessage(b.toString()).queue();
//     }
// 
//     public static void err(Message message, String text) {
//         message.addReaction(Reaction.FAILURE).queue();
//         say(message.getChannel(), text);
//     }
// 
// }


// Path: src/main/java/de/blackcraze/grb/commands/concrete/CheckTypes.java
import static de.blackcraze.grb.util.CommandUtils.parseStockName;
import static de.blackcraze.grb.util.CommandUtils.getResponseLocale;
import static de.blackcraze.grb.util.InjectorUtils.getStockTypeDao;
import static de.blackcraze.grb.util.PrintUtils.prettyPrintStockTypes;
import de.blackcraze.grb.commands.BaseCommand;
import de.blackcraze.grb.core.Speaker;
import de.blackcraze.grb.model.entity.StockType;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.Scanner;
import net.dv8tion.jda.api.entities.Message;

package de.blackcraze.grb.commands.concrete;



public class CheckTypes implements BaseCommand {
    public void run(Scanner scanner, Message message) {

        Optional<String> stockNameOptional = parseStockName(scanner);
