test.py 467 B

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