back on message
(msg: Message)
| 18 | |
| 19 | |
| 20 | async def message(msg: Message) -> None: |
| 21 | """back on message""" |
| 22 | from_contact = msg.talker() |
| 23 | text = msg.text() |
| 24 | room = msg.room() |
| 25 | if text == 'ding': |
| 26 | conversation: Union[ |
| 27 | Room, Contact] = from_contact if room is None else room |
| 28 | await conversation.ready() |
| 29 | await conversation.say('dong') |
| 30 | file_box = FileBox.from_url( |
| 31 | 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/' |
| 32 | 'u=1116676390,2305043183&fm=26&gp=0.jpg', |
| 33 | name='ding-dong.jpg') |
| 34 | await conversation.say(file_box) |
| 35 | |
| 36 | bot: Optional[Wechaty] = None |
| 37 |