File tree Expand file tree Collapse file tree 3 files changed +751
-703
lines changed Expand file tree Collapse file tree 3 files changed +751
-703
lines changed Original file line number Diff line number Diff line change 2
2
3
3
Python包装Web微信实现的微信机器人框架。可以很容易地实现微信机器人。
4
4
5
+ Web微信协议参考资料:
6
+
7
+ [ 挖掘微信Web版通信的全过程] ( http://www.tanhao.me/talk/1466.html/ )
8
+
9
+ [ 微信协议简单调研笔记] ( http://www.blogjava.net/yongboy/archive/2015/11/05/410636.html )
10
+
11
+ [ qwx: WeChat Qt frontend 微信Qt前端] ( https://github.com/xiangzhai/qwx )
12
+
5
13
## 环境与依赖
6
14
7
15
目前只能运行于Python 2环境 。
Original file line number Diff line number Diff line change 1
- #!/usr/bin/env python
2
- # coding: utf-8
3
-
4
- from wxbot import *
5
-
6
-
7
- class MyWXBot (WXBot ):
8
- def handle_msg_all (self , msg ):
9
- if msg ['msg_type_id' ] == 4 and msg ['content' ]['type' ] == 0 :
10
- self .send_msg_by_uid ('hi' , msg ['user' ]['id' ])
11
- '''
12
- def schedule(self):
13
- self.send_msg('tb', 'schedule')
14
- time.sleep(1)
15
- '''
16
-
17
-
18
- def main ():
19
- bot = MyWXBot ()
20
- bot .DEBUG = True
21
- bot .conf ['qr' ] = 'png'
22
- bot .run ()
23
-
24
-
25
- if __name__ == '__main__' :
26
- main ()
1
+ #!/usr/bin/env python
2
+ # coding: utf-8
3
+
4
+ from wxbot import *
5
+
6
+
7
+ class MyWXBot (WXBot ):
8
+ def handle_msg_all (self , msg ):
9
+ if msg ['msg_type_id' ] == 4 and msg ['content' ]['type' ] == 0 :
10
+ self .send_msg_by_uid ('hi' , msg ['user' ]['id' ])
11
+
12
+
13
+ '''
14
+ def schedule(self):
15
+ self.send_msg('tb', 'schedule')
16
+ time.sleep(1)
17
+ '''
18
+
19
+
20
+ def main ():
21
+ bot = MyWXBot ()
22
+ bot .DEBUG = True
23
+ bot .conf ['qr' ] = 'png'
24
+ bot .run ()
25
+
26
+
27
+ if __name__ == '__main__' :
28
+ main ()
You can’t perform that action at this time.
0 commit comments