feat: 新增设置check_session_pages(#66)

获取私信页数
- check_session_pages
- 默认16
This commit is contained in:
shanmite 2021-11-17 15:36:54 +08:00
parent 24e16ed8bc
commit 09b6db4f8b
3 changed files with 13 additions and 2 deletions

View File

@ -10,7 +10,7 @@ const bili = require('./net/bili')
async function isMe() {
let desp = '';
const
{ notice_key_words, update_session_wait, get_session_wait } = config,
{ notice_key_words, update_session_wait, get_session_wait, check_session_pages } = config,
UnreadAtNum = await bili.getUnreadAtNum(),
UnreadSessionNum = await bili.getUnreadSessionNum(),
{ follow_unread, unfollow_unread } = UnreadSessionNum || { unfollow_unread: 0, follow_unread: 0 };
@ -34,6 +34,7 @@ async function isMe() {
const check = async (type) => {
let session_t = '';
let MySession = await bili.getSessionInfo(type)
log.info("准备检查私信", check_session_pages + "页")
for (const index of infiniteNumber()) {
for (const Session of MySession.data) {
const { sender_uid, session_ts, timestamp, unread_count, talker_id, msg_seqno } = Session;
@ -53,7 +54,7 @@ async function isMe() {
await delay(update_session_wait);
}
}
if (MySession.has_more && index < 16) {
if (MySession.has_more && index < check_session_pages) {
await delay(get_session_wait);
MySession = await bili.getSessionInfo(type, session_t)
} else {

View File

@ -269,6 +269,11 @@ const config = {
"中奖|获得|填写|写上|提供|收货地址|支付宝账号|码|大会员"
],
/**
* - 获取私信页数
*/
check_session_pages: 16,
/**
* - 清理白名单uid或dyid
* - 英文逗号分隔 : 1,2,3

View File

@ -283,6 +283,11 @@ module.exports = Object.freeze({
"中奖|获得|填写|写上|提供|收货地址|支付宝账号|码|大会员"
],
/**
* - 获取私信页数
*/
check_session_pages: 16,
/**
* - 清理白名单uid或dyid
* - 英文逗号分隔 : 1,2,3