Fix bug in help pages because of slash commands

pull/104/head
Stijn De Clercq 2022-02-03 01:52:26 +01:00
parent 853b708ece
commit 17964a23fb
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
from data import constants from data import constants
import discord import discord
from discord.commands import SlashCommand
from discord.ext import commands from discord.ext import commands
from enums.help_categories import categories, getCategory, Category from enums.help_categories import categories, getCategory, Category
import json import json
@ -49,7 +50,7 @@ class HelpCommand(commands.MinimalHelpCommand):
return await self.send_bot_help(self.get_bot_mapping()) return await self.send_bot_help(self.get_bot_mapping())
# Turn dic to lowercase to allow proper name searching # Turn dic to lowercase to allow proper name searching
all_commands = dict((k.lower(), v) for k, v in bot.all_commands.items()) all_commands = dict((k.lower(), v) for k, v in bot.all_commands.items() if not isinstance(v, SlashCommand))
if spl[0].lower() not in all_commands: if spl[0].lower() not in all_commands:
return await self.send_error_message(await self.command_not_found(spl[0])) return await self.send_error_message(await self.command_not_found(spl[0]))