fix: added docstring

This commit is contained in:
Seaswimmer 2023-08-07 09:46:11 -04:00
parent 6319595c8b
commit beee10f303
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -36,13 +36,14 @@ class Galaxy(commands.Cog):
@commands.command() @commands.command()
@checks.is_owner() @checks.is_owner()
async def nslookup(self, ctx: commands.Context, *, website: str): async def nslookup(self, ctx: commands.Context, *, website: str):
"""This command uses `nslookup` to check the IP Address of any given website."""
try: try:
result = subprocess.run(['nslookup', website], capture_output=True, text=True, check=True) result = subprocess.run(['nslookup', website], capture_output=True, text=True, check=True)
await ctx.send(f"```\n{result.stdout}\n```") await ctx.send(f"```\n{result.stdout}\n```")
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
await ctx.send(f"Error executing nslookup: {e}") await ctx.send(f"Error executing `nslookup`: `{e}`")
except FileNotFoundError: except FileNotFoundError:
await ctx.send("nslookup command not found. Make sure you have nslookup installed and it's in your system PATH.") await ctx.send("`nslookup` command not found. Make sure you have nslookup installed and it's in your system PATH.")
@commands.command() @commands.command()