forked from sopel-irc/sopel-extras
-
Notifications
You must be signed in to change notification settings - Fork 0
/
slap.py
27 lines (23 loc) · 849 Bytes
/
slap.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
"""
slap.py - Slap Module
Copyright 2009, Michael Yanovich, yanovich.net
http://willie.dftba.net
"""
import random
from willie.module import commands
@commands('slap', 'slaps')
def slap(willie, trigger):
""".slap <target> - Slaps <target>"""
text = trigger.group().split()
if len(text) < 2 or text[1].startswith('#'):
return
if text[1] == willie.nick:
if (trigger.nick not in willie.config.admins):
text[1] = trigger.nick
else:
text[1] = 'itself'
if text[1] in willie.config.admins:
if (trigger.nick not in willie.config.admins):
text[1] = trigger.nick
verb = random.choice(('slaps', 'kicks', 'destroys', 'annihilates', 'punches', 'roundhouse kicks', 'pwns', 'owns'))
willie.write(['PRIVMSG', trigger.sender, ' :\x01ACTION', verb, text[1], '\x01'])