add shell cmd

This commit is contained in:
Luna Mendes 2017-12-23 15:50:52 -03:00
parent 2cb041986d
commit 686b1e5974

View file

@ -7,6 +7,7 @@ from discord.ext import commands
from .common import Cog from .common import Cog
from .utils import Table, Timer from .utils import Table, Timer
from .rsudo import shell
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -82,6 +83,14 @@ class Admin(Cog):
m = ctx.send(f':ok_hand: Reloaded `{ext}`') m = ctx.send(f':ok_hand: Reloaded `{ext}`')
self.bot.loop.create_task(m) 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) @commands.command(typing=True)
async def sql(self, ctx, *, statement: no_codeblock): async def sql(self, ctx, *, statement: no_codeblock):
"""Execute SQL.""" """Execute SQL."""