星铁抽卡记录自动补全region,适配安卓另一格式的星铁抽卡链接
This commit is contained in:
parent
e79449f9f1
commit
fede942a79
|
@ -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, '#星铁')
|
||||
}
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue