Fixed unavailable Message attributes

This commit is contained in:
Profitroll 2024-09-19 22:03:23 +02:00
parent 9e12b53c3b
commit c06d90b7ce
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2

View File

@ -59,9 +59,9 @@ class Message:
self.channels.extend(Channel(channel) for channel in data["channel"]) self.channels.extend(Channel(channel) for channel in data["channel"])
self.id: str = data["id"] self.id: str = data["id"]
self.active: bool = data["act"] self.active: bool = data["act"]
self.head: str = data["head"] self.head: str = "" if "head" not in data else data["head"]
self.lead: str = data["lead"] self.lead: str = "" if "lead" not in data else data["lead"]
self.text: str = data["text"] self.text: str = "" if "text" not in data else data["text"]
self.company: Union[str, None] = data.get("company") self.company: Union[str, None] = data.get("company")
self.category: Union[str, None] = data.get("category") self.category: Union[str, None] = data.get("category")
self.priority: Union[int, None] = data.get("priority") self.priority: Union[int, None] = data.get("priority")