Skip to content

Commit

Permalink
fix: remove all references to cog being MISSING
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorukyum committed Jan 3, 2024
1 parent 81a79cf commit 480e573
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ def _is_typing_annotated(self, annotation):

@property
def cog(self):
return getattr(self, "_cog", MISSING)
return getattr(self, "_cog", None)

@cog.setter
def cog(self, val):
Expand Down Expand Up @@ -1238,10 +1238,7 @@ def to_dict(self) -> dict:
return as_dict

def add_command(self, command: SlashCommand) -> None:
# check if subcommand has no cog set
# also check if cog is MISSING because it
# might not have been set by the cog yet
if command.cog is MISSING and self.cog is not MISSING:
if command.cog is None and self.cog is not None:
command.cog = self.cog

self.subcommands.append(command)
Expand Down

0 comments on commit 480e573

Please sign in to comment.