[commands] Revert back to older help command implementation

The newer implementation did not play nicely with spawned tasks and
accessing HelpCommand.context, which was a frequent pain point when
writing paginated help commands.
This commit is contained in:
Rapptz
2022-03-31 02:42:17 -04:00
parent b4fbb08818
commit 29668c51ae
3 changed files with 193 additions and 119 deletions

View File

@ -354,7 +354,6 @@ class Context(discord.abc.Messageable, Generic[BotT]):
"""
from .core import Group, Command, wrap_callback
from .errors import CommandError
from .help import _context
bot = self.bot
cmd = bot.help_command
@ -362,7 +361,8 @@ class Context(discord.abc.Messageable, Generic[BotT]):
if cmd is None:
return None
_context.set(self)
cmd = cmd.copy()
cmd.context = self
if len(args) == 0:
await cmd.prepare_help_command(self, None)