diff --git a/plugins/Parter.py b/plugins/Parter.py index 89f3f3fb0..ff27c4982 100644 --- a/plugins/Parter.py +++ b/plugins/Parter.py @@ -29,6 +29,13 @@ # POSSIBILITY OF SUCH DAMAGE. ### +""" +Some networks find out who's a bot by forcing clients to join a certain +channel when they connect, and the clients that don't leave are considered +bots. This module makes supybot automatically part certain channels as soon +as he joins. +""" + from baseplugin import * import conf @@ -38,9 +45,44 @@ import ircmsgs import privmsgs import callbacks +def configure(onStart, afterConnect, advanced): + from questions import something, yn + onStart.append('load Parter') + s = ' ' + while s: + if yn('Would you like to automatically part a channel?') == 'y': + s = something('What channel?') + while not ircutils.isChannel(s): + print 'That\'s not a valid channel.' + s = something('What channel?') + onStart.append('autopartchannel %s' % s) + else: + s = '' + +example = utils.wrapLines(""" + @list Parter + jemfinch: autopartchannel, removeautopartchannel + @autopartchannel #supybot + jemfinch: The operation succeeded. + @join #supybot + +--> supybot (~supybot@dhcp065-024-059-168.columbus.rr.com) has joined #supybot +<-- supybot (~supybot@dhcp065-024-059-168.columbus.rr.com) has left #supybot + + @removeautopartchannel #supybot + jemfinch: The operation succeeded. + @join #supybot + +--> supybot (~supybot@dhcp065-024-059-168.columbus.rr.com) has joined #supybot +""") + class Parter(callbacks.Privmsg): def autopartchannel(self, irc, msg, args): - "" + """ + + + Makes the bot part automatically, as soon as he joins it. + """ channel = privmsgs.getArgs(args) if ircdb.checkCapability(msg.prefix, 'admin'): if not hasattr(self, 'channels'): @@ -52,7 +94,10 @@ class Parter(callbacks.Privmsg): irc.error(msg, conf.replyNoCapability % 'admin') def removeautopartchannel(self, irc, msg, args): - "" + """ + + Removes the channel from the auto-part list. + """ channel = privmsgs.getArgs(args) if ircdb.checkCapability(msg.prefix, 'admin'): if hasattr(self, 'channels'):