Skip to content

gamepasses

roblox.gamepasses

Contains classes related to Roblox gamepass data and parsing.

GamePass (BaseGamePass)

Represents a Roblox gamepass.

Attributes:

Name Type Description
_shared ClientSharedObject

The shared object.

id int

The gamepass ID.

name str

The gamepass name.

display_name str

The gamepass display name.

price Optional[int]

The gamepass price.

Source code in roblox/gamepasses.py
class GamePass(BaseGamePass):
    """
    Represents a Roblox gamepass.

    Attributes:
        _shared: The shared object.
        id: The gamepass ID.
        name: The gamepass name.
        display_name: The gamepass display name.
        price: The gamepass price.
    """

    def __init__(self, shared: ClientSharedObject, data: dict):
        self._shared: ClientSharedObject = shared
        self.id: int = data["id"]
        super().__init__(shared=self._shared, gamepass_id=self.id)
        self.name: str = data["name"]
        self.display_name: str = data["displayName"]
        # TODO: add product here
        self.price: Optional[int] = data["price"]

    def __repr__(self):
        return f"<{self.__class__.__name__} id={self.id} name={self.name!r} price={self.price}>"

__init__(self, shared: ClientSharedObject, data: dict) special

Source code in roblox/gamepasses.py
def __init__(self, shared: ClientSharedObject, data: dict):
    self._shared: ClientSharedObject = shared
    self.id: int = data["id"]
    super().__init__(shared=self._shared, gamepass_id=self.id)
    self.name: str = data["name"]
    self.display_name: str = data["displayName"]
    # TODO: add product here
    self.price: Optional[int] = data["price"]

__repr__(self) special

Source code in roblox/gamepasses.py
def __repr__(self):
    return f"<{self.__class__.__name__} id={self.id} name={self.name!r} price={self.price}>"