MCPcopy
hub / github.com/wechaty/python-wechaty / owner

Method owner

src/wechaty/user/room.py:711–729  ·  view source on GitHub ↗

get room owner Args: None Examples: >>> owner = await room.owner() Returns: Optional[Contact]: the room owner

(self)

Source from the content-addressed store, hash-verified

709 return members[0]
710
711 async def owner(self) -> Optional[Contact]:
712 """
713 get room owner
714 Args:
715 None
716 Examples:
717 >>> owner = await room.owner()
718 Returns:
719 Optional[Contact]: the room owner
720 """
721 log.info('Room <%s> owner', self)
722 await self.ready()
723
724 if self.payload.owner_id is None or self.payload.owner_id == '':
725 # raise Exception('Room <%s> payload or payload.owner_id not found')
726 return None
727
728 contact = self.wechaty.Contact.load(self.payload.owner_id)
729 return contact
730
731 async def avatar(self) -> FileBox:
732 """

Callers 1

test_room_ownerFunction · 0.80

Calls 2

readyMethod · 0.95
loadMethod · 0.45

Tested by 1

test_room_ownerFunction · 0.64