From 25e41150af5733c68b5ba7f7b8b411dfb797d934 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Fri, 3 May 2013 16:02:07 -0500 Subject: [PATCH] Markov: handle non-channel events properly this includes having privmsgs correctly be attributed to the speaker, rather than the bot --- modules/Markov.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/Markov.py b/modules/Markov.py index 1a2c7f2..f057b43 100644 --- a/modules/Markov.py +++ b/modules/Markov.py @@ -205,6 +205,10 @@ class Markov(Module): """Learn one line, as provided to the command.""" target = event.target() + + if not irclib.is_channel(target): + target = nick + match = self.learnre.search(what) if match: line = match.group(1) @@ -217,6 +221,10 @@ class Markov(Module): """Generate a reply to one line, without learning it.""" target = event.target() + + if not irclib.is_channel(target): + target = nick + match = self.replyre.search(what) if match: min_size = 15