Skip to content

Commit 5f13b96

Browse files
authored
Merge pull request CloudBotIRC#139 from linuxdaemon/gonzobot+cahb-exploit-fix
gnomesagainsthumanity.py exploit fix
2 parents db5cce1 + 29e8a8c commit 5f13b96

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

plugins/gnomeagainsthumanity.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ def shuffle_deck(bot):
1515
gnomecards = json.load(f)
1616

1717

18-
18+
1919
@hook.command('cah')
2020
def CAHwhitecard(text, message):
2121
'''Submit text to be used as a CAH whitecard'''
2222
CardText = text.strip()
23-
message(random.choice(gnomecards['black']).format(text))
23+
return random.choice(gnomecards['black']).format(text)
2424

2525

2626
@hook.command('cahb')
@@ -31,5 +31,5 @@ def CAHblackcard(text, message):
3131
def blankfiller(matchobj):
3232
return random.choice(gnomecards['white'])
3333

34-
out = re.sub(r'_', blankfiller, CardText)
35-
message(out)
34+
out = re.sub(r'\b_\b', blankfiller, CardText)
35+
return out

0 commit comments

Comments
 (0)