epic-jdog/epic_jbot — pull request #2 by TheReverend403 (2013-08-20 22:07:35+00:00)
Title: CONSTRUCTORS CONSTRUCTORS CONSTRUCTORS CONSTRUCTORS CONSTRUCTORS

Changes are as follows:

* Too many event.getUser().getNicks() will get your bot throttled by Esper for making too many whois requests. Try and limit event.getUser().getNick() to one per event.

* You don't need your events to throw exceptions. PircBotX does this for you, and handles the exceptions itself in a much better way.

* You only need to extend ListenerAdapter in your listeners. ListenerAdapter implements Listener anyway.

* Using toString() on a string is redundant. It's already a string.

* Moved your main method to a non-static void with a little Java trickery. Don't make things static unless you absolutely know it needs to be static.

* You can now reference your bot from your main class by using constructors. Constructors are used by doing this in all your classes that you need the bot in.

private Epic_jdog bot;

public ExampleClass(Epic_jbot jbot) [
bot = jbot;
}
// Now reference your PircbotX object with bot.getBot()