variable tweak to match other plugins (nick -> who)

This commit is contained in:
Brian S. Stephan 2023-02-18 18:44:42 -06:00
parent 363ec49097
commit 0bfe3f9549
Signed by: bss
GPG Key ID: 3DE06D3180895FCB
1 changed files with 3 additions and 3 deletions

View File

@ -60,10 +60,10 @@ class Markov(Plugin):
def handle_chatter(self, connection, event):
"""Learn from IRC chatter."""
what = event.arguments[0]
nick = irc.client.NickMask(event.source).nick
who = irc.client.NickMask(event.source).nick
target = reply_destination_for_event(event)
log.debug("what: '%s', nick: '%s', target: '%s'", what, nick, target)
log.debug("what: '%s', who: '%s', target: '%s'", what, who, target)
# check to see whether or not we should learn from this channel
channel = None
if irc.client.is_channel(target):
@ -97,7 +97,7 @@ class Markov(Plugin):
topics = [x for x in match.group('addressed_msg').split(' ') if len(x) >= 3]
return self.bot.reply(event, "{0:s}: {1:s}"
"".format(nick, " ".join(markovlib.generate_line(context, topics=topics))))
"".format(who, " ".join(markovlib.generate_line(context, topics=topics))))
else:
# i wasn't addressed directly, so just respond
topics = [x for x in what.split(' ') if len(x) >= 3]