Skip to content

users

roblox.users

This module contains classes intended to parse and deal with data from Roblox user information endpoints.

User (BaseUser)

Represents a single conversation.

Attributes:

Name Type Description
_shared ClientSharedObject

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

id int

The id of the current user.

name str

The name of the current user.

display_name str

The display name of the current user.

external_app_display_name str

The external app display name of the current user.

is_banned bool

If the user is banned.

description str

The description the current user wrote for themself.

created datetime

When the user created their account.

Source code in roblox/users.py
class User(BaseUser):
    """
    Represents a single conversation.

    Attributes:
        _shared: The shared object, which is passed to all objects this client generates.
        id: The id of the current user.
        name: The name of the current user.
        display_name: The display name of the current user.
        external_app_display_name: The external app display name of the current user.
        is_banned: If the user is banned.
        description: The description the current user wrote for themself.
        created: When the user created their account.
    """

    def __init__(self, shared: ClientSharedObject, data: dict):
        """
        Arguments:
            shared: Shared object.
            data: The data from the request.
        """
        super().__init__(shared=shared, user_id=data["id"])

        self._shared: ClientSharedObject = shared
        self._data: dict = data

        self.name: str = data["name"]
        self.display_name: str = data["displayName"]
        self.external_app_display_name: str = data["externalAppDisplayName"]
        self.id: int = data["id"]
        self.is_banned: bool = data["isBanned"]
        self.description: str = data["description"]
        self.created: datetime = parse(data["created"])

    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

Shared object.

required
data dict

The data from the request.

required
Source code in roblox/users.py
def __init__(self, shared: ClientSharedObject, data: dict):
    """
    Arguments:
        shared: Shared object.
        data: The data from the request.
    """
    super().__init__(shared=shared, user_id=data["id"])

    self._shared: ClientSharedObject = shared
    self._data: dict = data

    self.name: str = data["name"]
    self.display_name: str = data["displayName"]
    self.external_app_display_name: str = data["externalAppDisplayName"]
    self.id: int = data["id"]
    self.is_banned: bool = data["isBanned"]
    self.description: str = data["description"]
    self.created: datetime = parse(data["created"])

__repr__(self) special

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