get the room from the messge Args: None Examples: >>> msg.room() Returns: Optional[Room]: if the message is from room, return the contact object. else return .
(self)
| 299 | return self.wechaty.Contact.load(to_id) |
| 300 | |
| 301 | def room(self) -> Optional[Room]: |
| 302 | """get the room from the messge |
| 303 | Args: |
| 304 | None |
| 305 | Examples: |
| 306 | >>> msg.room() |
| 307 | Returns: |
| 308 | Optional[Room]: if the message is from room, return the contact object. |
| 309 | else return . |
| 310 | """ |
| 311 | room_id = self.payload.room_id |
| 312 | if room_id is None or room_id == '': |
| 313 | return None |
| 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. |
no test coverage detected