Slight efficiency increase

This commit is contained in:
Jeremy Fincher 2003-03-28 02:05:20 +00:00
parent 88dbed38a1
commit 846b4853d7

View File

@ -39,16 +39,16 @@ import callbacks
class Friendly(callbacks.PrivmsgRegexp):
def greet(self, irc, msg, match):
"(?:heya?|(?:w(?:hat'?s\b|as)s?up)|howdy|hi|hello)"
if re.search(irc.nick, msg.args[1]):
if msg.args[1].find(irc.nick) != -1:
irc.queueMsg(ircmsgs.privmsg(msg.args[0], 'howdy :)'))
def goodbye(self, irc, msg, match):
"(?:good)?bye|adios|vale|ciao|au revoir|seeya|night"
if re.search(irc.nick, msg.args[1]):
if msg.args[1].find(irc.nick) != -1:
irc.queueMsg(ircmsgs.privmsg(msg.args[0], 'seeya, d00d!'))
def exclaim(self, irc, msg, match):
"([^\s]+)!"
"^([^\s]+)!"
if match.group(1) == irc.nick:
irc.queueMsg(ircmsgs.privmsg(msg.args[0], '%s!' % msg.nick))