import json
import sys
from discord.ext import commands


class Owner:
    """Commands restricted to the bot owner."""

    def __init__(self, bot):
        self.bot = bot

    async def __local_check(self, ctx):
        return await self.bot.is_owner(ctx.author)

    @commands.command()
    async def reload(self, ctx, extension):
        """Reloads an extension."""
        extension = f'cogs.{extension}'
        try:
            self.bot.unload_extension(extension)
            self.bot.load_extension(extension)
        except (AttributeError, ImportError) as ex:
            await ctx.send(f'```py\n{type(ex).__name__}: {str(ex)}\n```')
            return
        await ctx.send(f'{extension} has been successfully reloaded.')

    @commands.command()
    async def load(self, ctx, extension):
        """Loads an extension."""
        extension = f'cogs.{extension}'
        try:
            self.bot.load_extension(extension)
        except (AttributeError, ImportError) as ex:
            await ctx.send(f'```py\n{type(ex).__name__}: {str(ex)}\n```')
            return
        await ctx.send(f'{extension} has been successfully loaded.')

    @commands.command()
    async def unload(self, ctx, extension):
        """Unloads an extension."""
        extension = f'cogs.{extension}'
        try:
            self.bot.unload_extension(extension)
        except (AttributeError, ImportError) as ex:
            await ctx.send(f'```py\n{type(ex).__name__}: {str(ex)}\n```')
            return
        await ctx.send(f'{extension} has been successfully unloaded.')


def setup(bot):
    bot.add_cog(Owner(bot))

@@ -1,12 +1,27 @@
+import asyncio%0A
 import json%0A
@@ -1581,16 +1581,439 @@
 ded.')%0A%0A
+    @commands.command()%0A    async def bash(self, ctx, command):%0A        %22%22%22Run a bash command.%22%22%22%0A        process = await asyncio.create_subprocess_shell(%0A            command,%0A            stdout=asyncio.subprocess.PIPE,%0A            stderr=asyncio.subprocess.PIPE)%0A%0A        stdout, stderr = await process.communicate()%0A%0A        if stdout:%0A            await ctx.send(stdout)%0A        else:%0A            await ctx.send(stderr)%0A%0A
 %0Adef set

Add bash command