From 3310e0cb3edb51ca4d281c362243e61ff2a74363 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 21 Oct 2003 04:09:48 +0000 Subject: [PATCH] Converted to use generic command names. --- plugins/Relay.py | 62 ++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/plugins/Relay.py b/plugins/Relay.py index 9f393503d..3dfddda7b 100644 --- a/plugins/Relay.py +++ b/plugins/Relay.py @@ -82,7 +82,7 @@ def configure(onStart, afterConnect, advanced): onStart.append('load Relay') startNetwork = anything('What is the name of the network you\'re ' \ 'connecting to first?') - onStart.append('startrelay %s' % startNetwork) + onStart.append('relay start %s' % startNetwork) while yn('Do you want to connect to another network for relaying?') == 'y': network = anything('What is the name of the network you want to ' \ 'connect to?') @@ -107,14 +107,14 @@ def configure(onStart, afterConnect, advanced): print 'Sorry, but that isn\'t a valid port.' port = '' server = ':'.join((server, port)) - onStart.append('relayconnect %s %s' % (network, server)) + onStart.append('relay connect %s %s' % (network, server)) channel = anything('What channel would you like to relay between?') - afterConnect.append('relayjoin %s' % channel) + afterConnect.append('relay join %s' % channel) while yn('Would like to relay between any more channels?') == 'y': channel = anything('What channel?') - afterConnect.append('relayjoin %s' % channel) + afterConnect.append('relay join %s' % channel) if yn('Would you like to use color to distinguish between nicks?') == 'y': - afterConnect.append('relaycolor 2') + afterConnect.append('relay color 2') class Relay(callbacks.Privmsg): @@ -152,7 +152,7 @@ class Relay(callbacks.Privmsg): do377 = do376 do422 = do376 - def startrelay(self, irc, msg, args): + def start(self, irc, msg, args): """ This command is necessary to start the Relay plugin; the @@ -174,9 +174,9 @@ class Relay(callbacks.Privmsg): self.lastmsg[realIrc] = ircmsgs.ping('this is just a fake message') self.started = True irc.reply(msg, conf.replySuccess) - startrelay = privmsgs.checkCapability(startrelay, 'owner') + start = privmsgs.checkCapability(start, 'owner') - def relayconnect(self, irc, msg, args): + def connect(self, irc, msg, args): """ (port defaults to 6667) Connects to another network at . The network @@ -184,7 +184,7 @@ class Relay(callbacks.Privmsg): that network to other networks. """ if not self.started: - irc.error(msg, 'You must use the startrelay command first.') + irc.error(msg, 'You must use the start command first.') return abbreviation, server = privmsgs.getArgs(args, needed=2) if isinstance(irc, irclib.Irc): @@ -205,16 +205,16 @@ class Relay(callbacks.Privmsg): self.ircstates[newIrc] = irclib.IrcState() self.lastmsg[newIrc] = ircmsgs.ping('this is just a fake message') irc.reply(msg, conf.replySuccess) - relayconnect = privmsgs.checkCapability(relayconnect, 'owner') + connect = privmsgs.checkCapability(connect, 'owner') - def relaydisconnect(self, irc, msg, args): + def disconnect(self, irc, msg, args): """ Disconnects and ceases to relay to and from the network represented by the network abbreviation . """ if not self.started: - irc.error(msg, 'You must use the startrelay command first.') + irc.error(msg, 'You must use the start command first.') return network = privmsgs.getArgs(args) otherIrc = self.ircs[network] @@ -222,19 +222,19 @@ class Relay(callbacks.Privmsg): del self.ircs[network] del self.abbreviations[otherIrc] irc.reply(msg, conf.replySuccess) - relaydisconnect = privmsgs.checkCapability(relaydisconnect, 'owner') + disconnect = privmsgs.checkCapability(disconnect, 'owner') - def relayjoin(self, irc, msg, args): + def join(self, irc, msg, args): """ Starts relaying between the channel on all networks. If on a network the bot isn't in , he'll join. This commands is required even if the bot is in the channel on both networks; he won't - relay between those channels unless he's told to relayjoin both + relay between those channels unless he's told to oin both channels. """ if not self.started: - irc.error(msg, 'You must use the startrelay command first.') + irc.error(msg, 'You must use the start command first.') return channel = privmsgs.getArgs(args) self.channels.add(ircutils.toLower(channel)) @@ -242,9 +242,9 @@ class Relay(callbacks.Privmsg): if channel not in otherIrc.state.channels: otherIrc.queueMsg(ircmsgs.join(channel)) irc.reply(msg, conf.replySuccess) - relayjoin = privmsgs.checkCapability(relayjoin, 'owner') + join = privmsgs.checkCapability(join, 'owner') - def relaypart(self, irc, msg, args): + def part(self, irc, msg, args): """ Ceases relaying between the channel on all networks. The bot @@ -252,7 +252,7 @@ class Relay(callbacks.Privmsg): channel. """ if not self.started: - irc.error(msg, 'You must use the startrelay command first.') + irc.error(msg, 'You must use the start command first.') return channel = privmsgs.getArgs(args) self.channels.remove(ircutils.toLower(channel)) @@ -260,19 +260,19 @@ class Relay(callbacks.Privmsg): if channel in otherIrc.state.channels: otherIrc.queueMsg(ircmsgs.part(channel)) irc.reply(msg, conf.replySuccess) - relaypart = privmsgs.checkCapability(relaypart, 'owner') + part = privmsgs.checkCapability(part, 'owner') - def relaysay(self, irc, msg, args): + def say(self, irc, msg, args): """ [] Says on (using the current channel if unspecified) on . """ if not self.started: - irc.error(msg, 'You must use the startrelay command first.') + irc.error(msg, 'You must use the start command first.') return if not args: - raise callbacks.ArgumentError, 'relaysay' + raise callbacks.ArgumentError network = args.pop(0) channel = privmsgs.getChannel(msg, args) text = privmsgs.getArgs(args) @@ -283,9 +283,9 @@ class Relay(callbacks.Privmsg): irc.error(msg, 'I\'m not currently relaying to %s.' % channel) return self.ircs[network].queueMsg(ircmsgs.privmsg(channel, text)) - relaysay = privmsgs.checkCapability(relaysay, 'admin') + say = privmsgs.checkCapability(say, 'admin') - def relaynames(self, irc, msg, args): + def names(self, irc, msg, args): """[] (only if not sent in the channel itself.) The argument is only necessary if the message isn't sent on @@ -293,7 +293,7 @@ class Relay(callbacks.Privmsg): the various networks the bot is connected to. """ if not self.started: - irc.error(msg, 'You must use the startrelay command first.') + irc.error(msg, 'You must use the start command first.') return if isinstance(irc, irclib.Irc): realIrc = irc @@ -311,13 +311,13 @@ class Relay(callbacks.Privmsg): users.append('%s: %s' % (ircutils.bold(abbreviation), usersS)) irc.reply(msg, '; '.join(users)) - def relaywhois(self, irc, msg, args): + def whois(self, irc, msg, args): """@ Returns the WHOIS response gives for . """ if not self.started: - irc.error(msg, 'You must use the startrelay command first.') + irc.error(msg, 'You must use the start command first.') return nickAtNetwork = privmsgs.getArgs(args) if isinstance(irc, irclib.Irc): @@ -347,14 +347,14 @@ class Relay(callbacks.Privmsg): otherIrc.queueMsg(ircmsgs.whois(nick, nick)) self.whois[(otherIrc, nick)] = (irc, msg, {}) - def relaycolor(self, irc, msg, args): + def color(self, irc, msg, args): """<0,1,2> 0 turns coloring of nicks/angle brackets off entirely. 1 colors the nicks, but not the angle brackets. 2 colors both. """ if not self.started: - irc.error(msg, 'You must use the startrelay command first.') + irc.error(msg, 'You must use the start command first.') return try: color = int(privmsgs.getArgs(args)) @@ -364,7 +364,7 @@ class Relay(callbacks.Privmsg): except ValueError: raise callbacks.ArgumentError irc.reply(msg, conf.replySuccess) - relaycolor = privmsgs.checkCapability(relaycolor, 'admin') + color = privmsgs.checkCapability(color, 'admin') def do311(self, irc, msg): if not isinstance(irc, irclib.Irc):