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 dict

The data we get back from the endpoint.

_shared ClientSharedObject

The shared 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.
        _shared: The shared 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, shared: ClientSharedObject, data: dict):
        """
        Arguments:
            shared: The ClientSharedObject.
            data: The raw data.
        """
        self._shared: ClientSharedObject = shared
        self._data: dict = data

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

        super().__init__(shared=shared, 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, shared: ClientSharedObject, data: dict) special

Parameters:

Name Type Description Default
shared ClientSharedObject

The ClientSharedObject.

required
data dict

The raw data.

required
Source code in roblox/partials/partialbadge.py
def __init__(self, shared: ClientSharedObject, data: dict):
    """
    Arguments:
        shared: The ClientSharedObject.
        data: The raw data.
    """
    self._shared: ClientSharedObject = shared
    self._data: dict = data

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

    super().__init__(shared=shared, 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}>"