return the chat container object of the message. If the message is from room,return the Room object. else return Contact object Args: None Examples: >>> msg.chatter() Returns: Optional[Room, Contact]: return the room/contact objec
(self)
| 314 | return self.wechaty.Room.load(room_id) |
| 315 | |
| 316 | def chatter(self) -> Union[Room, Contact]: |
| 317 | """return the chat container object of the message. |
| 318 | |
| 319 | If the message is from room,return the Room object. else return Contact object |
| 320 | Args: |
| 321 | None |
| 322 | Examples: |
| 323 | >>> msg.chatter() |
| 324 | Returns: |
| 325 | Optional[Room, Contact]: return the room/contact object |
| 326 | """ |
| 327 | room: Optional[Room] = self.room() |
| 328 | if room: |
| 329 | return room |
| 330 | talker: Contact = self.talker() |
| 331 | return talker |
| 332 | |
| 333 | def text(self) -> str: |
| 334 | """ |