Skip to content

Commit

Permalink
Format code and solve the dead cycle problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
liuwons committed Mar 3, 2016
1 parent ed6e534 commit e0fd2fc
Show file tree
Hide file tree
Showing 3 changed files with 751 additions and 703 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Python包装Web微信实现的微信机器人框架。可以很容易地实现微信机器人。

Web微信协议参考资料:

[挖掘微信Web版通信的全过程](http://www.tanhao.me/talk/1466.html/)

[微信协议简单调研笔记](http://www.blogjava.net/yongboy/archive/2015/11/05/410636.html)

[qwx: WeChat Qt frontend 微信Qt前端](https://github.com/xiangzhai/qwx)

## 环境与依赖

目前只能运行于Python 2环境 。
Expand Down
54 changes: 28 additions & 26 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
#!/usr/bin/env python
# coding: utf-8

from wxbot import *


class MyWXBot(WXBot):
def handle_msg_all(self, msg):
if msg['msg_type_id'] == 4 and msg['content']['type'] == 0:
self.send_msg_by_uid('hi', msg['user']['id'])
'''
def schedule(self):
self.send_msg('tb', 'schedule')
time.sleep(1)
'''


def main():
bot = MyWXBot()
bot.DEBUG = True
bot.conf['qr'] = 'png'
bot.run()


if __name__ == '__main__':
main()
#!/usr/bin/env python
# coding: utf-8

from wxbot import *


class MyWXBot(WXBot):
def handle_msg_all(self, msg):
if msg['msg_type_id'] == 4 and msg['content']['type'] == 0:
self.send_msg_by_uid('hi', msg['user']['id'])


'''
def schedule(self):
self.send_msg('tb', 'schedule')
time.sleep(1)
'''


def main():
bot = MyWXBot()
bot.DEBUG = True
bot.conf['qr'] = 'png'
bot.run()


if __name__ == '__main__':
main()
Loading

0 comments on commit e0fd2fc

Please sign in to comment.