Add dberlin's friendlytoofriendly patch

This commit is contained in:
James Vega 2003-10-22 13:53:09 +00:00
parent dc9acab9b5
commit 8f6adf62f5

View File

@ -38,14 +38,15 @@ import plugins
import callbacks import callbacks
class Friendly(callbacks.PrivmsgRegexp): class Friendly(callbacks.PrivmsgRegexp):
onlyFirstMatch = True
def greet(self, irc, msg, match): def greet(self, irc, msg, match):
r"(?:heya?|(?:w(?:hat'?s\b|as)s?up)|howdy|hi|hello)" r"(?:heya?|(?:w(?:hat'?s\b|as)s?up)|howdy|hi|hello)$"
if irc.nick in msg.args[1]: if irc.nick in msg.args[1]:
s = 'howdy, %s :)' % msg.nick s = 'howdy, %s :)' % msg.nick
irc.queueMsg(callbacks.reply(msg, s, prefixName=False)) irc.queueMsg(callbacks.reply(msg, s, prefixName=False))
def goodbye(self, irc, msg, match): def goodbye(self, irc, msg, match):
r"(?:good)?bye|adios|vale|ciao|au revoir|seeya|night" r"(?:good)?bye|adios|vale|ciao|au revoir|seeya|night$"
if irc.nick in msg.args[1]: if irc.nick in msg.args[1]:
s = 'seeya, %s!' % msg.nick s = 'seeya, %s!' % msg.nick
irc.queueMsg(callbacks.reply(msg, s, prefixName=False)) irc.queueMsg(callbacks.reply(msg, s, prefixName=False))