From 5885983afd09cc81cea4cc1d8d9d57ee2051a2f0 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Fri, 22 Apr 2011 19:40:36 -0500 Subject: [PATCH] Markov: when learning lines, don't include the part direct addressing e.g. if i say 'dr_botzo: hello dude', he only learns 'hello dude'. this is mainly being done because the bot's name being in the brain so many times was getting kind of silly, especially in channels that have lots of conversations with the bot --- modules/Markov.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/Markov.py b/modules/Markov.py index 22ac1cc..4e76a2e 100644 --- a/modules/Markov.py +++ b/modules/Markov.py @@ -106,6 +106,8 @@ class Markov(Module): """Learn from IRC events.""" what = ''.join(event.arguments()[0]) + my_nick = connection.get_nickname() + what = re.sub('^' + my_nick + '[:,]\s+', '', what) # don't learn from commands if self.trainre.search(what) or self.learnre.search(what) or self.replyre.search(what):