Fix duplicate commands in fuzzy help (#2798)

* Fix duplicate commands in fuzzy help

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Use help command's filter for all fuzzy

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
Toby Harradine
2019-06-28 03:31:44 +10:00
committed by Michael H
parent 461f56bca1
commit f3bbfdc64d
3 changed files with 25 additions and 14 deletions

View File

@@ -13,6 +13,7 @@ import pkg_resources
from colorama import Fore, Style, init
from pkg_resources import DistributionNotFound
from redbot.core.commands import RedHelpFormatter
from .. import __version__ as red_version, version_info as red_version_info, VersionInfo
from . import commands
from .config import get_latest_confs
@@ -201,7 +202,12 @@ def init_events(bot, cli_flags):
bot._last_exception = exception_log
await ctx.send(inline(message))
elif isinstance(error, commands.CommandNotFound):
fuzzy_commands = await fuzzy_command_search(ctx)
fuzzy_commands = await fuzzy_command_search(
ctx,
commands={
c async for c in RedHelpFormatter.help_filter_func(ctx, bot.walk_commands())
},
)
if not fuzzy_commands:
pass
elif await ctx.embed_requested():