From c06d90b7ceec2d8fe28ef9fd518b0dea05e2fe31 Mon Sep 17 00:00:00 2001 From: profitroll Date: Thu, 19 Sep 2024 22:03:23 +0200 Subject: [PATCH] Fixed unavailable Message attributes --- src/pyrmv/classes/message.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pyrmv/classes/message.py b/src/pyrmv/classes/message.py index e7eaa2c..7063e0f 100644 --- a/src/pyrmv/classes/message.py +++ b/src/pyrmv/classes/message.py @@ -59,9 +59,9 @@ class Message: self.channels.extend(Channel(channel) for channel in data["channel"]) self.id: str = data["id"] self.active: bool = data["act"] - self.head: str = data["head"] - self.lead: str = data["lead"] - self.text: str = data["text"] + self.head: str = "" if "head" not in data else data["head"] + self.lead: str = "" if "lead" not in data else data["lead"] + self.text: str = "" if "text" not in data else data["text"] self.company: Union[str, None] = data.get("company") self.category: Union[str, None] = data.get("category") self.priority: Union[int, None] = data.get("priority")