Skip to content

Commit 7885476

Browse files
authored
Merge pull request CloudBotIRC#163 from linuxdaemon/gonzobot+data-cleanup
Migrate a lot of the hardcoded data to data files
2 parents ede6410 + ff78f39 commit 7885476

16 files changed

Lines changed: 484 additions & 253 deletions

data/cheers.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FUCK YEAH!
2+
HOORAH!
3+
HURRAY!
4+
OORAH!
5+
YAY!
6+
*\o/* CHEERS! *\o/*
7+
HOOHAH!
8+
HOOYAH!
9+
HUAH!
10+
♪ ┏(°.°)┛ ┗(°.°)┓ ♬

data/fight.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"templates": [
3+
"{bang}! {bang}! {bang}! {user1} {victory} over {user2} with a {blow_type} {blow}.",
4+
"{bang}! {bang}! {bang}! {user2} {victory} over {user1} with a {blow_type} {blow}."
5+
],
6+
"parts": {
7+
"bang": [
8+
"BANG",
9+
"POW",
10+
"SLAM",
11+
"WHACK",
12+
"SLAP",
13+
"KAPOW",
14+
"ZAM",
15+
"BOOM"
16+
],
17+
"blow_type": [
18+
"devastating",
19+
"destructive",
20+
"ruthless",
21+
"damaging",
22+
"ruinous",
23+
"catastrophic",
24+
"traumatic",
25+
"shattering",
26+
"overwhelming",
27+
"crushing",
28+
"fierce",
29+
"deadly",
30+
"lethal",
31+
"fatal",
32+
"savage",
33+
"violent"
34+
],
35+
"victory": [
36+
"wins",
37+
"stands victorious",
38+
"triumphs",
39+
"conquers",
40+
"is the champion",
41+
"is the victor"
42+
],
43+
"blow": [
44+
"uppercut",
45+
"hammerfist",
46+
"elbow strike",
47+
"shoulder strike",
48+
"front kick",
49+
"side kick",
50+
"roundhouse kick",
51+
"knee strike",
52+
"butt strike",
53+
"headbutt",
54+
"haymaker punch",
55+
"palm strike",
56+
"pocket bees"
57+
]
58+
}
59+
}

data/foaas.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"fuck_offs": [
3+
"donut",
4+
"bus",
5+
"chainsaw",
6+
"king",
7+
"madison",
8+
"gfy",
9+
"back",
10+
"keep",
11+
"name",
12+
"bday",
13+
"dalton",
14+
"ing",
15+
"nugget",
16+
"outside",
17+
"off",
18+
"problem",
19+
"shakespeare",
20+
"think",
21+
"thinking",
22+
"xmas",
23+
"yoda",
24+
"you"
25+
],
26+
"single_fucks": [
27+
"bag",
28+
"awesome",
29+
"because",
30+
"bucket",
31+
"bye",
32+
"cool",
33+
"everyone",
34+
"everything",
35+
"flying",
36+
"give",
37+
"horse",
38+
"life",
39+
"looking",
40+
"maybe",
41+
"me",
42+
"mornin",
43+
"no",
44+
"pink",
45+
"retard",
46+
"rtfm",
47+
"sake",
48+
"shit",
49+
"single",
50+
"thanks",
51+
"that",
52+
"this",
53+
"too",
54+
"tucker",
55+
"zayn",
56+
"zero"
57+
]
58+
}

data/food/halal.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"target_templates": [
3+
"Serves {target} {quantity} {quality} {dish}"
4+
],
5+
"templates": [
6+
"has {quantity} {quality} {dish}"
7+
],
8+
"parts": {
9+
"quantity": [
10+
"a little bit of",
11+
"a heaping pile of",
12+
"a moderate serving of",
13+
"a taste of",
14+
"just a smell of"
15+
],
16+
"quality": [
17+
"fresh made",
18+
"left over",
19+
"just out of the oven"
20+
],
21+
"dish": [
22+
"Rice and Goat Meat",
23+
"Goat Curry",
24+
"Hummus bi Tahina",
25+
"Läghmän",
26+
"Mutton biryani",
27+
"Kabuli palao",
28+
"Shakshouka",
29+
"Mutton Msala",
30+
"Fatteh Betnjan",
31+
"Caprese stuffed chicken breast",
32+
"Maqloobeh",
33+
"Koofteh berenji",
34+
"Fish Makkanwala",
35+
"Szechwan"
36+
]
37+
}
38+
}

data/food/kosher.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"target_templates": [
3+
"Serves {target} {quantity} {quality} {dish}"
4+
],
5+
"templates": [
6+
"has {quantity} {quality} {dish}"
7+
],
8+
"parts": {
9+
"quantity": [
10+
"a little bit of",
11+
"a heaping pile of",
12+
"a moderate serving of",
13+
"a taste of",
14+
"just a smell of"
15+
],
16+
"quality": [
17+
"fresh made",
18+
"left over",
19+
"just out of the oven"
20+
],
21+
"dish": [
22+
"gefilte fish",
23+
"matzo ball soup",
24+
"cholent",
25+
"sufganiyot",
26+
"cream cheese with lox bagel",
27+
"lamb merguez with lentils and pears",
28+
"warm apple streusel with ice cream on top",
29+
"mushroom and truffle pizza",
30+
"lemon and rosemary salad with a side of rice",
31+
"latkes with applesauce",
32+
"challah french toast",
33+
"grilled fish tacos with chili-lime dressing",
34+
"date charoset",
35+
"huevos haminados",
36+
"baba-ghanouj",
37+
"bastani with freshly baked pita",
38+
"hummus with perfectly fried falafel",
39+
"mujadrah with warm bread",
40+
"shishlik with red peppers, mushrooms, and onion",
41+
"spicy shakshouka with french bread",
42+
"hadgi badah with a tall glass of apple juice",
43+
"malawah with a large glass of milk",
44+
"sweet kugel with extra sugar on top",
45+
"hamantaschen with date and raspberry filling",
46+
"marbled halva with almonds on top",
47+
"labna with a side of chili sauce",
48+
"polow shirin with extra pomegranate",
49+
"lamb bademjan"
50+
"beef kubbeh with extra chili peppers",
51+
"beef shawarma with a side of hummus and rice",
52+
"lamb and mushroom kofta with a large coke",
53+
"cheese and spinach sambousek",
54+
"bamieh with a side of grilled chicken",
55+
"chicken tagine with saffron rice and a slice of lechuch",
56+
"kofta mishmisheya with grilled vegetables",
57+
"charoset with day old matzah",
58+
"sour cherry rugelach",
59+
"orange-scented flan with dulce de leche syrup",
60+
"brisket with potatoes and a spinach salad",
61+
"bouikos con kashkaval",
62+
"lemon-rice soup with soda crackers"
63+
]
64+
}
65+
}

data/highfive.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"templates": [
3+
"{user} tries to give {nick} a five up high but misses. that was awkward",
4+
"{user} gives {nick} a killer high-five",
5+
"{user} gives {nick} an elbow-shattering high-five",
6+
"{user} smashes {nick} up high",
7+
"{user} slaps skin with {nick}",
8+
"{user} {nick} winds up for a killer five but misses and falls flat on his face",
9+
"{user} halfheartedly high-fives {nick}",
10+
"{user} gives {nick} a smooth five down low",
11+
"{user} gives {nick} a friendly high five",
12+
"{user} starts to give {nick} a high five, but leaves them hanging",
13+
"{user} performs an incomprehensible handshake with {nick} that identifies them as the very best of friends",
14+
"{user} makes as if to high five {nick} but pulls his hand away at the last second",
15+
"{user} leaves {nick} hanging",
16+
"{user} offers a fist and {nick} pounds it"
17+
],
18+
"parts": {}
19+
}

data/lenny.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"lenny": [
3+
"( \u0361\u00b0 \u035c\u0296 \u0361\u00b0)",
4+
"( \u0360\u00b0 \u035f\u0296 \u0361\u00b0)",
5+
"\u1566( \u0361\u00b0 \u035c\u0296 \u0361\u00b0)\u1564",
6+
"( \u0361\u00b0 \u035c\u0296 \u0361\u00b0)",
7+
"( \u0361~ \u035c\u0296 \u0361\u00b0)",
8+
"( \u0361o \u035c\u0296 \u0361o)",
9+
"\u0361\u00b0 \u035c\u0296 \u0361 -",
10+
"( \u0361\u0361 \u00b0 \u035c \u0296 \u0361 \u00b0)\ufeff",
11+
"( \u0361 \u0361\u00b0 \u0361\u00b0 \u0296 \u0361\u00b0 \u0361\u00b0)",
12+
"(\u0e07 \u0360\u00b0 \u035f\u0644\u035c \u0361\u00b0)\u0e07",
13+
"( \u0361\u00b0 \u035c\u0296 \u0361 \u00b0)",
14+
"( \u0361\u00b0\u256d\u035c\u0296\u256e\u0361\u00b0 )"
15+
],
16+
"flenny": [
17+
"( \u0361\u00b0 \u035c \u0361\u00b0 )",
18+
"( \u0361\u00b0 \u035c \u0361\u00b0 )",
19+
"(\u0e07 \u0360\u00b0 \u035f \u0361\u00b0 )\u0e07",
20+
"( \u0361\u00b0_ \u0361\u00b0 )",
21+
"(\ufffd \u0361\u00b0 \u035c \u0361\u00b0 )\ufffd",
22+
"( \u25d5 \u035c \u25d5 )",
23+
"( \u0361~ \u035c \u0361\u00b0 )",
24+
"( \u0360\u00b0 \u035f \u0361\u00b0 )",
25+
"( \u0ca0 \u035c \u0ca0 )",
26+
"( \u0ca5 \u035c \u0ca5 )",
27+
"( \u0361^ \u035c \u0361^ )",
28+
"( \u0ca5 _ \u0ca5 )",
29+
"( \u0361\u00b0 \uff0d \u0361\u00b0 )",
30+
"\u2570( \u0361\u00b0 \u035c \u0361\u00b0)\u2283\u2501\u2606\u309c\u30fb\u3002\u3002\u30fb\u309c\u309c\u30fb\u3002\u3002\u30fb\u309c\u2606\u309c\u30fb\u3002\u3002\u30fb\u309c\u309c\u30fb\u3002\u3002\u30fb\u309c",
31+
"\u2534\u252c\u2534\u252c\u2534\u2524( \u0361\u00b0 \u035c \u251c\u252c\u2534\u252c\u2534\u252c",
32+
"( \u2310\u25a0 \u035c \u25a0 )",
33+
"( \u0361~ _ \u0361~ )",
34+
"@=( \u0361\u00b0 \u035c \u0361\u00b0 @ )\u2261",
35+
"( \u0361\u00b0\u06a1 \u0361\u00b0 )",
36+
"( \u2716_\u2716 )",
37+
"(\u3065 \u0361\u00b0 \u035c \u0361\u00b0 )\u3065",
38+
"\u10da( \u0361\u00b0 \u035c \u0361\u00b0 \u10da)",
39+
"( \u25c9 \u035c \u0361\u25d4 )"
40+
]
41+
}

data/lurve.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"templates": [
3+
"{nick} wraps arms around {target} and clings forever",
4+
"{nick} cuddles {target} in the fluffiest blanket ever",
5+
"{nick} lays their head on the lap of {target} and goes to sleep, dreaming da best sweet dreams",
6+
"{nick} caresses {target}'s hair",
7+
"{nick} caresses {target}'s cheek",
8+
"{nick} plants a shy kiss on {target}'s cheek",
9+
"{nick} gives {target} a BIIIIIIIIG hug!!!",
10+
"{nick} lovingly tackles {target} into a pit of the softest pillows ever",
11+
"{nick} cheers happily for {target}!!",
12+
"{nick} pulls {target} back into bed for more cuddles ♥~",
13+
"{nick} snuggles {target} for Netflix and chili popcorn",
14+
"{nick} happily kisses {target} on the cheek",
15+
"{nick} shares a milkshake with {target}"
16+
],
17+
"parts": {}
18+
}

plugins/badwords.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,6 @@
55
from cloudbot import hook
66

77

8-
cheers = [
9-
"FUCK YEAH!",
10-
"HOORAH!",
11-
"HURRAY!",
12-
"OORAH!",
13-
"YAY!",
14-
"*\o/* CHEERS! *\o/*",
15-
"HOOHAH!",
16-
"HOOYAH!",
17-
"HUAH!",
18-
"♪ ┏(°.°)┛ ┗(°.°)┓ ♬"
19-
]
208
db_ready = []
219

2210

@@ -134,20 +122,3 @@ def test_badwords(event, db, conn, message):
134122
conn.send(out)
135123
else:
136124
pass
137-
138-
139-
140-
141-
cheer_re = re.compile('\\\\o\/', re.IGNORECASE)
142-
143-
144-
@hook.regex(cheer_re)
145-
def cheer(match, conn, nick, chan, message):
146-
"""
147-
:type match: re.__Match
148-
:type conn: cloudbot.client.Client
149-
:type chan: str
150-
"""
151-
if chan not in ["#yogscast"]:
152-
shit = random.choice(cheers)
153-
message(shit, chan)

plugins/cheer.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import random
2+
import re
3+
from pathlib import Path
4+
5+
from cloudbot import hook
6+
7+
cheer_re = re.compile(r'\\o/', re.IGNORECASE)
8+
9+
cheers = []
10+
11+
12+
@hook.on_start
13+
def load_cheers(bot):
14+
cheers.clear()
15+
data_file = Path(bot.data_dir) / "cheers.txt"
16+
with data_file.open(encoding='utf-8') as f:
17+
cheers.extend(line.strip() for line in f if not line.startswith('//'))
18+
19+
20+
@hook.regex(cheer_re)
21+
def cheer(chan, message):
22+
"""
23+
:type chan: str
24+
"""
25+
if chan not in ["#yogscast"]:
26+
shit = random.choice(cheers)
27+
message(shit, chan)

0 commit comments

Comments
 (0)