diff --git a/CHANGELOG.md b/CHANGELOG.md index 02f8a477ad..3643ef35f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -211,6 +211,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2303](https://github.com/Pycord-Development/pycord/issues/2303)) - Fixed `self.use_default_buttons` being assumed truthy by `Paginator.update`. ([#2319](https://github.com/Pycord-Development/pycord/pull/2319)) +- Fixed `AttributeError` when comparing application commands with non-command objects. + ([#2299](https://github.com/Pycord-Development/pycord/issues/2299)) ## [2.4.1] - 2023-03-20 diff --git a/discord/commands/core.py b/discord/commands/core.py index 7328da1b05..6a9825b384 100644 --- a/discord/commands/core.py +++ b/discord/commands/core.py @@ -235,15 +235,10 @@ def __repr__(self) -> str: return f"" def __eq__(self, other) -> bool: - if ( - getattr(self, "id", None) is not None - and getattr(other, "id", None) is not None - ): - check = self.id == other.id - else: - check = self.name == other.name and self.guild_ids == other.guild_ids return ( - isinstance(other, self.__class__) and self.parent == other.parent and check + isinstance(other, self.__class__) + and self.qualified_name == other.qualified_name + and self.guild_ids == other.guild_ids ) async def __call__(self, ctx, *args, **kwargs):