Skip to content

partialbadge

roblox.partials.partialbadge

This file contains partial objects related to Roblox badges.

PartialBadge (BaseBadge)

Represents partial badge data.

Attributes:

Name Type Description
_data

The data we get back from the endpoint.

_client Client

The cCient object, which is passed to all objects this Client generates.

id int

The universe ID.

awarded datetime

The date when the badge was awarded.

Source code in roblox/partials/partialbadge.py
class PartialBadge(BaseBadge):
    """
    Represents partial badge data.

    Attributes:
        _data: The data we get back from the endpoint.
        _client: The cCient object, which is passed to all objects this Client generates.
        id: The universe ID.
        awarded: The date when the badge was awarded.
    """

    def __init__(self, client: Client, data: dict):
        """
        Arguments:
            client: The Client.
            data: The raw data.
        """
        self._client: Client = client

        self.id: int = data["badgeId"]

        super().__init__(client=client, badge_id=self.id)

        self.awarded: datetime = parse(data["awardedDate"])

    def __repr__(self):
        return f"<{self.__class__.__name__} id={self.id} awarded={self.awarded}>"

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

Parameters:

Name Type Description Default
client Client

The Client.

required
data dict

The raw data.

required
Source code in roblox/partials/partialbadge.py
def __init__(self, client: Client, data: dict):
    """
    Arguments:
        client: The Client.
        data: The raw data.
    """
    self._client: Client = client

    self.id: int = data["badgeId"]

    super().__init__(client=client, badge_id=self.id)

    self.awarded: datetime = parse(data["awardedDate"])

__repr__(self) special

Source code in roblox/partials/partialbadge.py
def __repr__(self):
    return f"<{self.__class__.__name__} id={self.id} awarded={self.awarded}>"