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

Method delete

src/wechaty/user/room.py:466–484  ·  view source on GitHub ↗

Delete contact in a room It only works when bot is the owner of the room. Args: contact: the contact to be deleted Examples: >>> await room.delete(contact) Returns: None

(self, contact: Contact)

Source from the content-addressed store, hash-verified

464 await self.ready(force_sync=True)
465
466 async def delete(self, contact: Contact) -> None:
467 """
468 Delete contact in a room
469
470 It only works when bot is the owner of the room.
471 Args:
472 contact: the contact to be deleted
473 Examples:
474 >>> await room.delete(contact)
475 Returns:
476 None
477 """
478 log.info('Room delete<%s>', contact)
479
480 if contact is None or contact.contact_id is None:
481 raise WechatyOperationError('Contact is none or contact_id not found')
482 await self.puppet.room_delete(self.room_id, contact.contact_id)
483 # reload the payload
484 await self.ready(force_sync=True)
485
486 async def quit(self) -> None:
487 """

Callers

nothing calls this directly

Calls 3

readyMethod · 0.95
room_deleteMethod · 0.80

Tested by

no test coverage detected