1
0
Fork 0
mirror of synced 2024-04-27 01:02:50 +12:00

Remove escaping since it's a raw string

This commit is contained in:
Dan Hess 2021-04-01 00:19:24 -08:00
parent 44f5bc2c74
commit 56dcbb9a3d

View file

@ -200,13 +200,10 @@ class Owner(commands.Cog):
proc = await asyncio.create_subprocess_shell(
cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.STDOUT
)
m = r"(https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b[-a-zA-Z0-9()@:%_\+.~#?&//=]*)"
stdout = (await proc.communicate())[0]
if stdout:
output = re.sub(
r"(https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b[-a-zA-Z0-9()@:%_\\+.~#?&//=]*)",
r"<\1>",
stdout.decode(),
)
output = re.sub(m, r"<\1>", stdout.decode())
await ctx.send(f"[stdout]\n{output}")
else:
await ctx.send("Process finished, no output")