diff --git a/plugins/markov.py b/plugins/markov.py index 71f3c96..ae6fc53 100644 --- a/plugins/markov.py +++ b/plugins/markov.py @@ -104,7 +104,10 @@ class Markov(Plugin): self.handle_command(conn, channel, who, parts) elif line[0] != "!": # ignore other commands - self.chains[channel][who.nick].add(line) + self.add(channel, who.nick, line) + + def add(self, channel: str, who: str, line: str): + self.chains[channel][who].add(line) def handle_command( self, conn: IrcProtocol, channel: str, who: Prefix, parts: Sequence[str] diff --git a/tools/markov_import.py b/tools/markov_import.py index 2515194..5e9a192 100644 --- a/tools/markov_import.py +++ b/tools/markov_import.py @@ -37,5 +37,5 @@ if __name__ == "__main__": if mat := LINE_RE.search(line): name = mat["name"] message = mat["message"] - plugin.chains[channel][name].add(message) + plugin.add(channel, name, message) plugin.save()