Skip to content

partialuser

roblox.partials.partialuser

This file contains partial objects related to Roblox users.

PartialUser (BaseUser)

Represents partial user information.

Attributes:

Name Type Description
_shared ClientSharedObject

The shared 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.

Source code in roblox/partials/partialuser.py
class PartialUser(BaseUser):
    """
    Represents partial user information.

    Attributes:
        _shared: The shared 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.
    """

    def __init__(self, shared: ClientSharedObject, data: dict):
        """
        Arguments:
            shared: The ClientSharedObject.
            data: The data from the endpoint.
        """
        self._shared: ClientSharedObject = shared

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

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

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

__init__(self, shared: ClientSharedObject, data: dict) special

Parameters:

Name Type Description Default
shared ClientSharedObject

The ClientSharedObject.

required
data dict

The data from the endpoint.

required
Source code in roblox/partials/partialuser.py
def __init__(self, shared: ClientSharedObject, data: dict):
    """
    Arguments:
        shared: The ClientSharedObject.
        data: The data from the endpoint.
    """
    self._shared: ClientSharedObject = shared

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

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

__repr__(self) special

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

RequestedUsernamePartialUser (PartialUser)

Represents a partial user in the context of a search query.

Attributes:

Name Type Description
requested_username str

Username they requested

Source code in roblox/partials/partialuser.py
class RequestedUsernamePartialUser(PartialUser):
    """
    Represents a partial user in the context of a search query.

    Attributes:
        requested_username: Username they requested
    """

    def __init__(self, shared: ClientSharedObject, data: dict):
        """
        Arguments:
            shared: The ClientSharedObject.
            data: The data form the endpoint.
        """
        super().__init__(shared=shared, data=data)

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

__init__(self, shared: ClientSharedObject, data: dict) special

Parameters:

Name Type Description Default
shared ClientSharedObject

The ClientSharedObject.

required
data dict

The data form the endpoint.

required
Source code in roblox/partials/partialuser.py
def __init__(self, shared: ClientSharedObject, data: dict):
    """
    Arguments:
        shared: The ClientSharedObject.
        data: The data form the endpoint.
    """
    super().__init__(shared=shared, data=data)

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