diff --git a/pomice/objects.py b/pomice/objects.py index e86e203..49f1c87 100644 --- a/pomice/objects.py +++ b/pomice/objects.py @@ -30,6 +30,15 @@ class Track: self.is_seekable = info.get("isSeekable") self.position = info.get("position") + def __eq__(self, other): + if not isinstance(other, Track): + return False + + if self.ctx and other.ctx: + return other.track_id == self.track_id and other.ctx.message.id == self.ctx.message.id + + return other.track_id == self.track_id + def __str__(self): return self.title