From 1d5dfa070d1bb1eeb76a50e1a8ab62492341d83b Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 13 Oct 2003 03:58:37 +0000 Subject: [PATCH] Added an optional key argument to cycle. --- src/ChannelCommands.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ChannelCommands.py b/src/ChannelCommands.py index 47b066724..01f4b5add 100755 --- a/src/ChannelCommands.py +++ b/src/ChannelCommands.py @@ -85,14 +85,18 @@ class ChannelCommands(callbacks.Privmsg): voice = privmsgs.checkChannelCapability(voice, 'voice') def cycle(self, irc, msg, args, channel): - """[] + """[] [] The argument is only necessary if the message isn't being sent in the channel itself. If you have the #channel.op capability, this will cause the bot to "cycle", or PART and then JOIN the channel. + If is given, join the channel using that key. """ + key = privmsgs.getArgs(args, needed=0, optional=1) + if not key: + key = None irc.queueMsg(ircmsgs.part(channel)) - irc.queueMsg(ircmsgs.join(channel)) + irc.queueMsg(ircmsgs.join(channel, key)) cycle = privmsgs.checkChannelCapability(cycle, 'op') def kban(self, irc, msg, args):