mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Fix whois
This commit is contained in:
parent
61fb6cb382
commit
8f94fbed2d
1 changed files with 3 additions and 1 deletions
|
@ -2341,10 +2341,12 @@ class OtherCog(commands.Cog):
|
||||||
return await ctx.respond("Invalid domain.")
|
return await ctx.respond("Invalid domain.")
|
||||||
|
|
||||||
process = await asyncio.create_subprocess_exec(
|
process = await asyncio.create_subprocess_exec(
|
||||||
"whois", "-H", url.hostname, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, text=True
|
"whois", "-H", url.hostname, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
|
||||||
)
|
)
|
||||||
stdout, stderr = await process.communicate()
|
stdout, stderr = await process.communicate()
|
||||||
await process.wait()
|
await process.wait()
|
||||||
|
stdout = stdout.decode("utf-8", "replace")
|
||||||
|
stderr = stderr.decode("utf-8", "replace")
|
||||||
if process.returncode != 0:
|
if process.returncode != 0:
|
||||||
return await ctx.respond(f"Error:\n```{stderr[:3900]}```")
|
return await ctx.respond(f"Error:\n```{stderr[:3900]}```")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue