-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslap.py
130 lines (124 loc) · 2.77 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import random
import sys
from pprint import pprint
import core
PLUGINVERSION = 2
SLAP_TEMPLATES = {
"templates":[
"%(hits)s %(user)s with a %(item)s.",
"%(hits)s %(user)s around a bit with a %(item)s.",
"%(throws)s a %(item)s at %(user)s.",
"%(throws)s a few %(item_plural)s at %(user)s.",
"grabs a %(item)s and %(throws)s it in %(user)s's face.",
"launches a %(item)s in %(user)s's general direction.",
"sits on %(user)s's face while slamming a %(item)s into their crotch.",
"starts slapping %(user)s silly with a %(item)s.",
"holds %(user)s down and repeatedly %(hits)s them with a %(item)s.",
"prods %(user)s with a %(item)s.",
"picks up a %(item)s and %(hits)s %(user)s with it.",
"ties %(user)s to a chair and %(throws)s a %(item)s at them.",
"%(hits)s %(user)s %(where)s with a %(item)s.",
"ties %(user)s to a pole and whips them with a %(item)s."
],
"parts": {
"item":[
"cast iron skillet",
"large trout",
"baseball bat",
"cricket bat",
"wooden cane",
"nail",
"printer",
"shovel",
"pair of trousers",
"CRT monitor",
"diamond sword",
"baguette",
"physics textbook",
"toaster",
"portrait of Richard Stallman",
"television",
"mau5head",
"five ton truck",
"roll of duct tape",
"book",
"laptop",
"old television",
"sack of rocks",
"rainbow trout",
"cobblestone block",
"lava bucket",
"rubber chicken",
"spiked bat",
"gold block",
"fire extinguisher",
"heavy rock",
"chunk of dirt"
],
"item_plural":[
"cast iron skillets",
"large trouts",
"baseball bats",
"wooden canes",
"nails",
"printers",
"shovels",
"pairs of trousers",
"CRT monitors",
"diamond swords",
"baguettes",
"physics textbooks",
"toasters",
"portraits of Richard Stallman",
"televisions",
"mau5heads",
"five ton trucks",
"rolls of duct tape",
"books",
"laptops",
"old televisions",
"sacks of rocks",
"rainbow trouts",
"cobblestone blocks",
"lava buckets",
"rubber chickens",
"spiked bats",
"gold blocks",
"fire extinguishers",
"heavy rocks",
"chunks of dirt"
],
"throws": [
"throws",
"flings",
"chucks"
],
"hits": [
"hits",
"whacks",
"slaps",
"smacks"
],
"where": [
"in the chest",
"on the head",
"on the bum"
]
}
}
plugin = core.Plugin()
def generate_slap_message(user1, user2):
parts = {"user":"@" + user2}
for part in SLAP_TEMPLATES["parts"]:
parts[part] = random.choice(SLAP_TEMPLATES["parts"][part])
return "@" + user1 + " " + random.choice(SLAP_TEMPLATES["templates"]) % parts
@plugin.command(command="/slap",
description="IRC /slap command",
inline_supported=True,
hidden=False)
def slap(bot, update, user, args):
if update.message.reply_to_message:
message = generate_slap_message(user.username, update.message.reply_to_message.from_user.username)
else:
message = generate_slap_message(bot.get_me().username, user.username)
return core.message(text=message)