-
Notifications
You must be signed in to change notification settings - Fork 2
/
ping.py
executable file
·28 lines (23 loc) · 947 Bytes
/
ping.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
"""
ping.py - Phenny Ping Module
Author: Sean B. Palmer, inamidst.com (with small modifications from Peter Higgins [dante@dojotoolkit.org])
About: http://inamidst.com/phenny/
"""
import random
def hello(phenny, input):
greeting = random.choice(('Hi', 'Hey', 'Hello', input.group(1)))
punctuation = random.choice(('', '!', '...', '. hoe gaat het?'))
phenny.say(greeting + ' ' + input.nick + punctuation)
hello.rule = r'(?i)(hi|hello|h[ie]ya?|moin|morning) $nickname\b'
def thanks(phenny, input):
salutation = random.choice(('np', 'yw', 'anytime', 'de nada.', 'graag gedaan'))
phenny.say(input.nick + ': ' + salutation);
thanks.rule = r'(?i)(bedankt|thanks|thank\ you|danke) $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()