test.py 479 B

1234567891011121314151617181920212223242526
  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(u'hi', msg['user']['id'])
  8. '''
  9. def schedule(self):
  10. self.send_msg(u'张三', u'测试')
  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()