[commands] Fix Command.cog being reset after update

This commit is contained in:
Josh 2022-02-18 23:31:45 +10:00 committed by GitHub
parent ce01033e06
commit b1571ccc25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -449,7 +449,9 @@ class Command(_BaseCommand, Generic[CogT, P, T]):
of parameters in that they are passed to the :class:`Command` or of parameters in that they are passed to the :class:`Command` or
subclass constructors, sans the name and callback. subclass constructors, sans the name and callback.
""" """
cog = self.cog
self.__init__(self.callback, **dict(self.__original_kwargs__, **kwargs)) self.__init__(self.callback, **dict(self.__original_kwargs__, **kwargs))
self.cog = cog
async def __call__(self, context: Context, *args: P.args, **kwargs: P.kwargs) -> T: async def __call__(self, context: Context, *args: P.args, **kwargs: P.kwargs) -> T:
"""|coro| """|coro|