Skip to content

Commit

Permalink
fix: ApplicationCommand.__eq__
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorukyum committed Dec 25, 2023
1 parent 16c696c commit f1e4be2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,9 @@ def __repr__(self) -> str:
return f"<discord.commands.{self.__class__.__name__} name={self.name}>"

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.to_dict() == other.to_dict()
)

async def __call__(self, ctx, *args, **kwargs):
Expand Down

0 comments on commit f1e4be2

Please sign in to comment.