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
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:
        id: The gamepass ID.
        name: The gamepass name.
        display_name: The gamepass display name.
        price: The gamepass price.
    """

    def __init__(self, client: Client, data: dict):
        self._client: Client = client
        self.id: int = data["id"]
        super().__init__(client=self._client, 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, client: Client, data: dict) special

Source code in roblox/gamepasses.py
def __init__(self, client: Client, data: dict):
    self._client: Client = client
    self.id: int = data["id"]
    super().__init__(client=self._client, 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}>"