text: import time
  import aiohttp
  import discord
  import importlib
  import os
  import io
  import sys
  from discord.ext import commands
  from utils import permissions, default, http, dataIO
  meme_url = 'https://github.com/Jade9ja/AspiritusDiscord/blob/master/img/spooderman.jpg?raw=true'
  
  class management(commands.Cog):
      def __init__(self, client):
          self.client = client
          self.config = default.get("config.json")
          self._last_result = None
  
      @commands.command()
      async def ruadmin(self, ctx):
          """ Bruh, u iz admeme/owner? """
          if ctx.author.id in self.config.owners:
              return await ctx.send(f"Hello admeme/owner **{ctx.author.name}** senpai!😊 ")
          if ctx.author.id == 464316695964811267:
              async with aiohttp.ClientSession() as session:
                  async with session.get(meme_url) as resp:
                      if resp.status != 200:
                          return await ctx.send('Could not download file...')
                      data = io.BytesIO(await resp.read())
                      await ctx.send(file=discord.File(data, 'spooderman.jpg'))
          await ctx.send(f"Just yeeet off...😒 {ctx.author.name}")
  
      @commands.command()
      @commands.check(permissions.is_owner)
      async def load(self, ctx, name: str):
          """ Loads an extension. """
          try:
              self.client.load_extension(f"cogs.{name}")
          except Exception as e:
              return await ctx.send(default.traceback_maker(e))
          await ctx.send(f"Loaded extension **{name}.py**")
  
      @commands.command()
      @commands.check(permissions.is_owner)
      async def unload(self, ctx, name: str):
          """ Unloads an extension. """
          try:
              self.client.unload_extension(f"cogs.{name}")
          except Exception as e:
              return await ctx.send(default.traceback_maker(e))
          await ctx.send(f"Unloaded extension **{name}.py**")
  
      @commands.command()
      @commands.check(permissions.is_owner)
      async def reload(self, ctx, name: str):
          """ Reloads an extension. """
          try:
              self.client.reload_extension(f"cogs.{name}")
          except Exception as e:
              return await ctx.send(default.traceback_maker(e))
          await ctx.send(f"Reloaded extension **{name}.py**")
  
      @commands.command()
      @commands.check(permissions.is_owner)
      async def reloadall(self, ctx):
          """ Reloads all extensions. """
          error_collection = []
          for file in os.listdir("cogs"):
              if file.endswith(".py"):
                  name = file[:-3]
                  try:
                      self.client.reload_extension(f"cogs.{name}")
                  except Exception as e:
                      error_collection.append(
                          [file, default.traceback_maker(e, advance=False)]
                      )
  
          if error_collection:
              output = "\n".join([f"**{g[0]}** ```diff\n- {g[1]}```" for g in error_collection])
              return await ctx.send(
                  f"Attempted to reload all extensions, was able to reload, "
                  f"however the following failed...\n\n{output}"
              )
  
          await ctx.send("Successfully reloaded all extensions")
  
      @commands.command()
      @commands.check(permissions.is_owner)
      async def reloadutils(self, ctx, name: str):
          """ Reloads a utils module. """
          name_maker = f"utils/{name}.py"
          try:
              module_name = importlib.import_module(f"utils.{name}")
              importlib.reload(module_name)
          except ModuleNotFoundError:
              return await ctx.send(f"Couldn't find module named **{name_maker}**")
          except Exception as e:
              error = default.traceback_maker(e)
              return await ctx.send(f"Module **{name_maker}** returned error and was not reloaded...\n{error}")
          await ctx.send(f"Reloaded module **{name_maker}**")
  
      @commands.command()
      @commands.check(permissions.is_owner)
      async def reboot(self, ctx):
          """ Reboot the client """
          await ctx.send('Rebooting now...')
          time.sleep(1)
          sys.exit(0)
  
      @commands.command()
      @commands.check(permissions.is_owner)
      async def dm(self, ctx, user_id: int, *, message: str):
          """ DM the user of your choice """
          user = self.client.get_user(user_id)
          if not user:
              return await ctx.send(f"Could not find any UserID matching **{user_id}**")
  
          try:
              await user.send(message)
              await ctx.send(f"📩 Sent a DM to **{user_id}**")
          except discord.Forbidden:
              await ctx.send("This user might be having DMs blocked or it's a client account...")
  
      @commands.group()
      @commands.check(permissions.is_owner)
      async def change(self, ctx):
          if ctx.invoked_subcommand is None:
              await ctx.send_help(str(ctx.command))
  
      @change.command(name="playing")
      @commands.check(permissions.is_owner)
      async def change_playing(self, ctx, *, playing: str):
          """ Change playing status. """
          if self.config.status_type == "idle":
              status_type = discord.Status.idle
          elif self.config.status_type == "dnd":
              status_type = discord.Status.dnd
          else:
              status_type = discord.Status.online
  
          if self.config.playing_type == "listening":
              playing_type = 2
          elif self.config.playing_type == "watching":
              playing_type = 3
          else:
              playing_type = 0
  
          try:
              await self.client.change_presence(
                  activity=discord.Activity(type=playing_type, name=playing),
                  status=status_type
              )
              dataIO.change_value("config.json", "playing", playing)
              await ctx.send(f"Successfully changed playing status to **{playing}**")
          except discord.InvalidArgument as err:
              await ctx.send(err)
          except Exception as e:
              await ctx.send(e)
  
      @change.command(name="username")
      @commands.check(permissions.is_owner)
      async def change_username(self, ctx, *, name: str):
          """ Change username. """
          try:
              await self.client.user.edit(username=name)
              await ctx.send(f"Successfully changed username to **{name}**")
          except discord.HTTPException as err:
              await ctx.send(err)
  
      @change.command(name="nickname")
      @commands.check(permissions.is_owner)
      async def change_nickname(self, ctx, *, name: str = None):
          """ Change nickname. """
          try:
              await ctx.guild.me.edit(nick=name)
              if name:
                  await ctx.send(f"Successfully changed nickname to **{name}**")
              else:
                  await ctx.send("Successfully removed nickname")
          except Exception as err:
              await ctx.send(err)
  
      @change.command(name="avatar")
      @commands.check(permissions.is_owner)
      async def change_avatar(self, ctx, url: str = None):
          """ Change avatar. """
          if url is None and len(ctx.message.attachments) == 1:
              url = ctx.message.attachments[0].url
          else:
              url = url.strip('<>') if url else None
  
          try:
              bio = await http.get(url, res_method="read")
              await self.client.user.edit(avatar=bio)
              await ctx.send(f"Successfully changed the avatar. Currently using:\n{url}")
          except aiohttp.InvalidURL:
              await ctx.send("The URL is invalid...")
          except discord.InvalidArgument:
              await ctx.send("This URL does not contain a useable image")
          except discord.HTTPException as err:
              await ctx.send(err)
          except TypeError:
              await ctx.send("You need to either provide an image URL or upload one with the command")
  
  
  def setup(client):
      client.add_cog(management(client))