create a non-persistent message. :param view_type: the message type code or one of the strings: "text", "audio", "video", "file", "sticker", "videochat", "webxdc"
(cls, account, view_type)
| 52 | |
| 53 | @classmethod |
| 54 | def new_empty(cls, account, view_type): |
| 55 | """create a non-persistent message. |
| 56 | |
| 57 | :param view_type: the message type code or one of the strings: |
| 58 | "text", "audio", "video", "file", "sticker", "videochat", "webxdc" |
| 59 | """ |
| 60 | view_type_code = view_type if isinstance(view_type, int) else get_viewtype_code_from_name(view_type) |
| 61 | return Message( |
| 62 | account, |
| 63 | ffi.gc(lib.dc_msg_new(account._dc_context, view_type_code), lib.dc_msg_unref), |
| 64 | ) |
| 65 | |
| 66 | def create_chat(self): |
| 67 | """create or get an existing chat (group) object for this message. |