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)
| 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 | """ |
no test coverage detected