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

Function message

examples/plugin-server-bot.py:32–46  ·  view source on GitHub ↗

back on message

(msg: Message)

Source from the content-addressed store, hash-verified

30
31
32async def message(msg: Message) -> None:
33 """back on message"""
34 from_contact = msg.talker()
35 text = msg.text()
36 room = msg.room()
37 if text == '#ding':
38 conversation: Union[
39 Room, Contact] = from_contact if room is None else room
40 await conversation.ready()
41 await conversation.say('dong')
42 file_box = FileBox.from_url(
43 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/'
44 'u=1116676390,2305043183&fm=26&gp=0.jpg',
45 name='ding-dong.jpg')
46 await conversation.say(file_box)
47
48bot: Optional[Wechaty] = None
49

Callers

nothing calls this directly

Calls 5

talkerMethod · 0.80
textMethod · 0.80
roomMethod · 0.80
readyMethod · 0.45
sayMethod · 0.45

Tested by

no test coverage detected