back on message
(msg: Message)
| 30 | |
| 31 | |
| 32 | async 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 | |
| 48 | bot: Optional[Wechaty] = None |
| 49 |