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

Method find_all

src/wechaty/user/message.py:234–268  ·  view source on GitHub ↗

find the message from the server. Args: talker_id (Optional[str], optional): the id of talker. message_id (Optional[str], optional): the id of message. room_id (Optional[str], optional): the id of room. text (Optional[str], optional): you can

(cls, talker_id: Optional[str] = None,
                       message_id: Optional[str] = None,
                       room_id: Optional[str] = None,
                       text: Optional[str] = None,
                       to_id: Optional[str] = None,
                       message_type: Optional[MessageType] = None
                       )

Source from the content-addressed store, hash-verified

232
233 @classmethod
234 async def find_all(cls, talker_id: Optional[str] = None,
235 message_id: Optional[str] = None,
236 room_id: Optional[str] = None,
237 text: Optional[str] = None,
238 to_id: Optional[str] = None,
239 message_type: Optional[MessageType] = None
240 ) -> List[Message]:
241 """find the message from the server.
242
243 Args:
244 talker_id (Optional[str], optional): the id of talker.
245 message_id (Optional[str], optional): the id of message.
246 room_id (Optional[str], optional): the id of room.
247 text (Optional[str], optional): you can search message by sub-string of the text.
248 to_id (Optional[str], optional): the id of receiver.
249 message_type (Optional[MessageType], optional): the type of the message
250 Examples:
251 >>> message = Message.find_all(message_id='message_id')
252 Returns:
253 List[Message]: return all of the searched messages
254 """
255 log.info('Message find all <%s, %s, %s, <%s, %s, %s>', talker_id,
256 message_id, room_id, text, to_id, message_type)
257
258 query_filter = MessageQueryFilter(
259 from_id=talker_id,
260 id=message_id,
261 room_id=room_id,
262 text=text,
263 to_id=to_id,
264 type=message_type
265 )
266 message_ids = await cls.get_puppet().message_search(query_filter)
267 messages = [cls.load(message_id) for message_id in message_ids]
268 return messages
269
270 def talker(self) -> Contact:
271 """get the talker of the message

Callers 1

findMethod · 0.45

Calls 3

message_searchMethod · 0.80
get_puppetMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected