mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Dev] Fixed [p]repl, sanitize [p]eval output
This commit is contained in:
parent
9b4581a781
commit
b12a41cd77
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user