add shell cmd

This commit is contained in:
Luna Mendes 2017-12-23 15:50:52 -03:00
parent 2cb041986d
commit 686b1e5974
1 changed files with 9 additions and 0 deletions

View File

@ -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."""