From 14de5b3debbd982b69d682e88dfee13a308659be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Carvalho?= Date: Fri, 4 Oct 2024 11:01:50 -0300 Subject: [PATCH] fix - returning none in image property --- function/telegram/message.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/function/telegram/message.py b/function/telegram/message.py index 4ff0987..f77acdc 100644 --- a/function/telegram/message.py +++ b/function/telegram/message.py @@ -85,7 +85,9 @@ def chat_id(self) -> str: @cached_property def image(self) -> str | None: - return self.message.images[0] + if self.message.images: + return self.message.images[0] + return None @cached_property def album(self) -> list[InputMediaPhoto]: