Skip to content

Commit 2fc5a19

Browse files
committed
Prepend the callinhg user's nick to some joke commands to avoid running arbitrary commands
1 parent 0eb6b91 commit 2fc5a19

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

plugins/jokes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def load_jokes(bot):
4040
def yomomma(text, message, conn):
4141
"""input <nick>, tells a yo momma joke to <nick>"""
4242
target = text.strip()
43-
message('{}, {}'.format(target, random.choice(yo_momma).lower()))
43+
return '{}, {}'.format(target, random.choice(yo_momma).lower())
4444

4545
@hook.command(autohelp=False)
4646
def doit(message, conn):
@@ -94,7 +94,7 @@ def awesome(text, message):
9494
link = 'http://is-awesome.cool/{}'
9595
nick = text.split(' ')[0]
9696
if nick_re.match(nick):
97-
message("{}: I am blown away by your recent awesome action(s). Please read \x02{}\x02".format(nick, link.format(nick)))
97+
return "{}: I am blown away by your recent awesome action(s). Please read \x02{}\x02".format(nick, link.format(nick))
9898
else:
9999
return "Sorry I can't tell {} how awesome they are.".format(nick)
100100

@@ -115,7 +115,7 @@ def kero(text, message):
115115
out = keror + " " + text.upper()
116116
else:
117117
out = text.upper() + " " + keror
118-
message(out)
118+
return out
119119

120120
@hook.command(autohelp=False)
121121
def lawyerjoke(message, conn):

0 commit comments

Comments
 (0)