From 686b1e5974e8aa53d735cec51bd0444faf5d313f Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Sat, 23 Dec 2017 15:50:52 -0300 Subject: [PATCH] add shell cmd --- bot/ext/admin.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bot/ext/admin.py b/bot/ext/admin.py index f1bfcc1..d5eadcf 100644 --- a/bot/ext/admin.py +++ b/bot/ext/admin.py @@ -7,6 +7,7 @@ from discord.ext import commands from .common import Cog from .utils import Table, Timer +from .rsudo import shell log = logging.getLogger(__name__) @@ -82,6 +83,14 @@ class Admin(Cog): m = ctx.send(f':ok_hand: Reloaded `{ext}`') self.bot.loop.create_task(m) + @commands.command() + @commands.is_owner() + async def shell(self, ctx, *, input_data: str): + with ctx.typing(): + output = await shell(input_data) + + await ctx.send(f'```\n{output}\n```') + @commands.command(typing=True) async def sql(self, ctx, *, statement: no_codeblock): """Execute SQL."""