Skip to content

Commit 60d975e

Browse files
committed
added pizza command
per request, added pizza.json and pizza command to foods.py
1 parent b4ee7cf commit 60d975e

2 files changed

Lines changed: 148 additions & 1 deletion

File tree

data/pizza.json

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
{
2+
"templates": [
3+
"sends {user} {size} {style} {kind} pizza with {extra}."
4+
],
5+
"parts": {
6+
"size": [
7+
"a whole",
8+
"a small",
9+
"a medium size",
10+
"a family size",
11+
"a portion of",
12+
"a slice of",
13+
"a couple of slices of",
14+
"some leftovers of",
15+
"a single bit of"
16+
],
17+
"style": [
18+
"regular",
19+
"grilled",
20+
"New York style",
21+
"Boston style",
22+
"Chicago Deep Dish",
23+
"sourdough",
24+
"iron skillet baked",
25+
"thin-crust",
26+
"stone oven baked",
27+
"French bread",
28+
"Sicilian style",
29+
"Bar Pie",
30+
"al Taglio",
31+
"Calzone"
32+
],
33+
"kind": [
34+
"Mexican",
35+
"Hawaiian",
36+
"Chef's Special",
37+
"Four Seasons",
38+
"Margherita",
39+
"Carbonara",
40+
"Marinera",
41+
"meatball",
42+
"Capricciosa",
43+
"Pesto",
44+
"tomato",
45+
"Greek",
46+
"Tex-Mex",
47+
"barbecue",
48+
"kebap",
49+
"chili",
50+
"sushi",
51+
"Spanish ham",
52+
"chorizo",
53+
"four-cheese",
54+
"bacon",
55+
"Canadian bacon",
56+
"pulled pork",
57+
"spicy chicken",
58+
"pepperoni",
59+
"banana and bacon",
60+
"mushroom",
61+
"veggie",
62+
"tomato and cheese",
63+
"spinach",
64+
"sausage",
65+
"cheese and rucula",
66+
"Supreme",
67+
"Formaggio",
68+
"Lasagna",
69+
"creamy onion and bacon",
70+
"Caesar's",
71+
"Fiorentina",
72+
"smoked salmon",
73+
"roast beef",
74+
"ground beef and sauce",
75+
"Meat Lover's",
76+
"Buffalo Wing",
77+
"sausage and pepper",
78+
"7-Alarm spicy",
79+
"Sweet Sriracha",
80+
"Meaty Triple-Decker"
81+
],
82+
"extra": [
83+
"some Mozzarella cheese",
84+
"some Parmesan cheese",
85+
"goat cheese slices on top",
86+
"some Gorgonzola cheese",
87+
"some Stilton cheese",
88+
"some Gouda cheese",
89+
"some Cheddar cheese",
90+
"some Paneer cheese",
91+
"Manchego cheese slices on top",
92+
"with Feta cheese dices on top",
93+
"Swiss cheese on top",
94+
"Halloumi cheese slices on top",
95+
"some Gorgonzola cheese",
96+
"cheese curds on top",
97+
"String cheese on top",
98+
"sliced artichoke hearts on top",
99+
"an extra of pepper",
100+
"an extra of anchovies on top",
101+
"an extra of sausage",
102+
"an extra of black olives",
103+
"an extra of canned spam",
104+
"an extra of freshly-hunted duck meat",
105+
"an extra of pepperoni",
106+
"an extra of mushroom",
107+
"an extra of spicy chicken",
108+
"an extra of curry chicken",
109+
"an extra of grilled chicken",
110+
"an extra of mustard chicken",
111+
"an extra of premium bacon",
112+
"an extra of pineapple",
113+
"a sprinkle of parsley",
114+
"a sprinkle of oregano",
115+
"a sprinkle of rosemary",
116+
"a sprinkle of basil",
117+
"a sprinkle of grounded pepper",
118+
"a sprinkle of sage",
119+
"a sprinkle of dried garlic",
120+
"a sprinkle of dried grounded onion",
121+
"a sprinkle of hot pepper flakes",
122+
"fresh parsley on top",
123+
"fresh fennel leaves on top",
124+
"fresh lamb's lettuce leaves on top",
125+
"fresh chives on top",
126+
"capers on top",
127+
"fresh basil on top",
128+
"chopped green onions on top"
129+
]
130+
}
131+
}

plugins/foods.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def load_foods(bot):
6767
"""
6868
global sandwich_data, taco_data, coffee_data, noodles_data, muffin_data, \
6969
tea_data, keto_data, beer_data, cheese_data, pancake_data, chicken_data, \
70-
icecream_data, brekkie_data, doobie_data
70+
icecream_data, brekkie_data, doobie_data, pizza_data
7171

7272
with codecs.open(os.path.join(bot.data_dir, "sandwich.json"), encoding="utf-8") as f:
7373
sandwich_data = json.load(f)
@@ -111,6 +111,8 @@ def load_foods(bot):
111111
with codecs.open(os.path.join(bot.data_dir, "doobie.json"), encoding="utf-8") as f:
112112
doobie_data = json.load(f)
113113

114+
with codecs.open(os.path.join(bot.data_dir, "pizza.json"), encoding="utf-8") as f:
115+
pizza_data = json.load(f)
114116

115117
@asyncio.coroutine
116118
@hook.command
@@ -368,3 +370,17 @@ def doobie(text, action):
368370

369371
# act out the message
370372
action(generator.generate_string())
373+
374+
@asyncio.coroutine
375+
@hook.command("pizza")
376+
def pizza(text, action):
377+
"""<user> - give pizza to <user>"""
378+
user = text.strip()
379+
380+
if not is_valid(user):
381+
return "I can't give pizza to that user."
382+
383+
generator = textgen.TextGenerator(pizza_data["templates"], pizza_data["parts"], variables={"user": user})
384+
385+
# act out the message
386+
action(generator.generate_string())

0 commit comments

Comments
 (0)