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

Method talker

src/wechaty/user/message.py:270–284  ·  view source on GitHub ↗

get the talker of the message Args: None Examples: >>> message.talker() Raises: WechatyPayloadError: can't find the talker information from the payload Returns: Contact: the talker contact object

(self)

Source from the content-addressed store, hash-verified

268 return messages
269
270 def talker(self) -> Contact:
271 """get the talker of the message
272 Args:
273 None
274 Examples:
275 >>> message.talker()
276 Raises:
277 WechatyPayloadError: can't find the talker information from the payload
278 Returns:
279 Contact: the talker contact object
280 """
281 talker_id = self.payload.from_id
282 if talker_id is None:
283 raise WechatyPayloadError('message must be from Contact')
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

Callers 7

__str__Method · 0.95
sayMethod · 0.95
chatterMethod · 0.95
is_selfMethod · 0.95
messageFunction · 0.80
messageFunction · 0.80
on_messageMethod · 0.80

Calls 2

WechatyPayloadErrorClass · 0.90
loadMethod · 0.45

Tested by

no test coverage detected