mirror of
https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git
synced 2024-12-23 03:20:52 +08:00
更新图鉴初版
This commit is contained in:
parent
0284949fbc
commit
6f32c8c081
@ -27,7 +27,7 @@ export const rule = {
|
||||
|
||||
const _path = process.cwd();
|
||||
const resPath = `${_path}/plugins/cvs-plugin/resources/`;
|
||||
const plusPath = `${resPath}/res-plus/`;
|
||||
const plusPath = `${resPath}/xiaoyao-plus/`;
|
||||
|
||||
const checkAuth = async function (e) {
|
||||
return await e.checkAuth({
|
||||
@ -53,7 +53,7 @@ export async function updateRes(e) {
|
||||
if (fs.existsSync(`${resPath}/res-plus/`)) {
|
||||
e.reply("开始尝试更新,请耐心等待~");
|
||||
command = `git pull`;
|
||||
exec(command, { cwd: `${resPath}/res-plus/` }, function (error, stdout, stderr) {
|
||||
exec(command, { cwd: `${resPath}/xiaoyao-plus/` }, function (error, stdout, stderr) {
|
||||
//console.log(stdout);
|
||||
if (/Already up to date/.test(stdout)) {
|
||||
e.reply("目前所有图片都已经是最新了~");
|
||||
@ -71,7 +71,7 @@ export async function updateRes(e) {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
command = `git clone https://gitee.com/leiyilu/image.git "${resPath}/res-plus/"`;
|
||||
command = `git clone https://gitee.com/xiao-_-yao/image.git "${resPath}/xiaoyao-plus/"`;
|
||||
e.reply("开始尝试安装图片加量包,可能会需要一段时间,请耐心等待~");
|
||||
exec(command, function (error, stdout, stderr) {
|
||||
if (error) {
|
||||
|
@ -25,7 +25,7 @@ export async function roleInfo(e) {
|
||||
}
|
||||
// console.log(name)
|
||||
|
||||
send_Msg(e,"jiaose_tujian",name)
|
||||
send_Msg(e, "juese_tujian", name)
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -57,26 +57,15 @@ export async function init(isUpdate = false) {
|
||||
export async function weaponInfo(e) {
|
||||
|
||||
let msg = e.msg || '';
|
||||
|
||||
if (e.atBot) {
|
||||
msg = "#" + msg.replace("#", "");
|
||||
}
|
||||
|
||||
if (!/(#*(.*)(信息|图鉴|突破)|#(.*))$/.test(msg)) return;
|
||||
|
||||
let name = weapon.get(msg.replace(/#|#|信息|图鉴|突破/g, ""));
|
||||
|
||||
if (name) {
|
||||
|
||||
Bot.logger.mark(`[${e.group_name}] ${e.msg}:weaponInfo`);
|
||||
|
||||
let path = `${_path}/resources/weaponInfo_xiaoyao/${name}.png`
|
||||
|
||||
if (!fs.existsSync(path)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
e.reply(segment.image(`file:///${path}`));
|
||||
send_Msg(e, "wuqi_tujian", name)
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -90,25 +79,25 @@ export async function monsterInfo(e) {
|
||||
if (e.atBot) {
|
||||
msg = "#" + msg.replace("#", "");
|
||||
}
|
||||
|
||||
if (!/(#*食物(.*)|#(.*))$/.test(msg)) return;
|
||||
|
||||
let name = weapon.get(msg.replace(/#|#|信息|图鉴|突破|食物/g, ""));
|
||||
|
||||
let name = msg.replace(/#|#|信息|图鉴|突破|食物/g, "");
|
||||
if (name) {
|
||||
|
||||
Bot.logger.mark(`[${e.group_name}] ${e.msg}:weaponInfo`);
|
||||
|
||||
let path = `${_path}/resources/weaponInfo_xiaoyao/${name}.png`
|
||||
|
||||
if (!fs.existsSync(path)) {
|
||||
send_Msg(e, "shiwu_tujian", name)
|
||||
return true;
|
||||
}
|
||||
|
||||
e.reply(segment.image(`file:///${path}`));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export async function RelicsInfo(e) {
|
||||
let msg = e.msg || '';
|
||||
if (e.atBot) {
|
||||
msg = "#" + msg.replace("#", "");
|
||||
}
|
||||
if (!/(#*圣遗物(.*)|#(.*))$/.test(msg)) return;
|
||||
let name = msg.replace(/#|#|信息|副本|本/g, "");
|
||||
if (name) {
|
||||
send_Msg(e, "shengyiwu_tujian", name)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
16
index.js
16
index.js
@ -1,6 +1,6 @@
|
||||
import lodash from "lodash";
|
||||
import {
|
||||
roleInfo,weaponInfo
|
||||
roleInfo,weaponInfo,monsterInfo,RelicsInfo
|
||||
} from "./apps/xiaoyao_image.js"
|
||||
import {
|
||||
rule as adminRule,
|
||||
@ -9,7 +9,7 @@ import {
|
||||
} from "./apps/admin.js";
|
||||
export {
|
||||
updateRes,
|
||||
roleInfo,weaponInfo
|
||||
roleInfo,weaponInfo,monsterInfo
|
||||
};
|
||||
|
||||
|
||||
@ -24,14 +24,22 @@ let rule = {
|
||||
},
|
||||
roleInfo: {
|
||||
reg: "#*(.*)(信息|图鉴|命座|天赋|突破|材料|素材)$", //匹配消息正则,命令正则
|
||||
priority: 900, //优先级,越小优先度越高
|
||||
priority: 200, //优先级,越小优先度越高
|
||||
describe: "【刻晴信息、刻晴图鉴、刻晴突破、刻晴命座】角色信息图鉴", //【命令】功能说明
|
||||
},
|
||||
weaponInfo: {
|
||||
reg: "", //匹配消息正则,命令正则
|
||||
priority: 900, //优先级,越小优先度越高
|
||||
priority: 200, //优先级,越小优先度越高
|
||||
describe: "【刻晴信息、刻晴图鉴、刻晴突破、刻晴命座】角色信息图鉴", //【命令】功能说明
|
||||
},
|
||||
monsterInfo:{
|
||||
reg: "#*食物(.*)$", //匹配消息正则,命令正则
|
||||
describe: "食物图鉴", //【命令】功能说明
|
||||
},
|
||||
RelicsInfo:{
|
||||
reg: "#*圣遗物(.*)$", //匹配消息正则,命令正则
|
||||
describe: "圣遗物图鉴", //【命令】功能说明
|
||||
},
|
||||
...adminRule
|
||||
};
|
||||
|
||||
|
1
resources/res-plus
Submodule
1
resources/res-plus
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 5431648830f17b0d67514b8c41a37eae73b2b497
|
Loading…
Reference in New Issue
Block a user