mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-06-04 21:01:17 +08:00
parent
c7bdf74d5c
commit
b6c56c5061
11
lib/clear.js
11
lib/clear.js
@ -6,12 +6,13 @@ const config = require("./data/config");
|
||||
|
||||
/**
|
||||
* 获取关注分区里的uid
|
||||
* @param {string} partition
|
||||
* @returns { Promise<number[]> }
|
||||
*/
|
||||
async function getFollowList() {
|
||||
async function getFollowList(partition) {
|
||||
const
|
||||
{ clear_partition, clear_white_list, get_partition_wait } = config,
|
||||
tagid = await bili.checkMyPartition(clear_partition);
|
||||
{ clear_white_list, get_partition_wait } = config,
|
||||
tagid = await bili.checkMyPartition(partition);
|
||||
let rmup = [];
|
||||
if (typeof tagid === 'undefined') {
|
||||
log.info('获取关注列表', '未能成功获取关注分区id');
|
||||
@ -32,9 +33,9 @@ async function getFollowList() {
|
||||
* 清理动态和关注
|
||||
*/
|
||||
async function clear() {
|
||||
const { search_wait, clear_white_list, clear_max_day, clear_quick_remove_attention, clear_remove_dynamic, clear_remove_attention, clear_remove_delay, clear_dynamic_type } = config;
|
||||
const { search_wait, clear_white_list, clear_max_day, clear_quick_remove_attention, clear_remove_dynamic, clear_remove_attention, clear_remove_delay, clear_dynamic_type, clear_partition } = config;
|
||||
let success = true;
|
||||
const uid_list = await getFollowList();
|
||||
const uid_list = (await Promise.all(clear_partition.split(',').map(getFollowList))).flat();
|
||||
if (!uid_list.length) {
|
||||
log.info('清理关注', `关注为空`)
|
||||
} else {
|
||||
|
||||
@ -1152,7 +1152,7 @@ const bili_client = {
|
||||
if (res.code === 0) {
|
||||
const data = res.data.filter((it) => it.name === name);
|
||||
if (data.length) {
|
||||
log.info('获取分区id', '成功');
|
||||
log.info('获取分区id', `成功 ${name}`);
|
||||
tagid = data[0].tagid;
|
||||
} else {
|
||||
log.warn('获取分区id', `失败 无指定分区名${name}`);
|
||||
@ -1219,10 +1219,10 @@ const bili_client = {
|
||||
res.data.forEach(d => {
|
||||
uids.push(d.mid);
|
||||
});
|
||||
log.info(`获取分组${tagid}`, `成功获取取关分区列表${n}`);
|
||||
log.info(`获取分组id${tagid}`, `成功获取取关分区列表${n}`);
|
||||
return uids;
|
||||
} else {
|
||||
log.error(`获取分组${tagid}`, `获取取关分区列表失败\n${responseText}`);
|
||||
log.error(`获取分组id${tagid}`, `获取取关分区列表失败\n${responseText}`);
|
||||
return uids;
|
||||
}
|
||||
}
|
||||
|
||||
@ -403,6 +403,7 @@ module.exports = Object.freeze({
|
||||
/**
|
||||
* - 取关分区
|
||||
* - 默认为: 此处存放因抽奖临时关注的up
|
||||
* - 可用逗号分割以取关多分区
|
||||
*/
|
||||
clear_partition: '',
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user