Skip to content

partialuser

This file contains partial objects related to Roblox users.

PartialUser

Bases: BaseUser

Represents partial user information.

Attributes:

Name Type Description
_client Client

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

id int

The user's ID.

name str

The user's name.

display_name str

The user's display name.

has_verified_badge bool

If the user has a verified badge.

Source code in roblox/partials/partialuser.py
15
16
17
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 PartialUser(BaseUser):
    """
    Represents partial user information.

    Attributes:
        _client: The Client object, which is passed to all objects this Client generates.
        id: The user's ID.
        name: The user's name.
        display_name: The user's display name.
        has_verified_badge: If the user has a verified badge.
    """

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

        self.id: int = data.get("id") or data.get("userId") or data.get("Id")

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

        self.name: str = data.get("name") or data.get("Name") or data.get("username") or data.get("Username")
        self.display_name: str = data.get("displayName")
        self.has_verified_badge: bool = data.get("hasVerifiedBadge", False) or data.get("HasVerifiedBadge", False)

__init__(client, data)

Parameters:

Name Type Description Default
client Client

The Client.

required
data dict

The data from the endpoint.

required
Source code in roblox/partials/partialuser.py
27
28
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 data from the endpoint.
    """
    self._client: Client = client

    self.id: int = data.get("id") or data.get("userId") or data.get("Id")

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

    self.name: str = data.get("name") or data.get("Name") or data.get("username") or data.get("Username")
    self.display_name: str = data.get("displayName")
    self.has_verified_badge: bool = data.get("hasVerifiedBadge", False) or data.get("HasVerifiedBadge", False)

PreviousUsernamesPartialUser

Bases: PartialUser

Represents a partial user in the context of a search where the user's previous usernames are present. Attributes: previous_usernames: A list of the user's previous usernames.

Source code in roblox/partials/partialuser.py
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
class PreviousUsernamesPartialUser(PartialUser):
    """
    Represents a partial user in the context of a search where the user's previous usernames are present.
    Attributes:
        previous_usernames: A list of the user's previous usernames.
    """

    def __init__(self, client: Client, data: dict):
        """
        Arguments:
            client: The Client.
            data: The data from the endpoint.
        """
        super().__init__(client=client, data=data)

        self.previous_usernames: List[str] = data["previousUsernames"]

__init__(client, data)

Parameters:

Name Type Description Default
client Client

The Client.

required
data dict

The data from the endpoint.

required
Source code in roblox/partials/partialuser.py
70
71
72
73
74
75
76
77
78
def __init__(self, client: Client, data: dict):
    """
    Arguments:
        client: The Client.
        data: The data from the endpoint.
    """
    super().__init__(client=client, data=data)

    self.previous_usernames: List[str] = data["previousUsernames"]

RequestedUsernamePartialUser

Bases: PartialUser

Represents a partial user in the context of a search where the requested username is present.

Attributes:

Name Type Description
requested_username Optional[str]

The requested username.

Source code in roblox/partials/partialuser.py
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
class RequestedUsernamePartialUser(PartialUser):
    """
    Represents a partial user in the context of a search where the requested username is present.

    Attributes:
        requested_username: The requested username.
    """

    def __init__(self, client: Client, data: dict):
        """
        Arguments:
            client: The Client.
            data: The data from the endpoint.
        """
        super().__init__(client=client, data=data)

        self.requested_username: Optional[str] = data.get("requestedUsername")

__init__(client, data)

Parameters:

Name Type Description Default
client Client

The Client.

required
data dict

The data from the endpoint.

required
Source code in roblox/partials/partialuser.py
52
53
54
55
56
57
58
59
60
def __init__(self, client: Client, data: dict):
    """
    Arguments:
        client: The Client.
        data: The data from the endpoint.
    """
    super().__init__(client=client, data=data)

    self.requested_username: Optional[str] = data.get("requestedUsername")