Skip to content

shout

roblox.shout

Contains the Shout object, which represents a group's shout.

Shout

Represents a Group Shout.

Attributes:

Name Type Description
body str

The text of the shout.

created datetime

When the shout was created.

updated datetime

When the shout was updated.

poster PartialUser

Who posted the shout.

Source code in roblox/shout.py
class Shout:
    """
    Represents a Group Shout.

    Attributes:
        body: The text of the shout.
        created: When the shout was created.
        updated: When the shout was updated.
        poster: Who posted the shout.
    """

    def __init__(
            self,
            client: Client,
            data: dict
    ):
        """
        Arguments:
            client: Client object.
            data: The data from the request.
        """
        self._client: Client = client

        self.body: str = data["body"]
        self.created: datetime = parse(data["created"])
        self.updated: datetime = parse(data["updated"])
        self.poster: PartialUser = PartialUser(
            client=self._client,
            data=data["poster"]
        )

    def __repr__(self):
        return f"<{self.__class__.__name__} created={self.created} updated={self.updated} body={self.body!r} " \
               f"poster={self.poster!r}>"

__init__(self, client: Client, data: dict) special

Parameters:

Name Type Description Default
client Client

Client object.

required
data dict

The data from the request.

required
Source code in roblox/shout.py
def __init__(
        self,
        client: Client,
        data: dict
):
    """
    Arguments:
        client: Client object.
        data: The data from the request.
    """
    self._client: Client = client

    self.body: str = data["body"]
    self.created: datetime = parse(data["created"])
    self.updated: datetime = parse(data["updated"])
    self.poster: PartialUser = PartialUser(
        client=self._client,
        data=data["poster"]
    )

__repr__(self) special

Source code in roblox/shout.py
def __repr__(self):
    return f"<{self.__class__.__name__} created={self.created} updated={self.updated} body={self.body!r} " \
           f"poster={self.poster!r}>"