Skip to content

wall

roblox.wall

Contains objects related to Roblox group walls.

WallPost (WallPostRelationship)

Represents a post on a Roblox group wall.

Attributes:

Name Type Description
id int

The post ID.

poster Optional[Member]

The member who made the post.

body str

Body of the post.

created datetime

Creation date of the post.

updated datetime

Last updated date of the post.

Source code in roblox/wall.py
class WallPost(WallPostRelationship):
    """
    Represents a post on a Roblox group wall.

    Attributes:
        id: The post ID.
        poster: The member who made the post.
        body: Body of the post.
        created: Creation date of the post.
        updated: Last updated date of the post.
    """

    def __init__(self, shared: ClientSharedObject, data: dict, group: BaseGroup):
        self._shared: ClientSharedObject = shared

        self.id: int = data["id"]

        super().__init__(
            shared=self._shared,
            post_id=self.id,
            group=group
        )

        self.poster: Optional[Member] = data["poster"] and Member(
            shared=self._shared,
            data=data["poster"],
            group=self.group
        ) or None
        self.body: str = data["body"]
        self.created: datetime = parse(data["created"])
        self.updated: datetime = parse(data["updated"])

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

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

Source code in roblox/wall.py
def __init__(self, shared: ClientSharedObject, data: dict, group: BaseGroup):
    self._shared: ClientSharedObject = shared

    self.id: int = data["id"]

    super().__init__(
        shared=self._shared,
        post_id=self.id,
        group=group
    )

    self.poster: Optional[Member] = data["poster"] and Member(
        shared=self._shared,
        data=data["poster"],
        group=self.group
    ) or None
    self.body: str = data["body"]
    self.created: datetime = parse(data["created"])
    self.updated: datetime = parse(data["updated"])

__repr__(self) special

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

WallPostRelationship

Represents a Roblox wall post ID.

Attributes:

Name Type Description
_shared ClientSharedObject

The ClientSharedObject.

id int

The post ID.

Source code in roblox/wall.py
class WallPostRelationship:
    """
    Represents a Roblox wall post ID.

    Attributes:
        _shared: The ClientSharedObject.
        id: The post ID.
    """

    def __init__(self, shared: ClientSharedObject, post_id: int, group: Union[BaseGroup, int]):
        """
        Arguments:
            shared: The ClientSharedObject.
            post_id: The post ID.
        """

        self._shared: ClientSharedObject = shared
        self.id: int = post_id

        self.group: BaseGroup

        if isinstance(group, int):
            self.group = BaseGroup(shared=self._shared, group_id=group)
        else:
            self.group = group

    async def delete(self):
        """
        Deletes this wall post.
        """
        await self._shared.requests.delete(
            url=self._shared.url_generator.get_url("groups", f"v1/groups/{self.group.id}/wall/posts/{self.id}")
        )

    def __repr__(self):
        return f"<{self.__class__.__name__} id={self.id} group={self.group}>"

__init__(self, shared: ClientSharedObject, post_id: int, group: Union[BaseGroup, int]) special

Parameters:

Name Type Description Default
shared ClientSharedObject

The ClientSharedObject.

required
post_id int

The post ID.

required
Source code in roblox/wall.py
def __init__(self, shared: ClientSharedObject, post_id: int, group: Union[BaseGroup, int]):
    """
    Arguments:
        shared: The ClientSharedObject.
        post_id: The post ID.
    """

    self._shared: ClientSharedObject = shared
    self.id: int = post_id

    self.group: BaseGroup

    if isinstance(group, int):
        self.group = BaseGroup(shared=self._shared, group_id=group)
    else:
        self.group = group

__repr__(self) special

Source code in roblox/wall.py
def __repr__(self):
    return f"<{self.__class__.__name__} id={self.id} group={self.group}>"

delete(self) async

Deletes this wall post.

Source code in roblox/wall.py
async def delete(self):
    """
    Deletes this wall post.
    """
    await self._shared.requests.delete(
        url=self._shared.url_generator.get_url("groups", f"v1/groups/{self.group.id}/wall/posts/{self.id}")
    )