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)
| 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 |