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

Method type

src/wechaty/user/contact.py:497–510  ·  view source on GitHub ↗

Get type of contact, which can person, official, corporation, and unspecified. Examples: >>> contact = Contact.load('contact-id') >>> contact_type = contact.type() Returns: ContactType: the type of contact.

(self)

Source from the content-addressed store, hash-verified

495 return self.payload.type == ContactType.CONTACT_TYPE_PERSONAL
496
497 def type(self) -> ContactType:
498 """
499 Get type of contact, which can person, official, corporation, and unspecified.
500
501 Examples:
502 >>> contact = Contact.load('contact-id')
503 >>> contact_type = contact.type()
504
505 Returns:
506 ContactType: the type of contact.
507 """
508 if self.payload is None:
509 raise WechatyPayloadError('contact payload not found')
510 return self.payload.type
511
512 def star(self) -> Optional[bool]:
513 """

Callers 3

display_contactsFunction · 0.45
on_messageMethod · 0.45
on_friendshipMethod · 0.45

Calls 1

WechatyPayloadErrorClass · 0.90

Tested by

no test coverage detected