refactor: wrap wechaty message

This commit is contained in:
lanvent
2023-03-31 04:11:25 +08:00
parent 4f3d12129c
commit 50a03e7c15
2 changed files with 84 additions and 1 deletions

View File

@@ -61,4 +61,22 @@ class ChatMessage(object):
def prepare(self):
if self._prepare_fn and not self._prepared:
self._prepared = True
self._prepare_fn()
self._prepare_fn()
def __str__(self):
return 'ChatMessage: id={}, create_time={}, ctype={}, content={}, from_user_id={}, from_user_nickname={}, to_user_id={}, to_user_nickname={}, other_user_id={}, other_user_nickname={}, is_group={}, is_at={}, actual_user_id={}, actual_user_nickname={}'.format(
self.msg_id,
self.create_time,
self.ctype,
self.content,
self.from_user_id,
self.from_user_nickname,
self.to_user_id,
self.to_user_nickname,
self.other_user_id,
self.other_user_nickname,
self.is_group,
self.is_at,
self.actual_user_id,
self.actual_user_nickname,
)