File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change
1
+ > 2014.05
2
+
3
+ * 升级群列表加密验证
4
+ * 防掉线处理ing
5
+ * 忽略长时间离线消息
6
+
1
7
> 2014.03.21
2
8
3
9
* 增加讨论组支持
Original file line number Diff line number Diff line change @@ -61,13 +61,11 @@ https://github.com/xhan/qqbot/blob/master/CHANGELOG.md
61
61
资料
62
62
----
63
63
* WebQQ协议 https://github.com/xhan/qqbot/blob/master/protocol.md
64
- * WebQQ协议专题 http://www.10qf.com/forum-51-1.html
65
- * 开源的webqq协议的win客户端 https://code.google.com/p/mingqq/
66
- * http://webqq-core.googlecode.com/
67
- * https://github.com/im-qq/webqq-core
64
+ * Java版的另一个 http://webqq-core.googlecode.com/
68
65
69
66
TODO
70
67
---
68
+ * 自动重新登录
71
69
* 机器人响应前缀
72
70
* 图片发送支持
73
71
* 更多的插件
Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ port: 3100
8
8
host : localhost
9
9
10
10
11
+ # 消息处理,忽略20分钟外的离线消息
12
+ # offline_msg_keeptime: 1200
13
+
11
14
# 插件列表
12
15
plugins :
13
16
- help
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ class QQBot
212
212
log .error " poll with error #{ e} " if e
213
213
code = if resp then resp .retcode else - 1
214
214
switch code
215
- when - 1 then log .error " resp is null, error on parse ret"
215
+ when - 1 then log .error " resp is null, error on parse ret" ,resp
216
216
when 0 then @ _handle_poll_event (event) for event in resp .result
217
217
when 102 then ' nothing happened, waiting for next loop'
218
218
when 103
@@ -303,9 +303,12 @@ class QQBot
303
303
# 更新
304
304
@update_buddy_list unless msg .from_user
305
305
try log .debug " [好友消息]" ," #{ msg .from_user .nick } :#{ msg .content } #{ msg .time } "
306
-
307
306
308
- # 消息处理
307
+
308
+ # 消息和插件处理
309
+ if @config .offline_msg_keeptime and new Date ().getTime () - msg .time .getTime () > @config .offline_msg_keeptime * 1000
310
+ return
311
+
309
312
replied = false
310
313
reply = (content )=>
311
314
@ reply_message (msg,content) unless replied
You can’t perform that action at this time.
0 commit comments