From 480e573236a954cad7fd322cd52b7e981baf804c Mon Sep 17 00:00:00 2001 From: Dorukyum Date: Wed, 3 Jan 2024 19:29:54 +0300 Subject: [PATCH] fix: remove all references to cog being MISSING --- discord/commands/core.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/discord/commands/core.py b/discord/commands/core.py index e3c904c1af..aff52c8108 100644 --- a/discord/commands/core.py +++ b/discord/commands/core.py @@ -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): @@ -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)