Skip to content

gamepasses

Contains classes related to Roblox gamepass data and parsing.

GamePass

Bases: 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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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"]