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
This commit is contained in:
parent
69243ce1e5
commit
5885983afd
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue