mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
[commands] fix HelpCommand not carrying over checks
update command impl over creating new one
This commit is contained in:
parent
efe81a67fb
commit
d18f14c173
@ -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…
x
Reference in New Issue
Block a user