@commands.command(hidden=True, aliases=['removeslashcmd'])
async def remove_slash_cmd(self, ctx, cmd: discord.Object, guild: typing.Optional[discord.Guild]):
    if guild:
        (await self.bot.http.delete_guild_command(self.bot.application_id, guild.id, cmd.id))
    else:
        (await self.bot.http.delete_global_command(self.bot.application_id, cmd.id))
    (await ctx.reply('Removed command.'))
@commands.command(hidden=True, aliases=['removeslashcmd'])
async def remove_slash_cmd(self, ctx, cmd: discord.Object, guild: typing.Optional[discord.Guild]):
    if guild:
        (await self.bot.http.delete_guild_command(self.bot.application_id, guild.id, cmd.id))
    else:
        (await self.bot.http.delete_global_command(self.bot.application_id, cmd.id))
    (await ctx.reply('Removed command.'))