Add a check if no output is found
This commit is contained in:
parent
936040a6c8
commit
37270d6b6c
|
@ -255,7 +255,9 @@ class Owner:
|
||||||
"""Runs a bash command"""
|
"""Runs a bash command"""
|
||||||
output = subprocess.check_output("{}; exit 0".format(cmd), stderr=subprocess.STDOUT, shell=True)
|
output = subprocess.check_output("{}; exit 0".format(cmd), stderr=subprocess.STDOUT, shell=True)
|
||||||
if output:
|
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.command()
|
||||||
@commands.check(utils.is_owner)
|
@commands.check(utils.is_owner)
|
||||||
|
|
Loading…
Reference in a new issue