summaryrefslogtreecommitdiffstats
path: root/modules/ping.py
diff options
context:
space:
mode:
authorSean B. Palmer <http://inamidst.com/sbp/>2008-02-21 12:06:33 +0000
committerSean B. Palmer <http://inamidst.com/sbp/>2008-02-21 12:06:33 +0000
commit7931fab14599b739c18c8f1ebcc24b75688dbc09 (patch)
treebf4df9757f10c155e3b6f78aed48f15884ebbbe6 /modules/ping.py
downloadbot-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-xmodules/ping.py23
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()