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

Method room

src/wechaty/user/message.py:301–314  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 9

__str__Method · 0.95
sayMethod · 0.95
chatterMethod · 0.95
mention_listMethod · 0.95
mention_textMethod · 0.95
message_listenerMethod · 0.80
messageFunction · 0.80
messageFunction · 0.80
on_messageMethod · 0.80

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected