Skip to content

friends

roblox.friends

Contains classes related to Roblox friend data and parsing.

Friend (User)

Represents a friend.

Attributes:

Name Type Description
is_online Optional[bool]

Whether the user is currently online.

presence_type int

Their presence type. Don't use this.

is_deleted bool

Whether the account is deleted.

friend_frequent_rank int

Unknown

Source code in roblox/friends.py
class Friend(User):
    """
    Represents a friend.

    Attributes:
        is_online: Whether the user is currently online.
        presence_type: Their presence type. Don't use this.
        is_deleted: Whether the account is deleted.
        friend_frequent_rank: Unknown
    """

    def __init__(self, shared: ClientSharedObject, data: dict):
        """
        Arguments:
            data: The data we get back from the endpoint.
            shared: The shared object, which is passed to all objects this client generates.
        """
        super().__init__(shared=shared, data=data)

        self.is_online: Optional[bool] = data.get("isOnline")
        self.presence_type: int = data["presenceType"]
        self.is_deleted: bool = data["isDeleted"]
        self.friend_frequent_rank: int = data["friendFrequentRank"]

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

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

Parameters:

Name Type Description Default
data dict

The data we get back from the endpoint.

required
shared ClientSharedObject

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

required
Source code in roblox/friends.py
def __init__(self, shared: ClientSharedObject, data: dict):
    """
    Arguments:
        data: The data we get back from the endpoint.
        shared: The shared object, which is passed to all objects this client generates.
    """
    super().__init__(shared=shared, data=data)

    self.is_online: Optional[bool] = data.get("isOnline")
    self.presence_type: int = data["presenceType"]
    self.is_deleted: bool = data["isDeleted"]
    self.friend_frequent_rank: int = data["friendFrequentRank"]

__repr__(self) special

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