Skip to content

partialbadge

This file contains partial objects related to Roblox badges.

PartialBadge

Bases: 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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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"])

__init__(client, data)

Parameters:

Name Type Description Default
client Client

The Client.

required
data dict

The raw data.

required
Source code in roblox/partials/partialbadge.py
29
30
31
32
33
34
35
36
37
38
39
40
41
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"])