simple-bot.py 268 B

12345678910111213
  1. import asyncio
  2. from wechaty import Wechaty, Message
  3. async def on_message(msg: Message):
  4. if msg.text() == 'ding':
  5. await msg.say('dong')
  6. async def main():
  7. bot = Wechaty()
  8. bot.on('message', on_message)
  9. await bot.start()
  10. asyncio.run(main())