MCPcopy Index your code
hub / github.com/wechaty/python-wechaty / to

Method to

src/wechaty/user/message.py:286–299  ·  view source on GitHub ↗

get the receiver, which is the Contact type, of the message Args: None Examples: >>> message.to() Returns: Optional[Contact]: if the message is private to contact, return the contact object else return None

(self)

Source from the content-addressed store, hash-verified

284 return self.wechaty.Contact.load(talker_id)
285
286 def to(self) -> Optional[Contact]:
287 """get the receiver, which is the Contact type, of the message
288 Args:
289 None
290 Examples:
291 >>> message.to()
292 Returns:
293 Optional[Contact]: if the message is private to contact, return the contact object
294 else return None
295 """
296 to_id = self.payload.to_id
297 if to_id is None:
298 return None
299 return self.wechaty.Contact.load(to_id)
300
301 def room(self) -> Optional[Room]:
302 """get the room from the messge

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected