File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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+ ```
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments