This commit is contained in:
Andrea Spacca 2021-01-07 17:57:54 +01:00
parent 83d1e12870
commit a24f80c4d0

View File

@ -50,7 +50,6 @@ class MediaInfo:
def to_content(self, url: str, file_name: str, msgtype: str, mime_type: str) -> Dict[Any, Any]: def to_content(self, url: str, file_name: str, msgtype: str, mime_type: str) -> Dict[Any, Any]:
content = { content = {
"body": file_name,
"file": { "file": {
"v": "v2", "v": "v2",
"key": self.key, "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 content["body"] = url
if msgtype: if msgtype: