Add a \n between potential prints in eval() and printing the return from eval so

that bitbot will only show one of them
This commit is contained in:
jesopo 2018-10-12 12:46:05 +01:00
parent b884b0e170
commit 4700402db4

View file

@ -4,6 +4,7 @@ from src import ModuleManager, utils
EVAL_TEMPLATE = """
import sys
result = eval(sys.stdin.read())
print("")
if not result == None:
sys.stdout.write(str(result))
"""
@ -28,7 +29,7 @@ class Module(ModuleManager.BaseModule):
if page:
event["stdout"].write("%s: %s" % (event["user"].nickname,
page.split("</b></span><br>", 1)[1]))
page.split("</b></span><br>", 1)[1].strip("\n")))
else:
event["stderr"].write("%s: failed to eval" % event["user"].nickname)