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, client: Client, data: dict, group: BaseGroup):
        self._client: Client = client

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

        super().__init__(
            client=self._client,
            post_id=self.id,
            group=group
        )

        self.poster: Optional[Member] = data["poster"] and Member(
            client=self._client,
            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, client: Client, data: dict, group: BaseGroup) special

Source code in roblox/wall.py
def __init__(self, client: Client, data: dict, group: BaseGroup):
    self._client: Client = client

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

    super().__init__(
        client=self._client,
        post_id=self.id,
        group=group
    )

    self.poster: Optional[Member] = data["poster"] and Member(
        client=self._client,
        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
id int

The post ID.

group BaseGroup

The group whose wall this post exists on.

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

    Attributes:
        id: The post ID.
        group: The group whose wall this post exists on.
    """

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

        self._client: Client = client
        self.id: int = post_id

        self.group: BaseGroup

        if isinstance(group, int):
            self.group = BaseGroup(client=self._client, group_id=group)
        else:
            self.group = group

    async def delete(self):
        """
        Deletes this wall post.
        """
        await self._client.requests.delete(
            url=self._client.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, client: Client, post_id: int, group: Union[BaseGroup, int]) special

Parameters:

Name Type Description Default
client Client

The Client.

required
post_id int

The post ID.

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

    self._client: Client = client
    self.id: int = post_id

    self.group: BaseGroup

    if isinstance(group, int):
        self.group = BaseGroup(client=self._client, 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._client.requests.delete(
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.group.id}/wall/posts/{self.id}")
    )