def log(self, sender, message, channel):
        sender = sender[:10]
        self.word_table.setdefault(sender, {})
        
        if message.startswith('/'):
            return

        try:
            say_something = self.is_ping(message) or sender != self.conn.nick and random.random() < self.chattiness
        except AttributeError:
            say_something = False
        messages = []
        seed_key = None
        
        if self.is_ping(message):
            message = self.fix_ping(message)

        for words in self.split_message(self.sanitize_message(message)):
            key = tuple(words[:-1])
            if key in self.word_table:
                self.word_table[sender][key].append(words[-1])
            else:
                self.word_table[sender][key] = [words[-1]]

            if self.stop_word not in key and say_something:
                for person in self.word_table:
                    if person == sender:
                        continue
                    if key in self.word_table[person]:
                        generated = self.generate_message(person, seed_key=key)
                        if generated:
                            messages.append((person, generated))
        
        if len(messages):
            self.last, message = random.choice(messages)
            return message
dataset/ETHPy150Open coleifer/irc/bots/markov.py/MarkovBot.log/original