1
0
Fork 0
mirror of synced 2024-05-05 05:02:30 +12:00

Add a check if no output is found

This commit is contained in:
Phxntxm 2018-01-12 15:41:12 -06:00
parent 936040a6c8
commit 37270d6b6c

View file

@ -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)