Browse Source

[commands] fix HelpCommand not carrying over checks

update command impl over creating new one
pull/9857/head
z03h 10 months ago
committed by GitHub
parent
commit
d18f14c173
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 10
      discord/ext/commands/help.py

10
discord/ext/commands/help.py

@ -297,6 +297,11 @@ class _HelpCommandImpl(Command):
# Revert `on_error` to use the original one in case of race conditions
self.on_error = self._injected.on_help_command_error
def update(self, **kwargs: Any) -> None:
cog = self.cog
self.__init__(self._original, **dict(self.__original_kwargs__, **kwargs))
self.cog = cog
class HelpCommand:
r"""The base implementation for help command formatting.
@ -377,9 +382,8 @@ class HelpCommand:
return obj
def _add_to_bot(self, bot: BotBase) -> None:
command = _HelpCommandImpl(self, **self.command_attrs)
bot.add_command(command)
self._command_impl = command
self._command_impl.update(**self.command_attrs)
bot.add_command(self._command_impl)
def _remove_from_bot(self, bot: BotBase) -> None:
bot.remove_command(self._command_impl.name)

Loading…
Cancel
Save