set file for this message from path and mime_type.
(self, path, mime_type=None)
| 112 | return from_dc_charpointer(lib.dc_msg_get_file(self._dc_msg)) |
| 113 | |
| 114 | def set_file(self, path, mime_type=None): |
| 115 | """set file for this message from path and mime_type.""" |
| 116 | mtype = ffi.NULL if mime_type is None else as_dc_charpointer(mime_type) |
| 117 | if not os.path.exists(path): |
| 118 | raise ValueError(f"path does not exist: {path!r}") |
| 119 | lib.dc_msg_set_file_and_deduplicate(self._dc_msg, as_dc_charpointer(path), ffi.NULL, mtype) |
| 120 | |
| 121 | @props.with_doc |
| 122 | def basename(self) -> str: |