Skip to content

Commit d33d03a

Browse files
authored
Merge pull request #233 from plun1331/feature/slash
Fix help command in cogs
2 parents 61372d0 + 18b6d7f commit d33d03a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

discord/cog.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,12 @@ def remove_cog(self, name: str) -> Optional[Cog]:
591591
cog = self.__cogs.pop(name, None)
592592
if cog is None:
593593
return
594+
595+
if hasattr(self, "_help_command"):
596+
help_command = self._help_command
597+
if help_command and help_command.cog is cog:
598+
help_command.cog = None
594599

595-
help_command = self._help_command
596-
if help_command and help_command.cog is cog:
597-
help_command.cog = None
598600
cog._eject(self)
599601

600602
return cog

0 commit comments

Comments
 (0)