Markov: handle non-channel events properly
this includes having privmsgs correctly be attributed to the speaker, rather than the bot
This commit is contained in:
parent
88e470183b
commit
25e41150af
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user