ircmgmt, markov: actually use bot.reply() right
This commit is contained in:
parent
67098c34bb
commit
115e82f0fc
@ -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."""
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user