[Dev] Fixed [p]repl, sanitize [p]eval output

This commit is contained in:
Twentysix 2017-06-17 19:12:53 +02:00
parent 9b4581a781
commit b12a41cd77

View File

@ -135,6 +135,7 @@ class Dev:
if ret is None: if ret is None:
if value: if value:
value = self.sanitize_output(ctx, value)
await ctx.send(box(value, lang="py")) await ctx.send(box(value, lang="py"))
else: else:
ret = self.sanitize_output(ctx, ret) ret = self.sanitize_output(ctx, ret)
@ -208,7 +209,6 @@ class Dev:
result = executor(code, variables) result = executor(code, variables)
if inspect.isawaitable(result): if inspect.isawaitable(result):
result = await result result = await result
result = self.sanitize_output(ctx, result)
except: except:
value = stdout.getvalue() value = stdout.getvalue()
value = self.sanitize_output(ctx, value) value = self.sanitize_output(ctx, value)
@ -223,6 +223,7 @@ class Dev:
try: try:
for page in pagify(msg, shorten_by=12): for page in pagify(msg, shorten_by=12):
page = self.sanitize_output(ctx, page)
await ctx.send(box(page, "py")) await ctx.send(box(page, "py"))
except discord.Forbidden: except discord.Forbidden:
pass pass