ircmgmt, markov: actually use bot.reply() right

This commit is contained in:
Brian S. Stephan 2015-05-15 18:19:55 -05:00
parent 67098c34bb
commit 115e82f0fc
2 changed files with 12 additions and 10 deletions

View File

@ -56,7 +56,8 @@ class ChannelManagement(Plugin):
chan_mod, c = IrcChannel.objects.get_or_create(name=channel)
log.debug(u"joining channel %s", channel)
self.connection.join(channel)
self.bot.reply(event, "Joined channel {0:s}.".format(channel))
return self.bot.reply(event, "Joined channel {0:s}.".format(channel))
def handle_part(self, connection, event, match):
"""Handle the join command."""
@ -69,7 +70,8 @@ class ChannelManagement(Plugin):
chan_mod, c = IrcChannel.objects.get_or_create(name=channel)
log.debug(u"parting channel %s", channel)
self.connection.part(channel)
self.bot.reply(event, "Parted channel {0:s}.".format(channel))
return self.bot.reply(event, "Parted channel {0:s}.".format(channel))
def handle_quit(self, connection, event, match):
"""Handle the join command."""

View File

@ -55,18 +55,18 @@ class Markov(Plugin):
# the speaker
topics = [x for x in addressed_re.match(what).group(1).split(' ') if len(x) >= 3]
self.bot.reply(event, u"{0:s}: {1:s}"
u"".format(nick, u" ".join(markovlib.generate_line(context,
topics=topics,
max_sentences=1))))
return self.bot.reply(event, u"{0:s}: {1:s}"
u"".format(nick, u" ".join(markovlib.generate_line(context,
topics=topics,
max_sentences=1))))
else:
# i wasn't addressed directly, so just respond
topics = [x for x in what.split(' ') if len(x) >= 3]
self.bot.reply(event, u"{0:s}"
u"".format(u" ".join(markovlib.generate_line(context,
topics=topics,
max_sentences=1))))
return self.bot.reply(event, u"{0:s}"
u"".format(u" ".join(markovlib.generate_line(context,
topics=topics,
max_sentences=1))))
plugin = Markov