test the combination of bridge and addressing learning
This commit is contained in:
@@ -74,6 +74,11 @@ class Markov(Plugin):
|
||||
else:
|
||||
# learn the line
|
||||
learning_what = what
|
||||
|
||||
# don't learn the speaker's nick if this came over a bridge
|
||||
if channel and who == channel.discord_bridge:
|
||||
learning_what = ' '.join(learning_what.split(' ')[1:])
|
||||
|
||||
# remove our own nick and aliases from what we learn
|
||||
if connection.server_config.additional_addressed_nicks:
|
||||
all_nicks = '|'.join(connection.server_config.additional_addressed_nicks.split('\n') +
|
||||
@@ -82,10 +87,6 @@ class Markov(Plugin):
|
||||
all_nicks = connection.get_nickname()
|
||||
learning_what = re.sub(r'^(({nicks})[:,]|@({nicks}))\s+'.format(nicks=all_nicks), '', learning_what)
|
||||
|
||||
# don't learn the speaker's nick if this came over a bridge
|
||||
if channel and who == channel.discord_bridge:
|
||||
learning_what = ' '.join(learning_what.split(' ')[1:])
|
||||
|
||||
recursing = getattr(event, 'recursing', False)
|
||||
if not recursing:
|
||||
log.debug("learning %s", learning_what)
|
||||
|
||||
Reference in New Issue
Block a user