Remove escaping since it's a raw string
This commit is contained in:
parent
44f5bc2c74
commit
56dcbb9a3d
|
@ -200,13 +200,10 @@ class Owner(commands.Cog):
|
||||||
proc = await asyncio.create_subprocess_shell(
|
proc = await asyncio.create_subprocess_shell(
|
||||||
cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.STDOUT
|
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]
|
stdout = (await proc.communicate())[0]
|
||||||
if stdout:
|
if stdout:
|
||||||
output = re.sub(
|
output = re.sub(m, r"<\1>", stdout.decode())
|
||||||
r"(https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b[-a-zA-Z0-9()@:%_\\+.~#?&//=]*)",
|
|
||||||
r"<\1>",
|
|
||||||
stdout.decode(),
|
|
||||||
)
|
|
||||||
await ctx.send(f"[stdout]\n{output}")
|
await ctx.send(f"[stdout]\n{output}")
|
||||||
else:
|
else:
|
||||||
await ctx.send("Process finished, no output")
|
await ctx.send("Process finished, no output")
|
||||||
|
|
Loading…
Reference in a new issue