package org.jebot.handler;

import org.jebot.handler.dto.BotMessage;

import java.util.Arrays;
import java.util.List;

public abstract class AbstractHandler {

    public HandlerManager handlerManager;

    public abstract boolean msgHandler(BotMessage message);
    private static List<String> specialChars = Arrays.asList("_", "[", "]", "(", ")", "~", ">", "'", "#", "+", "-", "=", "|", "{", "}", ".", "!");
    public  String strEscape(String value, String... ignore) {
        List<String> ignoreList = Arrays.asList(ignore);

        for (String charToEscape : specialChars) {
            if (!ignoreList.contains(charToEscape)) {
                value = value.replace(charToEscape, "\\" + charToEscape);
            }
        }
        return value;
    }


}
