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

Method alias

src/wechaty/user/room.py:594–618  ·  view source on GitHub ↗

Return contact's roomAlias in the room TODO -> 'Wechaty Puppet Unsupported API Error. Learn More At \ [this URL](https://github.com/wechaty/wechaty-puppet/wiki/Compatibility) the result of the function will always return an empty string Args:

(self, member: Contact)

Source from the content-addressed store, hash-verified

592 return qr_code_str
593
594 async def alias(self, member: Contact) -> Optional[str]:
595 """
596 Return contact's roomAlias in the room
597
598 TODO -> 'Wechaty Puppet Unsupported API Error. Learn More At \
599 [this URL](https://github.com/wechaty/wechaty-puppet/wiki/Compatibility)
600
601 the result of the function will always return an empty string
602
603 Args:
604 member: the contact in the room
605 Examples:
606 >>> room_alias = await room.alias(member)
607 Returns:
608 Optional[str]: the alias of the contact in the room
609 """
610 if member is None:
611 raise WechatyOperationError('member can"t be none')
612 room_member_payload = await self.puppet.room_member_payload(
613 room_id=self.room_id, contact_id=member.contact_id)
614
615 if room_member_payload is not None \
616 and room_member_payload.room_alias is not None:
617 return room_member_payload.room_alias
618 return None
619
620 async def has(self, contact: Contact) -> bool:
621 """

Callers 2

get_alias_or_nameMethod · 0.45
on_messageMethod · 0.45

Calls 2

room_member_payloadMethod · 0.80

Tested by

no test coverage detected