mirror of
https://github.com/hex-ci/smzdm_script.git
synced 2026-05-11 11:07:32 +08:00
Update smzdm_task.js
This commit is contained in:
@@ -1557,48 +1557,50 @@ class SmzdmTaskBot extends SmzdmBot {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
!(async () => {
|
if (require.main === module) {
|
||||||
const cookies = getEnvCookies();
|
!(async () => {
|
||||||
|
const cookies = getEnvCookies();
|
||||||
|
|
||||||
if (cookies === false) {
|
if (cookies === false) {
|
||||||
$.log('\n请先设置 SMZDM_COOKIE 环境变量');
|
$.log('\n请先设置 SMZDM_COOKIE 环境变量');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
let notifyContent = '';
|
|
||||||
|
|
||||||
for (let i = 0; i < cookies.length; i++) {
|
|
||||||
const cookie = cookies[i];
|
|
||||||
|
|
||||||
if (!cookie) {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i > 0) {
|
let notifyContent = '';
|
||||||
$.log();
|
|
||||||
await wait(10, 30);
|
for (let i = 0; i < cookies.length; i++) {
|
||||||
$.log();
|
const cookie = cookies[i];
|
||||||
|
|
||||||
|
if (!cookie) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i > 0) {
|
||||||
|
$.log();
|
||||||
|
await wait(10, 30);
|
||||||
|
$.log();
|
||||||
|
}
|
||||||
|
|
||||||
|
const sep = `\n****** 账号${i + 1} ******\n`;
|
||||||
|
|
||||||
|
$.log(sep);
|
||||||
|
|
||||||
|
const bot = new SmzdmTaskBot(cookie);
|
||||||
|
const msg = await bot.run();
|
||||||
|
|
||||||
|
notifyContent += `${sep}${msg}\n`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sep = `\n****** 账号${i + 1} ******\n`;
|
$.log();
|
||||||
|
|
||||||
$.log(sep);
|
await notify.sendNotify($.name, notifyContent);
|
||||||
|
})().catch((e) => {
|
||||||
const bot = new SmzdmTaskBot(cookie);
|
$.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
|
||||||
const msg = await bot.run();
|
}).finally(() => {
|
||||||
|
$.done();
|
||||||
notifyContent += `${sep}${msg}\n`;
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$.log();
|
|
||||||
|
|
||||||
await notify.sendNotify($.name, notifyContent);
|
|
||||||
})().catch((e) => {
|
|
||||||
$.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
|
|
||||||
}).finally(() => {
|
|
||||||
$.done();
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
SmzdmTaskBot,
|
SmzdmTaskBot,
|
||||||
|
|||||||
Reference in New Issue
Block a user