2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 03:20:52 +08:00

格式化代码

This commit is contained in:
ctrlcvs 2022-12-03 23:52:06 +08:00
parent 8a595232e2
commit b66750b84f
11 changed files with 103 additions and 111 deletions

View File

@ -1,6 +1,3 @@
import {
segment
} from "oicq";
import fs from "fs"; import fs from "fs";
import lodash from "lodash"; import lodash from "lodash";
import { import {
@ -14,9 +11,6 @@ import {
} from "../components/index.js"; } from "../components/index.js";
import Common from "../components/Common.js"; import Common from "../components/Common.js";
const require = createRequire(
import.meta.url);
let cfgMap = { let cfgMap = {
"体力": "sys.Note", "体力": "sys.Note",
"帮助": "sys.help", "帮助": "sys.help",

View File

@ -1,9 +1,6 @@
import { import {
Cfg Cfg
} from "../components/index.js"; } from "../components/index.js";
import {
segment
} from "oicq";
import lodash from "lodash"; import lodash from "lodash";
import { import {
currentVersion, currentVersion,

View File

@ -1,15 +1,8 @@
import miHoYoApi from "../model/mys/mihoyoApi.js"
import utils from '../model/mys/utils.js';
import User from "../model/user.js" import User from "../model/user.js"
import moment from 'moment'; import moment from 'moment';
import {
Cfg,
Data
} from "../components/index.js";
import { import {
segment segment
} from "oicq"; } from "oicq";
import user from "../model/user.js";
export const rule = { export const rule = {
sign: { sign: {
reg: `^#*(原神|崩坏3|崩坏2|未定事件簿)签到$`, reg: `^#*(原神|崩坏3|崩坏2|未定事件簿)签到$`,
@ -107,7 +100,6 @@ export async function bbsSign(e) {
await replyMsg(e, res.message); await replyMsg(e, res.message);
return true; return true;
} }
const _path = process.cwd();
let START; let START;
export async function sign(e) { export async function sign(e) {
let user = new User(e); let user = new User(e);

View File

@ -4,19 +4,14 @@ import {
Data Data
} from "../components/index.js"; } from "../components/index.js";
import moment from 'moment'; import moment from 'moment';
import lodash from 'lodash';
import Common from "../components/Common.js"; import Common from "../components/Common.js";
import { import {
isV3 isV3
} 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";
import {
segment
} from "oicq";
import YAML from 'yaml' import YAML from 'yaml'
import User from "../model/user.js" import User from "../model/user.js"
import user from '../model/user.js';
export const rule = { export const rule = {
userInfo: { userInfo: {
@ -87,7 +82,6 @@ export async function userInfo(e, {
render, render,
scale: 1.2 scale: 1.2
}) })
return true;
} }
let configData = gsCfg.getfileYaml(`${_path}/plugins/xiaoyao-cvs-plugin/config/`, "config"); let configData = gsCfg.getfileYaml(`${_path}/plugins/xiaoyao-cvs-plugin/config/`, "config");
export async function gcPaylog(e) { export async function gcPaylog(e) {
@ -136,12 +130,6 @@ export async function gcPaylog(e){
} else { } else {
e._reply(`V2暂不支持`); e._reply(`V2暂不支持`);
return false return false
//V2暂不支持
// let {
// bing
// } = (await import(`file:///${_path}/lib/app/gachaLog.js`))
// e.isPrivate = true;
// await bing(e)
} }
} }
await utils.replyMake(e, sendMsg, 1) await utils.replyMake(e, sendMsg, 1)
@ -229,6 +217,10 @@ export async function mytoken(e) {
} }
export async function bindLogin_ticket(e) { export async function bindLogin_ticket(e) {
if (!e.isPrivate) {
e.reply("请私聊发送")
return true;
}
let user = new User(e); let user = new User(e);
let ckMap = await utils.getCookieMap(e.original_msg.replace(/'|"/g, "")) let ckMap = await utils.getCookieMap(e.original_msg.replace(/'|"/g, ""))
let stuid = ckMap?.get("login_uid") ? ckMap?.get("login_uid") : ckMap?.get("ltuid") let stuid = ckMap?.get("login_uid") ? ckMap?.get("login_uid") : ckMap?.get("ltuid")

View File

@ -5,16 +5,12 @@ import fs from "fs";
import { import {
Cfg Cfg
} from "../components/index.js"; } from "../components/index.js";
import Data from "../components/Data.js"
import path from 'path';
import fetch from "node-fetch";
import gsCfg from '../model/gsCfg.js' import gsCfg from '../model/gsCfg.js'
import { import {
isV3 isV3
} from '../components/Changelog.js' } from '../components/Changelog.js'
import utils from "../model/mys/utils.js"; import utils from "../model/mys/utils.js";
const _path = process.cwd(); const _path = process.cwd();
const __dirname = path.resolve();
const list = ["wuqi_tujian", "shiwu_tujian", "yuanmo_tujian", "mijin_tujian", "shengyiwu_tujian", "daoju_tujian"] const list = ["wuqi_tujian", "shiwu_tujian", "yuanmo_tujian", "mijin_tujian", "shengyiwu_tujian", "daoju_tujian"]
const reglist = ["(#|专武|武器|图鉴)", "(#|食物|特殊料理|特色|料理|食材|图鉴)", "(#|原魔|怪物|图鉴|信息)", "(#|秘境|信息|图鉴)", "(#|圣遗物|图鉴|本|套)", const reglist = ["(#|专武|武器|图鉴)", "(#|食物|特殊料理|特色|料理|食材|图鉴)", "(#|原魔|怪物|图鉴|信息)", "(#|秘境|信息|图鉴)", "(#|圣遗物|图鉴|本|套)",

View File

@ -1,20 +1,13 @@
import YAML from 'yaml' import YAML from 'yaml'
import chokidar from 'chokidar'
import fs from 'node:fs' import fs from 'node:fs'
import { import {
promisify promisify
} from 'node:util' } from 'node:util'
import lodash from 'lodash' import lodash from 'lodash'
import {
Data
} from "../components/index.js";
import { import {
isV3 isV3
} from '../components/Changelog.js'; } from '../components/Changelog.js';
import utils from './mys/utils.js';
const plugin = "xiaoyao-cvs-plugin" const plugin = "xiaoyao-cvs-plugin"
const pathPlugin=`./plugins/${plugin}/data/`
/** /**
* 配置文件 * 配置文件
* 主要用于处理 stoken以及云原神账号数据 * 主要用于处理 stoken以及云原神账号数据

View File

@ -1,5 +1,4 @@
import YAML from 'yaml' import YAML from 'yaml'
import chokidar from 'chokidar'
import miHoYoApi from "../model/mys/mihoyoApi.js" import miHoYoApi from "../model/mys/mihoyoApi.js"
import fs from 'node:fs' import fs from 'node:fs'
import lodash from 'lodash' import lodash from 'lodash'
@ -15,11 +14,6 @@ import {
import moment from 'moment' import moment from 'moment'
const _path = process.cwd(); const _path = process.cwd();
const plugin = "xiaoyao-cvs-plugin" const plugin = "xiaoyao-cvs-plugin"
const RETRY_OPTIONS = {
retries: 3,
minTimeout: 5000,
maxTimeout: 10000
};
const nameData = ["原神", "崩坏3", "崩坏2", "未定事件簿"]; const nameData = ["原神", "崩坏3", "崩坏2", "未定事件簿"];
const yamlDataUrl = `${_path}/plugins/xiaoyao-cvs-plugin/data/yaml`; const yamlDataUrl = `${_path}/plugins/xiaoyao-cvs-plugin/data/yaml`;
const cloudDataUrl = `${_path}/plugins/xiaoyao-cvs-plugin/data/yunToken/` const cloudDataUrl = `${_path}/plugins/xiaoyao-cvs-plugin/data/yunToken/`

View File

@ -33,6 +33,7 @@
- 冬极 - 冬极
- 冬季 - 冬季
- 公子 - 公子
- 白星
- 达达利亚 - 达达利亚
- 鸭鸭 - 鸭鸭
- 达达鸭 - 达达鸭

View File

@ -450,11 +450,13 @@
- 火使徒 - 火使徒
- 火咏者 - 火咏者
- 深渊使徒渊火 - 深渊使徒渊火
- 深渊咏者渊火
深渊咏者·紫电: 深渊咏者·紫电:
- 紫电 - 紫电
- 雷使徒 - 雷使徒
- 雷咏者 - 雷咏者
- 深渊使徒紫电 - 深渊使徒紫电
- 深渊咏者紫电
火深渊法师: 火深渊法师:
- 火法师 - 火法师
- 火法 - 火法

View File

@ -41,6 +41,37 @@ export const helpList = [{
"desc": "重写原有的查询当前米游社体力" "desc": "重写原有的查询当前米游社体力"
}, },
] ]
},{
"group": "stoken功能",
"list": [{
"icon": 75,
"title": "#更新抽卡记录",
"desc": "(更新|获取) 抽卡记录"
},
{
"icon": 74,
"title": "#mys原神签到",
"desc": "社区米游币获取(由于有验证码大概会失败)"
},
{
"icon": 92,
"title": "#刷新ck",
"desc": "重置当前cookie"
},
]
},{
"group": "其他功能",
"list": [{
"icon": 77,
"title": "#云原神签到",
"desc": "云原神签到"
},
{
"icon": 78,
"title": "#崩坏三签到",
"desc": "其余模块签到支持崩坏3|崩坏2|未定义)"
},
]
},{ },{
"group": "管理命令,仅管理员可用", "group": "管理命令,仅管理员可用",
"auth": "master", "auth": "master",