MCPcopy
hub / github.com/wechaty/python-wechaty / is_self

Method is_self

src/wechaty/user/message.py:417–432  ·  view source on GitHub ↗

Check if a message is sent by self Args: None Examples: >>> msg.is_self() Returns: bool: True if message is sent by self, else False

(self)

Source from the content-addressed store, hash-verified

415 return self.payload.type
416
417 def is_self(self) -> bool:
418 """
419 Check if a message is sent by self
420
421 Args:
422 None
423 Examples:
424 >>> msg.is_self()
425 Returns:
426 bool: True if message is sent by self, else False
427 """
428 login_user: ContactSelf = self.wechaty.user_self()
429 talker = self.talker()
430 if talker is None:
431 return False
432 return talker.contact_id == login_user.contact_id
433
434 async def mention_list(self) -> List[Contact]:
435 """

Callers

nothing calls this directly

Calls 2

talkerMethod · 0.95
user_selfMethod · 0.80

Tested by

no test coverage detected