From 3fb97984dc4ecd2df466681c2bf55b8f4d64c3cc Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 3 Sep 2003 20:41:28 +0000 Subject: [PATCH] Removed the crazy topicPrefix stuff, it was pretty useless. --- plugins/Enforcer.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/plugins/Enforcer.py b/plugins/Enforcer.py index c84926a41..9f6f2b71b 100644 --- a/plugins/Enforcer.py +++ b/plugins/Enforcer.py @@ -43,6 +43,15 @@ import privmsgs import ircutils import callbacks +def configure(onStart, afterConnect, advanced): + onStart.append('load Enforcer') + chanserv = something('What\'s the name of ChanServ on your network?') + if yn('Do you want the bot to take revenge on rule breakers?') == 'y': + revenge = True + else: + revenge = False + onStart.append('startenforcer %s %s' % (chanserv, revenge)) + ### # Enforcer: Enforces capabilities on JOIN, MODE, KICK, etc. ### @@ -50,13 +59,11 @@ _chanCap = ircdb.makeChannelCapability class Enforcer(callbacks.Privmsg): started = False def startenforcer(self, irc, msg, args): - """[ ]""" + """[ ]""" self.topics = {} - (chanserv, revenge, topicPrefix) = \ - privmsgs.getArgs(args, needed=0, optional=3) + (chanserv, revenge) = privmsgs.getArgs(args, needed=0, optional=2) self.chanserv = chanserv or 'ChanServ' self.started = True - self.topicPrefix = topicPrefix revenge = revenge.capitalize() if revenge == 'True' or revenge == '': self.revenge = True @@ -97,11 +104,6 @@ class Enforcer(callbacks.Privmsg): irc.queueMsg(ircmsgs.kick(channel, msg.nick, conf.replyNoCapability % \ _chanCap(channel, 'topic'))) - elif not topic.startswith(self.topicPrefix): - irc.queueMsg(ircmsgs.topic(channel, self.topicPrefix + topic)) - if self.revenge: - irc.queueMsg(ircmsgs.kick(channel, msg.nick, - 'Topics must begin with the prefix "%s"' % self.topicPrefix)) else: self.topics[channel] = msg.args[1]