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

Method announce

src/wechaty/user/room.py:550–572  ·  view source on GitHub ↗

SET/GET announce from the room It only works when bot is the owner of the room. Args: announce_text: the new announce text Examples: >>> old_announce = await room.announce() >>> new_announce = await room.announce('new wechaty!')

(self, announce_text: str = None)

Source from the content-addressed store, hash-verified

548 return None
549
550 async def announce(self, announce_text: str = None) -> Optional[str]:
551 """
552 SET/GET announce from the room
553
554 It only works when bot is the owner of the room.
555 Args:
556 announce_text: the new announce text
557 Examples:
558 >>> old_announce = await room.announce()
559 >>> new_announce = await room.announce('new wechaty!')
560 Returns:
561 Optional[str]: the room announce
562 """
563
564 log.info('Room announce (%s)', announce_text)
565
566 if announce_text is None:
567 announce = await self.puppet.room_announce(self.room_id)
568 return announce
569 await self.puppet.room_announce(self.room_id, announce_text)
570 # reload the payload
571 await self.ready(force_sync=True)
572 return None
573
574 async def qr_code(self) -> str:
575 """

Callers

nothing calls this directly

Calls 2

readyMethod · 0.95
room_announceMethod · 0.80

Tested by

no test coverage detected