Slipstream 132521fa39
Some checks failed
Deploy MkDocs / deploy (push) Has been cancelled
Add Object class and partial docs (#113)
2025-06-15 20:39:23 -06:00

20 lines
478 B
Python

class Object:
"""A minimal wrapper around a Discord snowflake ID."""
__slots__ = ("id",)
def __init__(self, object_id: int) -> None:
self.id = int(object_id)
def __int__(self) -> int:
return self.id
def __hash__(self) -> int:
return hash(self.id)
def __eq__(self, other: object) -> bool:
return isinstance(other, Object) and self.id == other.id
def __repr__(self) -> str:
return f"<Object id={self.id}>"