diff --git a/CHANGELOG.md b/CHANGELOG.md
index 127b75b..161bbec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,9 @@
* 新增`#图鉴模板更新`
* 用于更新体力模板具体来源由**@SunRyK** **@地球生物** **@逍遥** 三位作者上传
* 不会冲突已添加的模板数据,有需求可通过指令拉取
+* 新增`#图鉴设置获取sk开启、关闭`
+ * 绑定ck时自动获取sk
+ * 风险自担!!! 插件只负责提供功能
# 1.2.3
* 新增地图资源查询功能
* `#月莲在哪里` 指令类似 `某某物品在哪里`
diff --git a/apps/Note.js b/apps/Note.js
index 76bf842..4e5d067 100644
--- a/apps/Note.js
+++ b/apps/Note.js
@@ -430,15 +430,16 @@ export async function Note_appoint(e) {
for (let [index, item] of keyType.entries()) {
let msg_pass = [];
let imgurl;
+ let pathFile=urlType[item].replace(/\./,_path)
if (item.includes(".")) {
- imgurl = await segment.image(`file:///${urlType[item]}`);
+ imgurl = await segment.image(`file:///${pathFile}`);
item = item.split(".")[0];
} else {
imgurl = await segment.image(
- `file:///${urlType[item]}/icon/bg/${fs.readdirSync(`${urlType[item]}/icon/bg/`)[0]}`
+ `file:///${pathFile}/icon/bg/${fs.readdirSync(`${pathFile}/icon/bg/`)[0]}`
)
}
- if (isUser && !temp.includes(item)) {
+ if (isUser && !temp?.includes(item)) {
continue;
}
item = index + 1 + "." + item
@@ -489,7 +490,7 @@ export async function Note_appoint(e) {
if (typeof tempData[e.user_id]["temp"] === "string") {
temp = [tempData[e.user_id]["temp"], msg]
} else {
- if (!tempData[e.user_id]["temp"].includes(msg)) {
+ if (!tempData[e.user_id]["temp"]?.includes(msg)) {
temp = [...tempData[e.user_id]["temp"], msg]
}
}
diff --git a/apps/admin.js b/apps/admin.js
index 313929c..e0f0379 100644
--- a/apps/admin.js
+++ b/apps/admin.js
@@ -23,6 +23,7 @@ let cfgMap = {
"匹配": "sys.Atlas",
"戳一戳":"note.poke",
"模板": "mb.len",
+ "获取sk":"ck.sk",
"目录":"Atlas.all",
};
let sysCfgReg = `^#图鉴设置\s*(${lodash.keys(cfgMap).join("|")})?\s*(.*)$`;
@@ -67,6 +68,7 @@ export async function sysCfg(e, {
if (!regRet) {
return true;
}
+
if (regRet[1]) {
// 设置模式
@@ -85,14 +87,13 @@ export async function sysCfg(e, {
Cfg.set(cfgKey, val);
}
}
- // e.reply("设置成功!!");
- // return true;
let cfg = {
help: getStatus("sys.help", false),
Note: getStatus("sys.Note",false),
Atlas: getStatus("sys.Atlas",false),
len:Cfg.get("mb.len", 0),
poke: getStatus("note.poke",false),
+ isSk: getStatus("ck.sk",false),
imgPlus: fs.existsSync(plusPath),
notePlus: fs.existsSync(notePlus),
bg: await rodom(), //获取底图
diff --git a/apps/index.js b/apps/index.js
index 2d8327a..e2edc07 100644
--- a/apps/index.js
+++ b/apps/index.js
@@ -33,7 +33,7 @@ import {
userInfo,
gclog,
mytoken,
- bindStoken,
+ bindStoken,bindLogin_ticket,
cloudToken
} from "./user.js"
import {
@@ -50,7 +50,7 @@ export {
updateRes,updateTemp,
delSign,
cloudSign,
- seach,
+ seach,bindLogin_ticket,
bbsSign,
gclog,
mytoken,
diff --git a/apps/user.js b/apps/user.js
index 69bbd3b..ae9a6b0 100644
--- a/apps/user.js
+++ b/apps/user.js
@@ -35,6 +35,10 @@ export const rule = {
reg: "^(.*)stoken=(.*)$",
describe: "绑定stoken"
},
+ bindLogin_ticket: {
+ reg: "^(.*)login_ticket=(.*)$",
+ describe: "绑定ck自动获取sk"
+ },
cloudToken: {
reg: "^(.*)ct(.*)$",
describe: "云原神签到token获取"
@@ -156,6 +160,29 @@ export async function mytoken(e) {
e.reply(sendMsg)
return true;
}
+
+export async function bindLogin_ticket(e){
+ let user = new User(e);
+ let ckMap=await utils.getCookieMap(e.original_msg.replace(/'|"/g,""))
+ if(ckMap&&Cfg.get("ck.sk")){
+ let res= await user.getData("bbsStoken", {
+ loginUid:ckMap?.get("login_uid") ? ckMap?.get("login_uid") : ckMap?.get("ltuid"),
+ loginTicket:ckMap.get("login_ticket"),
+ },false)
+ if(res?.retcode===0){
+ let msg = 'stoken绑定成功您可通过下列指令进行操作:';
+ msg += '\n【#米币查询】查询米游币余额'
+ msg += '\n【#mys原神签到】获取米游币'
+ msg += '\n【#更新抽卡记录】更新抽卡记录'
+ msg += '\n【#刷新ck】刷新失效cookie'
+ msg += '\n【#我的stoken】查看绑定信息'
+ msg += '\n【#删除stoken】删除绑定信息'
+ e.reply(msg)
+ }
+ }
+ return false;
+}
+
export async function bindStoken(e) {
if (!e.isPrivate) {
e.reply("请私聊发送")
diff --git a/defSet/config/config.yaml b/defSet/config/config.yaml
index c1c0432..842fe17 100644
--- a/defSet/config/config.yaml
+++ b/defSet/config/config.yaml
@@ -34,6 +34,6 @@ gclogEx: 5
# 体力设置开启关闭权限 1-群管理员才能开启关闭 2-主人才能开启关闭
noteSetAuth: 2
# 体力推送 间隔 10分钟检索一次
-noteTask: 0 0/10 * * ?
+noteTask: 0 0/10 * * * ?
# 全局开关体力推送 关闭后不可操作体力推送相关内容 true开启 false 关闭
isNoteTask: false
\ No newline at end of file
diff --git a/resources/admin/index.html b/resources/admin/index.html
index 6de3c09..7bd5dca 100644
--- a/resources/admin/index.html
+++ b/resources/admin/index.html
@@ -5,7 +5,7 @@