from hubbot.moduleinterface import ModuleInterface
from hubbot.response import IRCResponse, ResponseType
from cobe.brain import Brain
import os


class Markov(ModuleInterface):
    help = "Markov - Yeah I'm sentient, what of it?"

    def onLoad(self):
        self.brain = Brain(os.path.join("hubbot", "data", "{}.brain".format(self.bot.server)))

    def addToBrain(self, msg):
        if "://" not in msg and len(msg) > 1:
            self.brain.learn(msg)

    def shouldTrigger(self, message):
        """
        @type message: hubbot.message.IRCMessage
        """
        if message.Type in self.acceptedTypes:
            return True
        return False

    def onTrigger(self, message):
        """
        @type message: hubbot.message.IRCMessage
        """
        if message.User is None or message.Channel is None or message.User.Name == self.bot.nickname:
            return
        if message.MessageList[0].startswith(self.bot.nickname) and len(message.MessageList) > 1:
            reply = self.brain.reply(" ".join(message.MessageList[1:]), max_len=50)
            return IRCResponse(ResponseType.Say, reply.capitalize(), message.ReplyTo)
        else:
            self.addToBrain(" ".join(message.MessageList))

@@ -901,60 +901,48 @@
  if 
-message.MessageList%5B0%5D.startswith(self.bot.nickname)
+self.bot.nickname in message.MessageList
  and
@@ -1041,12 +1041,8 @@
 List
-%5B1:%5D
 ), m
@@ -1052,9 +1052,10 @@
 len=
-5
+10
 0)%0A 

Check entire line for nick.