From 37270d6b6c5e8ade394a205d08b5d079bbae547d Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Fri, 12 Jan 2018 15:41:12 -0600 Subject: [PATCH] Add a check if no output is found --- cogs/owner.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cogs/owner.py b/cogs/owner.py index 5a89603..e284b2a 100644 --- a/cogs/owner.py +++ b/cogs/owner.py @@ -255,7 +255,9 @@ class Owner: """Runs a bash command""" output = subprocess.check_output("{}; exit 0".format(cmd), stderr=subprocess.STDOUT, shell=True) if output: - await ctx.send("\n```\n{}```".format(output.decode("utf-8", "ignore").strip())) + await ctx.send("```\n{}\n```".format(output.decode("utf-8", "ignore").strip())) + else: + await ctx.send("No output for `{}`".format(cmd)) @commands.command() @commands.check(utils.is_owner)