test.py 476 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env python
  2. # coding: utf-8
  3. from wxbot import *
  4. class MyWXBot(WXBot):
  5. def handle_msg_all(self, msg):
  6. if msg['msg_type_id'] == 4 and msg['content']['type'] == 0:
  7. self.send_msg_by_uid('hi', msg['user']['id'])
  8. '''
  9. def schedule(self):
  10. self.send_msg('tb', 'schedule')
  11. time.sleep(1)
  12. '''
  13. def main():
  14. bot = MyWXBot()
  15. bot.DEBUG = True
  16. bot.conf['qr'] = 'png'
  17. bot.run()
  18. if __name__ == '__main__':
  19. main()