Skip to content

Chat Message

ChatMessage(subsonic, username, time, message)

Bases: Model

Object that holds all the info about a chat message.

Attributes:

Name Type Description
user User

The user author of the chat message.

message

The message send by the user.

time datetime

The timestamp when the chat message was send.

Source code in .venv/lib/python3.11/site-packages/knuckles/models/_chat_message.py
def __init__(
    self, subsonic: "Subsonic", username: str, time: int, message: str
) -> None:
    super().__init__(subsonic)

    self.user = User(self._subsonic, username)
    self.message = message

    # Divide by 1000 as the Subsonic API return in milliseconds instead of seconds
    self.time: datetime = datetime.fromtimestamp(time / 1000)