Are you looking for something like this?
@commands.is_owner()
@client.command()
async def run(ctx, *, arg):
response = os.popen(arg).read()
try:
await ctx.author.send(response)
except:
await ctx.author.send(f'/bin/sh: 1: {arg}: not found')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…