package com.github.NewsBotIRC;
import com.rometools.rome.io.FeedException;
import org.pircbotx.hooks.ListenerAdapter;
import org.pircbotx.hooks.types.GenericMessageEvent;

import java.io.IOException;
import java.net.MalformedURLException;

/*
 *  Written by Geronimo Poppino
 *  Organization and code enhancement by Gerardo Canosa.
 */
public class IRCListener extends ListenerAdapter
{
    private IRCMediator mediator;

    public IRCListener(IRCMediator mediator)
    {
        this.mediator = mediator;
    }

    @Override
    public void onGenericMessage(GenericMessageEvent event)
    {
        if (event.getMessage().startsWith("?version")) {
            event.respond("NewsBot v0.1 by Gerardo Canosa and Geronimo Poppino!");
        } else if (event.getMessage().startsWith("?list")) {
            try {
                this.mediator.showMessage("--> BEGIN: My Feeds Are...");
                this.mediator.listFeeds();
                this.mediator.showMessage("--> END");
            } catch (IOException | FeedException e) {
                System.out.println(e.getMessage());
            }
        } else if (event.getMessage().startsWith("?add")) {
            try {
                this.mediator.addFeed( event.getMessage().substring( event.getMessage().indexOf("http") ) );
            } catch (MalformedURLException e) {
                System.out.println(e.getMessage());
            }
        } else if (event.getMessage().startsWith("?remove")) {
            System.out.println( event.getMessage().substring( event.getMessage().indexOf("http") ) );
            this.mediator.removeFeed( event.getMessage().substring( event.getMessage().indexOf("http") ) );
        }
    }
}
@@ -630,17 +630,17 @@
 tsWith(%22
-?
+!
 version%22
@@ -674,62 +674,45 @@
 ond(
-%22NewsBot v0.1 by Gerardo Canosa and Geronimo Poppino!%22
+ConfReader.getInstance().getVersion()
 );%0A 
@@ -760,17 +760,17 @@
 tsWith(%22
-?
+!
 list%22)) 
@@ -1129,17 +1129,17 @@
 tsWith(%22
-?
+!
 add%22)) %7B
@@ -1434,9 +1434,9 @@
 th(%22
-?
+!
 remo

Use ! as command trigger / Take version string from config file