2008-02-21 07:06:33 -05:00
|
|
|
#!/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):
|
2012-01-03 14:09:34 -05:00
|
|
|
greeting = random.choice(('Hi', 'Hey', 'Hello'))
|
|
|
|
punctuation = random.choice(('', '!'))
|
|
|
|
phenny.say(greeting + ' ' + input.nick + punctuation)
|
2011-06-17 11:49:37 -04:00
|
|
|
hello.rule = r'(?i)(hi|hello|hey) $nickname[ \t]*$'
|
2008-02-21 07:06:33 -05:00
|
|
|
|
|
|
|
def interjection(phenny, input):
|
2012-01-03 14:09:34 -05:00
|
|
|
phenny.say(input.nick + '!')
|
2008-02-21 07:06:33 -05:00
|
|
|
interjection.rule = r'$nickname!'
|
|
|
|
interjection.priority = 'high'
|
|
|
|
interjection.thread = False
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2012-01-03 14:09:34 -05:00
|
|
|
print(__doc__.strip())
|