Skip to content

partialrole

roblox.partials.partialrole

This file contains partial objects related to Roblox group roles.

PartialRole (BaseRole)

Represents partial group role information.

Attributes:

Name Type Description
_client Client

The Client object.

id int

The role's ID.

name str

The role's name.

rank int

The role's rank ID.

Source code in roblox/partials/partialrole.py
class PartialRole(BaseRole):
    """
    Represents partial group role information.

    Attributes:
        _client: The Client object.
        id: The role's ID.
        name: The role's name.
        rank: The role's rank ID.
    """

    def __init__(self, client: Client, data: dict):
        self._client: Client = client

        self.id: int = data["id"]
        super().__init__(client=self._client, role_id=self.id)
        self.name: str = data["name"]
        self.rank: int = data["rank"]

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

__init__(self, client: Client, data: dict) special

Source code in roblox/partials/partialrole.py
def __init__(self, client: Client, data: dict):
    self._client: Client = client

    self.id: int = data["id"]
    super().__init__(client=self._client, role_id=self.id)
    self.name: str = data["name"]
    self.rank: int = data["rank"]

__repr__(self) special

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