Skip to content

Commit a6f5b0b

Browse files
committed
Refine README and add ERROR log when login failed.
1 parent 7cfdfcc commit a6f5b0b

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,11 @@ python test.py
200200

201201

202202
***bot.py*** 的运行方法:
203+
204+
- 要接入图灵机器人API时:
205+
203206
1.[图灵机器人官网](http://www.tuling123.com/)注册账号,申请图灵key: [图灵key申请地址](http://www.tuling123.com/html/doc/apikey.html)
204207
2.***bot.py*** 文件所在目录下新建 ***conf.ini*** 文件,内容为:(key字段内容为申请到的图灵key)
205-
206208
```txt
207209
[main]
208210
key=1d2678900f734aa0a23734ace8aec5b1
@@ -211,3 +213,10 @@ python test.py
211213
```python
212214
python bot.py
213215
```
216+
217+
- 不接入图灵机器人API时(此时机器人对联系人消息以及群里@自己的消息统一回复 *知道了* 。):
218+
219+
1. 运行 ***bot.py***
220+
```python
221+
python bot.py
222+
```

wxbot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,9 @@ def wait4login(self, tip):
596596
return False
597597

598598
def login(self):
599+
if len(self.redirect_uri) < 4:
600+
print '[ERROR] Login failed due to network problem, please try again.'
601+
return False
599602
r = self.session.get(self.redirect_uri)
600603
r.encoding = 'utf-8'
601604
data = r.text

0 commit comments

Comments
 (0)