mirror of
https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git
synced 2024-12-23 11:40:51 +08:00
增加全部签到无文件拦截防止报错
This commit is contained in:
parent
e71499babc
commit
ed25095ba3
@ -12,7 +12,6 @@ import {
|
|||||||
} from '../components/Changelog.js';
|
} from '../components/Changelog.js';
|
||||||
import gsCfg from '../model/gsCfg.js';
|
import gsCfg from '../model/gsCfg.js';
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
|
||||||
export const rule = {
|
export const rule = {
|
||||||
mysSign: {
|
mysSign: {
|
||||||
reg: "^#*(米游社|mys|社区)(原神|崩坏3|崩坏2|未定事件簿|大别野|崩坏星穹铁道|绝区零|全部)签到$",
|
reg: "^#*(米游社|mys|社区)(原神|崩坏3|崩坏2|未定事件簿|大别野|崩坏星穹铁道|绝区零|全部)签到$",
|
||||||
@ -48,7 +47,7 @@ const RETRY_OPTIONS = {
|
|||||||
minTimeout: 5000,
|
minTimeout: 5000,
|
||||||
maxTimeout: 10000
|
maxTimeout: 10000
|
||||||
};
|
};
|
||||||
|
let YamlDataUrl = `${_path}/plugins/xiaoyao-cvs-plugin/data/yaml`;
|
||||||
export async function sign(e) {
|
export async function sign(e) {
|
||||||
let {
|
let {
|
||||||
skuid,
|
skuid,
|
||||||
@ -368,6 +367,11 @@ export async function signlist(e) {
|
|||||||
let msg = e.msg.replace(/#|全部签到/g, "")
|
let msg = e.msg.replace(/#|全部签到/g, "")
|
||||||
e.reply(`开始执行${msg}签到中,请勿重复执行`);
|
e.reply(`开始执行${msg}签到中,请勿重复执行`);
|
||||||
if (msg == "米游币") {
|
if (msg == "米游币") {
|
||||||
|
if(!fs.existsSync(YamlDataUrl)){
|
||||||
|
Data.createDir("", YamlDataUrl, false);
|
||||||
|
e.reply("未读取到可签到文件")
|
||||||
|
return true;
|
||||||
|
}
|
||||||
ismysbool=true;
|
ismysbool=true;
|
||||||
await allMysSign()
|
await allMysSign()
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user