From a24f80c4d0935e8f9231a10c6dd9d9742921affa Mon Sep 17 00:00:00 2001 From: Andrea Spacca Date: Thu, 7 Jan 2021 17:57:54 +0100 Subject: [PATCH] fix bug --- pantalaimon/store.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pantalaimon/store.py b/pantalaimon/store.py index 7f83ff1..3d8f681 100644 --- a/pantalaimon/store.py +++ b/pantalaimon/store.py @@ -50,7 +50,6 @@ class MediaInfo: def to_content(self, url: str, file_name: str, msgtype: str, mime_type: str) -> Dict[Any, Any]: content = { - "body": file_name, "file": { "v": "v2", "key": self.key, @@ -61,7 +60,9 @@ class MediaInfo: } } - if len(file_name) == 0: + if len(file_name) > 0: + content["body"] = file_name + else: content["body"] = url if msgtype: