text: import discord
  from discord.ext import commands
  import time
  
  
  class SomeCommands(commands.Cog):
      """A couple of simple commands."""
  
      def __init__(self, bot: commands.Bot):
          self.bot = bot
          self.last_msg = None
  
  
      @commands.command(name="setstatus")
      @commands.is_owner()
      @commands.cooldown(rate=1, per=30)
      async def setstatus(self, ctx: commands.Context, *, text: str):
          """Set the bot's status."""
          await self.bot.change_presence(activity=discord.Game(name=text))
  
      @setstatus.error
      async def setstatus_error(self, ctx: commands.Context, error):
          if isinstance(error, commands.CommandOnCooldown):
              await ctx.send(f"This command is on cooldown, try again after {round(error.retry_after)} seconds.",
                             delete_after=5)
          print(error)
  
      @commands.Cog.listener()
      async def on_member_join(self, member: discord.Member):
          channel = self.bot.get_channel(799309066202775624)
  
          if not channel:
              return
  
          await channel.send(f"Welcome, {member}!")
  
      @commands.command(name="ping")
      async def ping(self, ctx: commands.Context):
          """Get the bot's current websocket and API latency."""
          start_time = time.time()
          message = await ctx.send("Testing Ping...")
          end_time = time.time()
  
          await message.edit(
              content=f"Pong! {round(self.bot.latency * 1000)}ms\nAPI: {round((end_time - start_time) * 1000)}ms")
  
      @commands.Cog.listener()
      async def on_message_delete(self, message: discord.Message):
          self.last_msg = message
  
      @commands.command(name="snipe")
      async def snipe(self, ctx: commands.Context):
          """A command to snipe delete messages."""
          if not self.last_msg:  # on_message_delete hasn't been triggered since the bot started
              await ctx.send("There is no message to snipe!")
              return
  
          author = self.last_msg.author
          content = self.last_msg.content
  
          embed = discord.Embed(title=f"Message from {author}", description=content)
          await ctx.send(embed=embed)
  
      @commands.Cog.listener()
      async def on_command_error(self, ctx: commands.Context, error: commands.CommandError):
          """A global error handler cog."""
  
          if isinstance(error, commands.CommandNotFound):
              return  # Return because we don't want to show an error for every command not found
          elif isinstance(error, commands.CommandOnCooldown):
              message = f"This command is on cooldown. Please try again after {round(error.retry_after, 1)} seconds."
          elif isinstance(error, commands.MissingPermissions):
              message = "You are missing the required permissions to run this command!"
          elif isinstance(error, commands.UserInputError):
              message = "Something about your input was wrong, please check your input and try again!"
          else:
              message = "Oh no! Something went wrong while running the command!"
  
          await ctx.send(message, delete_after=5)
          await ctx.message.delete(delay=5)
  
   
  
  
  def setup(bot: commands.Bot):
      bot.add_cog(SomeCommands(bot))