// Path: src/main/java/commands/model/DofusRequestCommand.java
// public abstract class DofusRequestCommand extends AbstractCommand {
// 
//     protected DofusRequestCommand(String name, String pattern) {
//         super(name, pattern);
//     }
// 
//     protected List<Requestable> getListRequestableFrom(String url, Message message, DiscordException notFound){
//         List<Requestable> result = new ArrayList<>();
//         Language lg = Translator.getLanguageFrom(message.getChannel().block());
//         try {
//             Document doc = JSoupManager.getDocument(url);
//             Elements elems = doc.getElementsByClass("ak-bg-odd");
//             elems.addAll(doc.getElementsByClass("ak-bg-even"));
// 
//             for (Element element : elems)
//                 result.add(new Requestable(element.child(1).text(),
//                         element.child(1).select("a").attr("href")));
// 
//         } catch(IOException e){
//             ExceptionManager.manageIOException(e, message, this, lg, notFound);
//             return new ArrayList<>();
//         }  catch (Exception e) {
//             ExceptionManager.manageException(e, message, this, lg);
//             return new ArrayList<>();
//         }
// 
//         return result;
//     }
// }
// 
// Path: src/main/java/enums/Language.java
// public enum Language {
// 
//     FR("Français", "FR"), EN("English", "EN"), ES("Español", "ES");
// 
//     private String name;
//     private String abrev;
// 
//     Language(String name, String abrev){
//         this.name = name;
//         this.abrev = abrev;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public String getAbrev() {
//         return abrev;
//     }
// 
//     @Override
//     public String toString(){
//         return name;
//     }
// }


import commands.model.DofusRequestCommand;
import discord4j.core.event.domain.message.MessageCreateEvent;
import discord4j.core.object.entity.Message;
import enums.Language;
import exceptions.*;
import util.*;
import data.*;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.Normalizer;
import java.util.regex.Matcher;
package commands.classic;



/**
 * Created by steve on 12/10/2016.
 */
public class SetCommand extends DofusRequestCommand {

    private final static String forName = "text=";
    private DiscordException tooMuchSets;
    private DiscordException notFoundSet;

    public SetCommand(){
        super("set", "\\s+(-more)?(.*)");
        tooMuchSets = new TooMuchDiscordException("set");
        notFoundSet = new NotFoundDiscordException("set");
    }

    @Override
// Path: src/main/java/commands/model/DofusRequestCommand.java
// public abstract class DofusRequestCommand extends AbstractCommand {
// 
//     protected DofusRequestCommand(String name, String pattern) {
//         super(name, pattern);
//     }
// 
//     protected List<Requestable> getListRequestableFrom(String url, Message message, DiscordException notFound){
//         List<Requestable> result = new ArrayList<>();
//         Language lg = Translator.getLanguageFrom(message.getChannel().block());
//         try {
//             Document doc = JSoupManager.getDocument(url);
//             Elements elems = doc.getElementsByClass("ak-bg-odd");
//             elems.addAll(doc.getElementsByClass("ak-bg-even"));
// 
//             for (Element element : elems)
//                 result.add(new Requestable(element.child(1).text(),
//                         element.child(1).select("a").attr("href")));
// 
//         } catch(IOException e){
//             ExceptionManager.manageIOException(e, message, this, lg, notFound);
//             return new ArrayList<>();
//         }  catch (Exception e) {
//             ExceptionManager.manageException(e, message, this, lg);
//             return new ArrayList<>();
//         }
// 
//         return result;
//     }
// }
// 
// Path: src/main/java/enums/Language.java
// public enum Language {
// 
//     FR("Français", "FR"), EN("English", "EN"), ES("Español", "ES");
// 
//     private String name;
//     private String abrev;
// 
//     Language(String name, String abrev){
//         this.name = name;
//         this.abrev = abrev;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public String getAbrev() {
//         return abrev;
//     }
// 
//     @Override
//     public String toString(){
//         return name;
//     }
// }


// Path: src/main/java/commands/classic/SetCommand.java
import commands.model.DofusRequestCommand;
import discord4j.core.event.domain.message.MessageCreateEvent;
import discord4j.core.object.entity.Message;
import enums.Language;
import exceptions.*;
import util.*;
import data.*;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.Normalizer;
import java.util.regex.Matcher;

package commands.classic;



/**
 * Created by steve on 12/10/2016.
 */
public class SetCommand extends DofusRequestCommand {

    private final static String forName = "text=";
    private DiscordException tooMuchSets;
    private DiscordException notFoundSet;

    public SetCommand(){
        super("set", "\\s+(-more)?(.*)");
        tooMuchSets = new TooMuchDiscordException("set");
        notFoundSet = new NotFoundDiscordException("set");
    }

    @Override
    public void request(MessageCreateEvent event, Message message, Matcher m, Language lg) {