+ PrefixHandler prefixHandler = new PrefixHandler();
+ List<Handler> handlers = asList(
+ new MessageHandler(eventBus, this, prefixHandler),
+ new CtcpHandler(eventBus, this),
+ new ChannelNickHandler(eventBus, this, prefixHandler),
+ new SimpleCommandHandler(eventBus)
+ .addCommand("431",
+ (s, p) -> new NoNicknameGivenReceived(
+ this))
+ .addCommand("NICK",
+ (s, p) -> new NicknameChanged(this,
+ s.get(), p.get(0)))
+ .addCommand("JOIN",
+ (s, p) -> new ChannelJoined(this,
+ p.get(0), s.get()))
+ .addCommand("332",
+ (s, p) -> new ChannelTopic(this, p.get(1),
+ p.get(2)))
+ .addCommand("PART",
+ (s, p) -> new ChannelLeft(this, p.get(0),
+ s.get(), getOptional(p, 1)))
+ .addCommand("QUIT",
+ (s, p) -> new ClientQuit(this, s.get(),
+ p.get(0)))
+ .addCommand("KICK",
+ (s, p) -> new KickedFromChannel(this,
+ p.get(0), s.get(), p.get(1),
+ getOptional(p, 2))),
+ new MotdHandler(eventBus, this),
+ new ChannelNotJoinedHandler(eventBus, this),
+ new ConnectionEstablishHandler(eventBus, this),
+ prefixHandler
+ );