@commands.command(hidden=True, aliases=['removeallslashcmds'])
async def remove_all_slash_cmds(self, ctx, guild: typing.Optional[discord.Guild]):
    if (not guild):
        app_cmds = (await self.bot.http.get_global_commands(self.bot.application_id))
    else:
        app_cmds = (await self.bot.http.get_guild_commands(self.bot.application_id, guild.id))
    slash_cmd_ids = [e['id'] for e in app_cmds if (e.get('type', 0) == 1)]
    for cmd_id in slash_cmd_ids:
        if (not guild):
            (await self.bot.http.delete_global_command(self.bot.application_id, cmd_id))
        else:
            (await self.bot.http.delete_guild_command(self.bot.application_id, guild.id, cmd_id))
    (await ctx.reply('Removed all commands.'))
@commands.command(hidden=True, aliases=['removeallslashcmds'])
async def remove_all_slash_cmds(self, ctx, guild: typing.Optional[discord.Guild]):
    if (not guild):
        app_cmds = (await self.bot.http.get_global_commands(self.bot.application_id))
    else:
        app_cmds = (await self.bot.http.get_guild_commands(self.bot.application_id, guild.id))
    slash_cmd_ids = [e['id'] for e in app_cmds if (e.get('type', 0) == 1)]
    for cmd_id in slash_cmd_ids:
        if (not guild):
            (await self.bot.http.delete_global_command(self.bot.application_id, cmd_id))
        else:
            (await self.bot.http.delete_guild_command(self.bot.application_id, guild.id, cmd_id))
    (await ctx.reply('Removed all commands.'))