mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-04 01:00:00 +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
|
# Revert `on_error` to use the original one in case of race conditions
|
||||||
self.on_error = self._injected.on_help_command_error
|
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:
|
class HelpCommand:
|
||||||
r"""The base implementation for help command formatting.
|
r"""The base implementation for help command formatting.
|
||||||
@ -377,9 +382,8 @@ class HelpCommand:
|
|||||||
return obj
|
return obj
|
||||||
|
|
||||||
def _add_to_bot(self, bot: BotBase) -> None:
|
def _add_to_bot(self, bot: BotBase) -> None:
|
||||||
command = _HelpCommandImpl(self, **self.command_attrs)
|
self._command_impl.update(**self.command_attrs)
|
||||||
bot.add_command(command)
|
bot.add_command(self._command_impl)
|
||||||
self._command_impl = command
|
|
||||||
|
|
||||||
def _remove_from_bot(self, bot: BotBase) -> None:
|
def _remove_from_bot(self, bot: BotBase) -> None:
|
||||||
bot.remove_command(self._command_impl.name)
|
bot.remove_command(self._command_impl.name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user