Find all contacts in a room, if get many, return the first one. TODO -> need to refactoring this function Args: query: the query filter Examples: >>> member = await room.member('lijiarui') Returns: Optional[Contact]: the f
(self,
query: Union[str, RoomMemberQueryFilter] = None
)
| 688 | return members |
| 689 | |
| 690 | async def member(self, |
| 691 | query: Union[str, RoomMemberQueryFilter] = None |
| 692 | ) -> Optional[Contact]: |
| 693 | """ |
| 694 | Find all contacts in a room, if get many, return the first one. |
| 695 | |
| 696 | TODO -> need to refactoring this function |
| 697 | Args: |
| 698 | query: the query filter |
| 699 | Examples: |
| 700 | >>> member = await room.member('lijiarui') |
| 701 | Returns: |
| 702 | Optional[Contact]: the first contact in the room |
| 703 | """ |
| 704 | log.info('Room member search <%s>', query) |
| 705 | |
| 706 | members = await self.member_list(query) |
| 707 | if members is None or len(members) < 1: |
| 708 | return None |
| 709 | return members[0] |
| 710 | |
| 711 | async def owner(self) -> Optional[Contact]: |
| 712 | """ |