// Path: vilebot/src/main/java/com/oldterns/vilebot/util/BaseNick.java
// public class BaseNick
// {
//     // This would grab the leading x out of a nick that actually contains it
//     private static Pattern nickPattern = Pattern.compile( "(?:x|)([a-zA-Z0-9]+)(?:\\p{Punct}+[a-zA-Z0-9]*|)" );
// 
//     private static String primaryBotNick;
// 
//     private static Set<String> allBotNicks = new HashSet<>();
// 
//     public static String toBaseNick( String nick )
//     {
//         if ( allBotNicks.contains( nick ) )
//         {
//             nick = primaryBotNick;
//         }
//         else
//         {
//             Matcher nickMatcher = nickPattern.matcher( nick );
// 
//             if ( nickMatcher.find() )
//             {
//                 return nickMatcher.group( 1 );
//             }
//         }
//         return nick;
//     }
// 
//     public static String getPrimaryBotNick()
//     {
//         return primaryBotNick;
//     }
// 
//     public static void setPrimaryBotNick( String primaryNick )
//     {
//         primaryBotNick = primaryNick;
//     }
// 
//     public static Set<String> getBotNicks()
//     {
//         return allBotNicks;
//     }
// 
//     public static void addBotNick( String nick )
//     {
//         allBotNicks.add( nick );
//     }
// }


import com.oldterns.vilebot.util.BaseNick;
import org.pircbotx.hooks.ListenerAdapter;
import org.pircbotx.hooks.types.GenericMessageEvent;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
package com.oldterns.vilebot.handlers.user;



//@HandlerContainer
public class RemindMe
    extends ListenerAdapter
{

    private static final String timeFormat = "(\\d+\\w*)";

    private static final Pattern remindMePattern = Pattern.compile( "^!remindme (.+) " + timeFormat );

    private final String INVALID_TYPE_ERROR =
        "The time type given is not valid (use d for day, m for month, s for second)";

    private final String NO_TYPE_ERROR = "There was no type given for the time (use d/m/s)";

    private final String TIME_TOO_LARGE_ERROR = "The value of time given is greater than the maximum Integer value";

    private final String TOO_MANY_REMINDERS_ERROR =
        "There is a limit of 10 reminders, please wait until one reminder ends to set a new one.";

    private final String TIME_IS_OKAY = "Given time input is okay";

    private String timeError = TIME_IS_OKAY;

    private static Map<String, Integer> userReminders = new HashMap<>();

    private final int MAX_REMINDERS = 10;

    // @Handler
    @Override
    public void onGenericMessage( GenericMessageEvent event )
    {
        String text = event.getMessage();
        Matcher matcher = remindMePattern.matcher( text );

        if ( matcher.matches() )
        {
            String message = matcher.group( 1 );
            String time = matcher.group( 2 );
// Path: vilebot/src/main/java/com/oldterns/vilebot/util/BaseNick.java
// public class BaseNick
// {
//     // This would grab the leading x out of a nick that actually contains it
//     private static Pattern nickPattern = Pattern.compile( "(?:x|)([a-zA-Z0-9]+)(?:\\p{Punct}+[a-zA-Z0-9]*|)" );
// 
//     private static String primaryBotNick;
// 
//     private static Set<String> allBotNicks = new HashSet<>();
// 
//     public static String toBaseNick( String nick )
//     {
//         if ( allBotNicks.contains( nick ) )
//         {
//             nick = primaryBotNick;
//         }
//         else
//         {
//             Matcher nickMatcher = nickPattern.matcher( nick );
// 
//             if ( nickMatcher.find() )
//             {
//                 return nickMatcher.group( 1 );
//             }
//         }
//         return nick;
//     }
// 
//     public static String getPrimaryBotNick()
//     {
//         return primaryBotNick;
//     }
// 
//     public static void setPrimaryBotNick( String primaryNick )
//     {
//         primaryBotNick = primaryNick;
//     }
// 
//     public static Set<String> getBotNicks()
//     {
//         return allBotNicks;
//     }
// 
//     public static void addBotNick( String nick )
//     {
//         allBotNicks.add( nick );
//     }
// }


// Path: vilebot/src/main/java/com/oldterns/vilebot/handlers/user/RemindMe.java
import com.oldterns.vilebot.util.BaseNick;
import org.pircbotx.hooks.ListenerAdapter;
import org.pircbotx.hooks.types.GenericMessageEvent;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

package com.oldterns.vilebot.handlers.user;



//@HandlerContainer
public class RemindMe
    extends ListenerAdapter
{

    private static final String timeFormat = "(\\d+\\w*)";

    private static final Pattern remindMePattern = Pattern.compile( "^!remindme (.+) " + timeFormat );

    private final String INVALID_TYPE_ERROR =
        "The time type given is not valid (use d for day, m for month, s for second)";

    private final String NO_TYPE_ERROR = "There was no type given for the time (use d/m/s)";

    private final String TIME_TOO_LARGE_ERROR = "The value of time given is greater than the maximum Integer value";

    private final String TOO_MANY_REMINDERS_ERROR =
        "There is a limit of 10 reminders, please wait until one reminder ends to set a new one.";

    private final String TIME_IS_OKAY = "Given time input is okay";

    private String timeError = TIME_IS_OKAY;

    private static Map<String, Integer> userReminders = new HashMap<>();

    private final int MAX_REMINDERS = 10;

    // @Handler
    @Override
    public void onGenericMessage( GenericMessageEvent event )
    {
        String text = event.getMessage();
        Matcher matcher = remindMePattern.matcher( text );

        if ( matcher.matches() )
        {
            String message = matcher.group( 1 );
            String time = matcher.group( 2 );
            String creator = BaseNick.toBaseNick( event.getUser().getNick() );