diff --git a/apps/index.js b/apps/index.js index eb972f4a..e1022f1e 100644 --- a/apps/index.js +++ b/apps/index.js @@ -7,21 +7,10 @@ import help from './help.js' import admin from './admin.js' import gacha from './gacha.js' -export const characterApp = character.v2App() -export const profileApp = profile.v2App() -export const adminApp = admin.v2App() -export const helpApp = help.v2App() -export const statApp = stat.v2App() -export const wikiApp = wiki.v2App() -export const pokeApp = poke.v2App() -export const gachaApp = gacha.v2App() - let apps = { character, poke, profile, stat, wiki, gacha, admin, help } -let rule = {} // v2 let rules = {} // v3 for (let key in apps) { - rule[`${key}App`] = apps[key].v2Rule() rules[`${key}`] = apps[key].v3App() } -export { rule, rules as apps } +export { rules as apps } diff --git a/apps/profile/ProfileCommon.js b/apps/profile/ProfileCommon.js index b66b99a4..2afe1f51 100644 --- a/apps/profile/ProfileCommon.js +++ b/apps/profile/ProfileCommon.js @@ -20,32 +20,11 @@ const _getTargetUid = async function (e) { } let uid = false let getUid = async function (qq) { - let nCookie = global.NoteCookie || false - if (nCookie && nCookie[qq]) { - let nc = nCookie[qq] - if (nc.uid && uidReg.test(nc.uid)) { - return nc.uid - } - } uid = await redis.get(`genshin:id-uid:${qq}`) || await redis.get(`Yz:genshin:mys:qq-uid:${qq}`) if (uid && uidReg.test(uid)) { return uid } } - if (!Version.isV3) { - let botQQ = global?.Bot?.uin || global?.BotConfig?.account?.qq - if (e.at && e.at !== botQQ) { - uid = await getUid(e.at) - if (uid) { - return uid - } - } - - uid = await getUid(e.user_id) - if (uid) { - return uid - } - } try { let user = await MysApi.initUser(e) diff --git a/components/App.js b/components/App.js index e51c4816..c5c02e04 100644 --- a/components/App.js +++ b/components/App.js @@ -124,69 +124,6 @@ class App { } return cls } - - // 获取v2版rule - v2Rule () { - let cfg = this.cfg - return { - reg: 'noCheck', - describe: cfg.desc || '', - priority: cfg.priority || 50, - hashMark: true - } - } - - // v2执行方法 - v2App (e) { - let cfg = this.cfg || {} - let event = cfg.event - let apps = this.apps - return async function (e) { - e.original_msg = e.original_msg || e.msg - let msg = e.original_msg || e.msg || '' - for (let key in apps) { - let app = apps[key] - if (app.check && app.check(e, msg) === true) { - break - } - } - msg = e.msg - for (let key in apps) { - let app = apps[key] - let rule = app.rule || app.reg || 'noCheck' - if (app.rule) { - if (typeof (rule) === 'string') { - if (rule === '#poke#') { - continue - } else if (rule === 'noCheck') { - rule = /.*/ - } - rule = new RegExp(rule) - } - if (rule.test(msg)) { - let ret = await app.fn(e, {}) - if (ret === true) { - return true - } - } else if (app.yzRule && app.yzCheck()) { - rule = new RegExp(app.yzRule) - if (rule.test(msg)) { - let ret = await app.fn(e, {}) - if (ret === true) { - return true - } - } - } - } else if (event === 'poke' && msg === '#poke#') { - let ret = await app.fn(e, {}) - if (ret === true) { - return true - } - } - } - return false - } - } } App.init = function (cfg) { diff --git a/index.js b/index.js index 001fd530..585b9ef6 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ import { Data, Version } from '#miao' import fs from 'fs' if (!global.segment) { - global.segment = (await import("oicq")).segment + global.segment = (await import('oicq')).segment } export * from './apps/index.js' @@ -18,7 +18,7 @@ setTimeout(async function () { let msgStr = await redis.get('miao:restart-msg') let relpyPrivate = async function () { } - let common = await Data.importModule(Version.isV3 ? 'lib/common/common.js' : 'lib/common.js', 'root') + let common = await Data.importModule('lib/common/common.js', 'root') if (common && common.default && common.default.relpyPrivate) { relpyPrivate = common.default.relpyPrivate } @@ -29,8 +29,11 @@ setTimeout(async function () { let msgs = [`当前喵喵版本: ${Version.version}`, '您可使用 #喵喵版本 命令查看更新信息'] await relpyPrivate(msg.qq, msgs.join('\n')) } + if (!Version.isV3) { + console.log('警告:miao-plugin需要V3 Yunzai,请升级至最新版Miao-Yunzai以使用miao-plugin') + } if (!fs.existsSync(process.cwd() + '/lib/plugins/runtime.js')) { - let msg = '警告:未检测到runtime,miao-plugin可能无法正常工作。请升级至最新版Yunzai以使用miao-plugin' + let msg = '警告:未检测到runtime,miao-plugin可能无法正常工作。请升级至最新版Miao-Yunzai以使用miao-plugin' if (!await redis.get('miao:runtime-warning')) { await relpyPrivate(msg.qq, msg) await redis.set('miao:runtime-warning', 'true', { EX: 3600 * 24 }) diff --git a/models/ProfileRank.js b/models/ProfileRank.js index 7ff9c073..b5227be8 100644 --- a/models/ProfileRank.js +++ b/models/ProfileRank.js @@ -224,7 +224,7 @@ export default class ProfileRank { add(user.qq, uid, type) }) }) - } else if (Version.isV3) { + } else { if (rn?.gsCfg?.getBingCk) { // Yunzai-V3 let noteCks = await rn.gsCfg.getBingCk(game) || {} @@ -235,15 +235,6 @@ export default class ProfileRank { add(qq, uid, 'ck') }) } - } else { - // V2 - lodash.forEach(global.NoteCookie || {}, (ck) => { - const { qq, uid } = ck - if (!users[qq]) return true - if (qq && uid) { - add(qq, uid, 'ck') - } - }) } for (let qq in users) { diff --git a/resources/meta-sr/character/托帕&账账/imgs/cons-1.webp b/resources/meta-sr/character/托帕&账账/imgs/cons-1.webp new file mode 100644 index 00000000..c7177be9 Binary files /dev/null and b/resources/meta-sr/character/托帕&账账/imgs/cons-1.webp differ diff --git a/resources/meta-sr/character/托帕&账账/imgs/cons-2.webp b/resources/meta-sr/character/托帕&账账/imgs/cons-2.webp new file mode 100644 index 00000000..566837e2 Binary files /dev/null and b/resources/meta-sr/character/托帕&账账/imgs/cons-2.webp differ diff --git a/resources/meta-sr/character/托帕&账账/imgs/cons-4.webp b/resources/meta-sr/character/托帕&账账/imgs/cons-4.webp new file mode 100644 index 00000000..ae72385e Binary files /dev/null and b/resources/meta-sr/character/托帕&账账/imgs/cons-4.webp differ diff --git a/resources/meta-sr/character/托帕&账账/imgs/cons-6.webp b/resources/meta-sr/character/托帕&账账/imgs/cons-6.webp new file mode 100644 index 00000000..4dfdb8c8 Binary files /dev/null and b/resources/meta-sr/character/托帕&账账/imgs/cons-6.webp differ diff --git a/resources/meta-sr/character/托帕&账账/imgs/face.webp b/resources/meta-sr/character/托帕&账账/imgs/face.webp new file mode 100644 index 00000000..4262ac65 Binary files /dev/null and b/resources/meta-sr/character/托帕&账账/imgs/face.webp differ diff --git a/resources/meta-sr/character/托帕&账账/imgs/talent-a.webp b/resources/meta-sr/character/托帕&账账/imgs/talent-a.webp index 2a2e3c69..f7dce2e6 100644 Binary files a/resources/meta-sr/character/托帕&账账/imgs/talent-a.webp and b/resources/meta-sr/character/托帕&账账/imgs/talent-a.webp differ diff --git a/resources/meta-sr/character/托帕&账账/imgs/talent-e.webp b/resources/meta-sr/character/托帕&账账/imgs/talent-e.webp index 67ec3270..273a6860 100644 Binary files a/resources/meta-sr/character/托帕&账账/imgs/talent-e.webp and b/resources/meta-sr/character/托帕&账账/imgs/talent-e.webp differ diff --git a/resources/meta-sr/character/托帕&账账/imgs/talent-q.webp b/resources/meta-sr/character/托帕&账账/imgs/talent-q.webp index 3191fd68..88616ed5 100644 Binary files a/resources/meta-sr/character/托帕&账账/imgs/talent-q.webp and b/resources/meta-sr/character/托帕&账账/imgs/talent-q.webp differ diff --git a/resources/meta-sr/character/托帕&账账/imgs/talent-t.webp b/resources/meta-sr/character/托帕&账账/imgs/talent-t.webp index 13e31de8..724daf12 100644 Binary files a/resources/meta-sr/character/托帕&账账/imgs/talent-t.webp and b/resources/meta-sr/character/托帕&账账/imgs/talent-t.webp differ diff --git a/resources/meta-sr/character/托帕&账账/imgs/talent-z.webp b/resources/meta-sr/character/托帕&账账/imgs/talent-z.webp index d411e2fc..edd17ad7 100644 Binary files a/resources/meta-sr/character/托帕&账账/imgs/talent-z.webp and b/resources/meta-sr/character/托帕&账账/imgs/talent-z.webp differ diff --git a/resources/meta-sr/character/桂乃芬/imgs/cons-1.webp b/resources/meta-sr/character/桂乃芬/imgs/cons-1.webp new file mode 100644 index 00000000..0e7d6b8a Binary files /dev/null and b/resources/meta-sr/character/桂乃芬/imgs/cons-1.webp differ diff --git a/resources/meta-sr/character/桂乃芬/imgs/cons-2.webp b/resources/meta-sr/character/桂乃芬/imgs/cons-2.webp new file mode 100644 index 00000000..dc503dd2 Binary files /dev/null and b/resources/meta-sr/character/桂乃芬/imgs/cons-2.webp differ diff --git a/resources/meta-sr/character/桂乃芬/imgs/cons-4.webp b/resources/meta-sr/character/桂乃芬/imgs/cons-4.webp new file mode 100644 index 00000000..5b3c7f8a Binary files /dev/null and b/resources/meta-sr/character/桂乃芬/imgs/cons-4.webp differ diff --git a/resources/meta-sr/character/桂乃芬/imgs/cons-6.webp b/resources/meta-sr/character/桂乃芬/imgs/cons-6.webp new file mode 100644 index 00000000..8abd6a99 Binary files /dev/null and b/resources/meta-sr/character/桂乃芬/imgs/cons-6.webp differ diff --git a/resources/meta-sr/character/桂乃芬/imgs/face.webp b/resources/meta-sr/character/桂乃芬/imgs/face.webp index b6937c03..3aaba15a 100644 Binary files a/resources/meta-sr/character/桂乃芬/imgs/face.webp and b/resources/meta-sr/character/桂乃芬/imgs/face.webp differ diff --git a/resources/meta-sr/character/桂乃芬/imgs/preview.webp b/resources/meta-sr/character/桂乃芬/imgs/preview.webp new file mode 100644 index 00000000..7ac7c700 Binary files /dev/null and b/resources/meta-sr/character/桂乃芬/imgs/preview.webp differ diff --git a/resources/meta-sr/character/桂乃芬/imgs/talent-a.webp b/resources/meta-sr/character/桂乃芬/imgs/talent-a.webp index 0ab89143..8d042641 100644 Binary files a/resources/meta-sr/character/桂乃芬/imgs/talent-a.webp and b/resources/meta-sr/character/桂乃芬/imgs/talent-a.webp differ diff --git a/resources/meta-sr/character/桂乃芬/imgs/talent-e.webp b/resources/meta-sr/character/桂乃芬/imgs/talent-e.webp index ec95de3d..ecaab9e5 100644 Binary files a/resources/meta-sr/character/桂乃芬/imgs/talent-e.webp and b/resources/meta-sr/character/桂乃芬/imgs/talent-e.webp differ diff --git a/resources/meta-sr/character/桂乃芬/imgs/talent-q.webp b/resources/meta-sr/character/桂乃芬/imgs/talent-q.webp index 2f82cdcf..d169428b 100644 Binary files a/resources/meta-sr/character/桂乃芬/imgs/talent-q.webp and b/resources/meta-sr/character/桂乃芬/imgs/talent-q.webp differ diff --git a/resources/meta-sr/character/桂乃芬/imgs/talent-t.webp b/resources/meta-sr/character/桂乃芬/imgs/talent-t.webp index 64d8d79a..48c00d48 100644 Binary files a/resources/meta-sr/character/桂乃芬/imgs/talent-t.webp and b/resources/meta-sr/character/桂乃芬/imgs/talent-t.webp differ diff --git a/resources/meta-sr/character/桂乃芬/imgs/talent-z.webp b/resources/meta-sr/character/桂乃芬/imgs/talent-z.webp index 2063b28f..114c5a7e 100644 Binary files a/resources/meta-sr/character/桂乃芬/imgs/talent-z.webp and b/resources/meta-sr/character/桂乃芬/imgs/talent-z.webp differ diff --git a/resources/meta-sr/character/镜流/imgs/cons-1.webp b/resources/meta-sr/character/镜流/imgs/cons-1.webp new file mode 100644 index 00000000..dcffa0e9 Binary files /dev/null and b/resources/meta-sr/character/镜流/imgs/cons-1.webp differ diff --git a/resources/meta-sr/character/镜流/imgs/cons-2.webp b/resources/meta-sr/character/镜流/imgs/cons-2.webp new file mode 100644 index 00000000..b8191188 Binary files /dev/null and b/resources/meta-sr/character/镜流/imgs/cons-2.webp differ diff --git a/resources/meta-sr/character/镜流/imgs/cons-4.webp b/resources/meta-sr/character/镜流/imgs/cons-4.webp new file mode 100644 index 00000000..052533a2 Binary files /dev/null and b/resources/meta-sr/character/镜流/imgs/cons-4.webp differ diff --git a/resources/meta-sr/character/镜流/imgs/cons-6.webp b/resources/meta-sr/character/镜流/imgs/cons-6.webp new file mode 100644 index 00000000..10e0b335 Binary files /dev/null and b/resources/meta-sr/character/镜流/imgs/cons-6.webp differ diff --git a/resources/meta-sr/character/镜流/imgs/face.webp b/resources/meta-sr/character/镜流/imgs/face.webp index 848836fe..a52ca676 100644 Binary files a/resources/meta-sr/character/镜流/imgs/face.webp and b/resources/meta-sr/character/镜流/imgs/face.webp differ diff --git a/resources/meta-sr/character/镜流/imgs/preview.webp b/resources/meta-sr/character/镜流/imgs/preview.webp new file mode 100644 index 00000000..635ecc2d Binary files /dev/null and b/resources/meta-sr/character/镜流/imgs/preview.webp differ diff --git a/resources/meta-sr/character/镜流/imgs/talent-a.webp b/resources/meta-sr/character/镜流/imgs/talent-a.webp index 88d2ff2d..8ab88651 100644 Binary files a/resources/meta-sr/character/镜流/imgs/talent-a.webp and b/resources/meta-sr/character/镜流/imgs/talent-a.webp differ diff --git a/resources/meta-sr/character/镜流/imgs/talent-e.webp b/resources/meta-sr/character/镜流/imgs/talent-e.webp index 1495be41..8c826029 100644 Binary files a/resources/meta-sr/character/镜流/imgs/talent-e.webp and b/resources/meta-sr/character/镜流/imgs/talent-e.webp differ diff --git a/resources/meta-sr/character/镜流/imgs/talent-q.webp b/resources/meta-sr/character/镜流/imgs/talent-q.webp index c8ad7d17..1bc5b3d6 100644 Binary files a/resources/meta-sr/character/镜流/imgs/talent-q.webp and b/resources/meta-sr/character/镜流/imgs/talent-q.webp differ diff --git a/resources/meta-sr/character/镜流/imgs/talent-t.webp b/resources/meta-sr/character/镜流/imgs/talent-t.webp index d73c26ee..688f4654 100644 Binary files a/resources/meta-sr/character/镜流/imgs/talent-t.webp and b/resources/meta-sr/character/镜流/imgs/talent-t.webp differ diff --git a/resources/meta-sr/character/镜流/imgs/talent-z.webp b/resources/meta-sr/character/镜流/imgs/talent-z.webp index c1492315..10cb880c 100644 Binary files a/resources/meta-sr/character/镜流/imgs/talent-z.webp and b/resources/meta-sr/character/镜流/imgs/talent-z.webp differ