diff --git a/lib/plugins/loader.js b/lib/plugins/loader.js index 83ebb71..9953e4b 100644 --- a/lib/plugins/loader.js +++ b/lib/plugins/loader.js @@ -220,7 +220,7 @@ class PluginsLoader { // 判断是否是星铁命令,若是星铁命令则标准化处理 // e.isSr = true,且命令标准化为 #星铁 开头 - if (this.srReg.test(e.msg) || /\/common\//.test(e.msg)) { + if (this.srReg.test(e.msg) || /(\/common\/|hkrpg)/.test(e.msg)) { e.isSr = true e.msg = e.msg.replace(this.srReg, '#星铁') } diff --git a/plugins/genshin/model/gachaLog.js b/plugins/genshin/model/gachaLog.js index 98eea29..4c9d412 100644 --- a/plugins/genshin/model/gachaLog.js +++ b/plugins/genshin/model/gachaLog.js @@ -90,6 +90,7 @@ export default class GachaLog extends base { // timestamp=1641338980〈=zh-cn 修复链接有奇怪符号 url = url.replace(/〈=/g, '&') if (url.includes('getGachaLog?')) url = url.split('getGachaLog?')[1] + if (url.includes('index.html?')) url = url.split('index.html?')[1] // 处理参数 let arr = new URLSearchParams(url).entries() @@ -141,8 +142,25 @@ export default class GachaLog extends base { async checkUrl (param) { if (!param.region) { - this.e.reply('链接参数错误:缺少region\n请复制完整链接') - return false + let res = await this.logApi({ + size: 6, + authkey: param.authkey, + region: this.e.isSr ? 'prod_gf_cn' : 'cn_gf01' + }) + if (!res?.data?.region) { + res = await this.logApi({ + size: 6, + authkey: param.authkey, + region: this.e.isSr ? 'prod_official_usa' : 'os_usa' + }) + } + + if (res?.data?.region) { + param.region = res?.data?.region + } else { + await this.e.reply('链接复制错误或已失效') + return false + } } let res = await this.logApi({