diff --git a/seautils/seautils.py b/seautils/seautils.py index ad22a84..e68f3f3 100644 --- a/seautils/seautils.py +++ b/seautils/seautils.py @@ -8,6 +8,7 @@ import asyncio import inspect import operator +from asyncio.subprocess import Process from functools import partial, partialmethod from typing import Any @@ -97,8 +98,13 @@ class SeaUtils(commands.Cog): command_opts.extend(['-p', port]) command_opts.extend(['+yaml']) - process = await asyncio.create_subprocess_exec(*command_opts, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE) - stdout, stderr = await process.communicate() + try: + process: Process = await asyncio.create_subprocess_exec(*command_opts, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE) + stdout, stderr = await process.communicate() + except (FileNotFoundError): + await ctx.maybe_send_embed(content="The `dig` command is not installed on this system.") + return + if stderr: await ctx.maybe_send_embed(content= "An error was encountered!\n" + cf.box(text=stderr.decode())) else: