diff options
author | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-02-21 12:06:33 +0000 |
---|---|---|
committer | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-02-21 12:06:33 +0000 |
commit | 7931fab14599b739c18c8f1ebcc24b75688dbc09 (patch) | |
tree | bf4df9757f10c155e3b6f78aed48f15884ebbbe6 /modules/ping.py | |
download | bot-7931fab14599b739c18c8f1ebcc24b75688dbc09.tar.gz bot-7931fab14599b739c18c8f1ebcc24b75688dbc09.tar.bz2 bot-7931fab14599b739c18c8f1ebcc24b75688dbc09.zip |
Phenny2, now being tested on Freenode as the main phenny.
Diffstat (limited to 'modules/ping.py')
-rwxr-xr-x | modules/ping.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/ping.py b/modules/ping.py new file mode 100755 index 0000000..97e41e1 --- /dev/null +++ b/modules/ping.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +""" +ping.py - Phenny Ping Module +Author: Sean B. Palmer, inamidst.com +About: http://inamidst.com/phenny/ +""" + +import random + +def hello(phenny, input): + greeting = random.choice(('Hi', 'Hey', 'Hello')) + punctuation = random.choice(('', '!')) + phenny.say(greeting + ' ' + input.nick + punctuation) +hello.rule = r'(?i)(hi|hello|hey) $nickname\b' + +def interjection(phenny, input): + phenny.say(input.nick + '!') +interjection.rule = r'$nickname!' +interjection.priority = 'high' +interjection.thread = False + +if __name__ == '__main__': + print __doc__.strip() |