Skip to content

Commit 2c1db6b

Browse files
committed
fix: 调整age判断上限
1 parent 0a0bf61 commit 2c1db6b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/ding-dong-bot.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ async function 查询信息 (msgText: string, msg: Message) {
8484
const talkContact = msg.talker()
8585
const listenerContact = msg.listener()
8686
const room = msg.room()
87+
logTextList.push(`date: ${msg.date()}`)
88+
logTextList.push(`age: ${msg.age()}`)
8789
if (room) {
8890
logTextList.push(`room id: ${room.id}`)
8991
logTextList.push(`room topic: ${await room.topic()}`)
@@ -115,7 +117,8 @@ async function onMessage (msg: Message) {
115117
}
116118

117119
// 跳过近期的消息(重启服务,会把近期消息重新走一遍……)
118-
if (msg.age() > 60) {
120+
// 为什么是180: massage存活180秒后换新,所以实时消息age上限是180
121+
if (msg.age() > 180) {
119122
return
120123
}
121124

0 commit comments

Comments
 (0)