面板服务增加由**Snap Hutao**提供的Enka转发代理,可通过#喵喵设置面板服务4
进行选择
部分角色资源文件结构调整
10
CHANGELOG.md
@ -1,9 +1,9 @@
|
||||
# 2.3.7
|
||||
# 2.3.8
|
||||
|
||||
* 增加3.6新圣遗物数据及资源
|
||||
* 增加绮良良的角色信息,可通过`#绮良良天赋`、`#绮良良图鉴`等查看
|
||||
* 面板服务增加由**Snap Hutao**提供的Enka转发代理,可通过`#喵喵设置面板服务4`进行选择
|
||||
* 部分角色资源文件结构调整
|
||||
|
||||
# 2.3.1~2.3.6
|
||||
# 2.3.1~2.3.7
|
||||
|
||||
* 增加`#角色记录``#抽卡统计`功能,可在`#喵喵设置`中开启
|
||||
* `#角色记录`、`#武器记录`、`#常驻记录` 可查看对应池子的抽卡记录
|
||||
@ -24,6 +24,8 @@
|
||||
* 面板更新的提醒文案逻辑优化
|
||||
* `#雷神面板` 属性部分样式调整,增加圣遗物评分权重展示
|
||||
* 圣遗物评级的分数上限微调
|
||||
* 增加3.6新圣遗物数据及资源
|
||||
* 增加绮良良的角色信息,可通过`#绮良良天赋`、`#绮良良图鉴`等查看
|
||||
|
||||
# 2.3.0
|
||||
|
||||
|
@ -1,48 +1,45 @@
|
||||
/**
|
||||
* 如需配置【复制】此文件,改名为profile.js
|
||||
* 暂未做热更新,修改完毕请重启yunzai
|
||||
* */
|
||||
* 如需配置【复制】此文件,改名为profile.js
|
||||
* 暂未做热更新,修改完毕请重启yunzai
|
||||
* */
|
||||
|
||||
/**
|
||||
* Enka面板服务API配置
|
||||
*
|
||||
* 【Enka官网】:https://enka.network/
|
||||
*
|
||||
* 感谢Enka提供的面板查询服务
|
||||
* 如果可以的话,也可考虑在Patreon上支持Enka
|
||||
* 【Patreon】:https://www.patreon.com/algoinde
|
||||
*
|
||||
* 目前使用Miao-Plugin的默认UA请求国服UID时
|
||||
* 会默认重定向 https://enka.network/ 到 https://profile.microgg.cn/
|
||||
*
|
||||
* 感谢@MiniGrayGay 大佬提供的服务(Github: https://github.com/MiniGrayGay)
|
||||
*
|
||||
* 使用代理(科学上网)可以配置proxyAgent
|
||||
* 例如: http://127.0.0.1:1080
|
||||
* */
|
||||
|
||||
* Enka面板服务API配置
|
||||
*
|
||||
* 【Enka官网】:https://enka.network/
|
||||
* 感谢Enka提供的面板查询服务,如果可以的话,也可考虑在Patreon上支持Enka
|
||||
* 【Patreon】:https://www.patreon.com/algoinde
|
||||
*
|
||||
* 目前使用Miao-Plugin的默认UA请求国服UID时
|
||||
* 会默认重定向 https://enka.network/ 到 https://profile.microgg.cn/
|
||||
* 感谢@MiniGrayGay 大佬提供的服务(Github: https://github.com/MiniGrayGay)
|
||||
*
|
||||
* 使用代理(科学上网)可以配置proxyAgent
|
||||
* 例如: http://127.0.0.1:1080
|
||||
*
|
||||
* */
|
||||
export const enkaApi = {
|
||||
url: 'https://enka.network/', // 请求API地址,可从上方提供的API地址中进行选择
|
||||
proxyAgent: '' // 请求的proxy配置,如无需proxy则留空
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个用户请求面板的间隔时间,单位分钟
|
||||
* 不同用户的计时独立
|
||||
*
|
||||
* 部分服务会同时返回服务侧更新冷却时间,若服务侧查询冷却大于更新间隔
|
||||
* 会以服务侧查询冷却为准(在服务侧冷却时间内,即使请求也不会返回更新数据)
|
||||
* */
|
||||
export const requestInterval = 5
|
||||
|
||||
/**
|
||||
* 喵喵Api 私有的面板更新服务
|
||||
* 供Yunzai开发者及有投喂的老板们小范围使用
|
||||
*
|
||||
* 喵喵API承载能力有限,Enka可用的情况下建议使用Enka,token有有效期限制,请勿强行投喂
|
||||
* token请勿外传,一个token仅供一个bot使用,多bot复用的话可能导致token失效
|
||||
* */
|
||||
* 喵喵Api 私有的面板更新服务
|
||||
* 供Yunzai开发者及有投喂的老板们小范围使用
|
||||
*
|
||||
* 喵喵API承载能力有限,Enka可用的情况下建议使用Enka,token有有效期限制,请勿强行投喂
|
||||
* token请勿外传,一个token仅供一个bot使用,多bot复用的话可能导致token失效
|
||||
* */
|
||||
export const miaoApi = {
|
||||
qq: '在此处填写主人QQ',
|
||||
token: '在此处填写QQ对应Token'
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个用户请求面板的间隔时间,单位分钟
|
||||
* 不同用户的计时独立
|
||||
*
|
||||
* 部分服务会同时返回服务侧更新冷却时间,若服务侧查询冷却大于更新间隔
|
||||
* 会以服务侧查询冷却为准(在服务侧冷却时间内,即使请求也不会返回更新数据)
|
||||
* */
|
||||
export const requestInterval = 5
|
||||
|
@ -84,8 +84,8 @@ export const cfgSchema = {
|
||||
key: '面板服务',
|
||||
type: 'num',
|
||||
def: 0,
|
||||
input: (n) => /[0-3]{1,3}/.test(n) ? n : 0,
|
||||
desc: '面板服务选择:0:自动,1:喵Api(需具备Token), 2:Enka-API, 3:MiniGG-Api。如设置三位数字则为分服务器设置,按顺序分别为 国服/B服/外服,例如112代表国服B服Miao,国外Enka'
|
||||
input: (n) => /[0-4]{1,3}/.test(n) ? n : 0,
|
||||
desc: '面板服务选择:0:自动,1:喵Api(需具备Token), 2:Enka-API, 3:MiniGG-Api, 4:Hutao-Enka代理。如设置三位数字则为分服务器设置,按顺序分别为 国服/B服/外服,例如112代表国服B服Miao,国外Enka'
|
||||
},
|
||||
costumeSplash: {
|
||||
title: '使用自定义面板插图',
|
||||
|
@ -60,7 +60,7 @@ export const characters = {
|
||||
10000066: ['神里绫人', 'Kamisato Ayato', 'Ayato', '绫人', '神里凌人', '凌人', '0人', '神人', '零人', '大舅哥'],
|
||||
|
||||
// 3.0
|
||||
10000061: ['绮良良', 'Kirara', '大猫猫', '大喵喵', '稻妻猫猫', '绮娘娘', '良良', '快递员'],
|
||||
10000061: ['绮良良', 'Kirara', '大猫猫', '大喵喵', '稻妻猫猫', '绮娘娘', '琦良良', '良良', '快递员', '草猫', '草猫猫', '草喵', '草喵喵'],
|
||||
10000069: ['提纳里', 'Tighnari', '提那里', '小提', '驴'],
|
||||
10000067: ['柯莱', 'Collei', '柯来', '科莱', '科来', '小天使', '须弥安柏', '草安柏', '须弥飞行冠军'],
|
||||
10000068: ['多莉', 'Dori', '多利', '多力', '奸商'],
|
||||
@ -100,9 +100,9 @@ export const characters = {
|
||||
export const wifeData = {
|
||||
girlfriend: `琴, 丽莎, 荧, 芭芭拉, 安柏, 香菱, 北斗, 凝光, 菲谢尔, 诺艾尔, 甘雨, 莫娜, 刻晴, 砂糖, 辛焱, 罗莎莉亚, 胡桃,
|
||||
烟绯, 优菈, 神里绫华, 宵宫, 雷电将军, 珊瑚宫心海, 九条裟罗, 八重神子, 埃洛伊, 申鹤, 云堇, 夜兰, 久岐忍, 柯莱, 多莉, 伐难,
|
||||
女士, 萍姥姥, 归终, 柯莱, 多莉, 仆人, 少女, 妮露, 坎蒂丝, 天理, 迪希雅, 莱依拉, 珐露珊, 迪希雅`,
|
||||
女士, 萍姥姥, 归终, 仆人, 少女, 妮露, 坎蒂丝, 天理, 迪希雅, 莱依拉, 珐露珊, 绮良良`,
|
||||
boyfriend: `空, 凯亚, 迪卢克, 雷泽, 温迪, 行秋, 魈, 钟离, 班尼特, 达达利亚, 重云, 阿贝多, 枫原万叶, 托马, 五郎, 荒泷一斗,
|
||||
鹿野院平藏, 神里绫人, 提纳里, 流浪者, 白术, 提纳里, 富人, 博士, 丑角, 公鸡, 队长, 赛诺, 戴因, 卡维, 艾尔海森, 米卡, 白术`,
|
||||
鹿野院平藏, 神里绫人, 提纳里, 流浪者, 富人, 博士, 丑角, 公鸡, 队长, 赛诺, 戴因, 卡维, 艾尔海森, 米卡, 白术`,
|
||||
daughter: '可莉, 七七, 迪奥娜, 早柚, 派蒙, 瑶瑶, 纳西妲',
|
||||
son: ''
|
||||
}
|
||||
|
@ -28,6 +28,14 @@ export const mggApi = {
|
||||
}
|
||||
}
|
||||
|
||||
export const requestInterval = 5
|
||||
export const hutaoApi = {
|
||||
url: 'http://enka-api.hut.ao/',
|
||||
userAgent: 'Snap Hutao/miao',
|
||||
listApi: ({ url, uid, diyCfg }) => {
|
||||
return `${url}/${uid}/`
|
||||
}
|
||||
}
|
||||
|
||||
export const requestInterval = 3
|
||||
|
||||
export const isSys = true
|
||||
|
@ -63,6 +63,7 @@ export default class AvatarData extends Base {
|
||||
enka: 'Enka.Network',
|
||||
miao: '喵喵Api',
|
||||
mgg: 'MiniGG-API',
|
||||
hutao: 'Hutao-Enka',
|
||||
mys: '米游社'
|
||||
}[this._source] || this._source
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import CharCfg from './character/CharCfg.js'
|
||||
let { wifeMap, idSort, idMap } = CharId
|
||||
|
||||
let getMeta = function (name) {
|
||||
return Data.readJSON(`resources/meta/character/${name}/data.json`,'miao')
|
||||
return Data.readJSON(`resources/meta/character/${name}/data.json`, 'miao')
|
||||
}
|
||||
|
||||
class Character extends Base {
|
||||
@ -230,7 +230,7 @@ class Character extends Base {
|
||||
this._imgs = {}
|
||||
}
|
||||
if (!this._imgs[cacheId]) {
|
||||
this._imgs[cacheId] = CharImg.getImgs(this.name, costumeIdx, this.isTraveler ? this.elem : '', this.source === 'amber' ? 'png' : 'webp')
|
||||
this._imgs[cacheId] = CharImg.getImgs(this.name, costumeIdx, this.isTraveler ? this.elem : '', this.weaponType, this.talentCons)
|
||||
}
|
||||
let imgs = this._imgs[cacheId]
|
||||
return {
|
||||
@ -253,9 +253,9 @@ class Character extends Base {
|
||||
|
||||
try {
|
||||
if (this.isTraveler) {
|
||||
this._detail = Data.readJSON(`${path}/旅行者/${this.elem}/detail.json`,'miao')
|
||||
this._detail = Data.readJSON(`${path}/旅行者/${this.elem}/detail.json`, 'miao')
|
||||
} else {
|
||||
this._detail = Data.readJSON(`${path}/${this.name}/detail.json`,'miao')
|
||||
this._detail = Data.readJSON(`${path}/${this.name}/detail.json`, 'miao')
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
|
@ -82,7 +82,8 @@ const CharImg = {
|
||||
},
|
||||
|
||||
// 获取角色的图像资源数据
|
||||
getImgs (name, costumeIdx = '', travelerElem = '', fileType = 'webp') {
|
||||
getImgs (name, costumeIdx = '', travelerElem = '', weaponType = 'sword', talentCons) {
|
||||
let fileType = 'webp'
|
||||
costumeIdx = costumeIdx === '2' ? '2' : ''
|
||||
let imgs = {}
|
||||
if (!['空', '荧', '旅行者'].includes(name)) {
|
||||
@ -113,9 +114,9 @@ const CharImg = {
|
||||
for (let i = 0; i <= 3; i++) {
|
||||
tAdd(`passive${i}`, `icons/passive-${i}`)
|
||||
}
|
||||
for (let k of ['a', 'e', 'q']) {
|
||||
tAdd(k, `icons/talent-${k}`)
|
||||
}
|
||||
imgs.a = `/common/item/atk-${weaponType}.webp`
|
||||
imgs.e = talentCons.e === 3 ? imgs['cons3'] : imgs['cons5']
|
||||
imgs.q = talentCons.q === 5 ? imgs['cons5'] : imgs['cons3']
|
||||
return imgs
|
||||
}
|
||||
}
|
||||
|
46
models/player/HutaoApi.js
Normal file
@ -0,0 +1,46 @@
|
||||
import lodash from 'lodash'
|
||||
import EnkaData from './EnkaData.js'
|
||||
import { Data } from '#miao'
|
||||
|
||||
export default {
|
||||
id: 'hutao',
|
||||
name: 'Hutao-Enka',
|
||||
cfgKey: 'hutaoApi',
|
||||
// 处理请求参数
|
||||
async request (api) {
|
||||
let params = {
|
||||
headers: { 'User-Agent': this.getCfg('userAgent') }
|
||||
}
|
||||
return { api, params }
|
||||
},
|
||||
|
||||
// 处理服务返回
|
||||
async response (data, req) {
|
||||
if (!data.playerInfo) {
|
||||
if (data.error) {
|
||||
console.log(`Enka ReqErr: ${data.error}`)
|
||||
}
|
||||
return req.err('error', 60)
|
||||
}
|
||||
let details = data.avatarInfoList
|
||||
if (!details || details.length === 0 || !details[0].propMap) {
|
||||
return req.err('empty', 5 * 60)
|
||||
}
|
||||
return data
|
||||
},
|
||||
|
||||
updatePlayer (player, data) {
|
||||
player.setBasicData(Data.getData(data, 'name:nickname,face:profilePicture.avatarID,card:nameCardID,level,word:worldLevel,sign:signature'))
|
||||
lodash.forEach(data.avatarInfoList, (ds) => {
|
||||
let ret = EnkaData.setAvatar(player, ds, 'hutao')
|
||||
if (ret) {
|
||||
player._update.push(ret.id)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 获取冷却时间
|
||||
cdTime (data) {
|
||||
return data.ttl || 60
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ import MysAvatar from './MysAvatar.js'
|
||||
import enkaApi from './EnkaApi.js'
|
||||
import miaoApi from './MiaoApi.js'
|
||||
import mggApi from './MggApi.js'
|
||||
import hutaoApi from './HutaoApi.js'
|
||||
|
||||
let { diyCfg } = await Data.importCfg('profile')
|
||||
|
||||
@ -15,7 +16,8 @@ const Profile = {
|
||||
Profile.servs[key] = new ProfileServ({
|
||||
miao: miaoApi,
|
||||
mgg: mggApi,
|
||||
enka: enkaApi
|
||||
enka: enkaApi,
|
||||
hutao: hutaoApi
|
||||
}[key])
|
||||
}
|
||||
return Profile.servs[key]
|
||||
@ -34,7 +36,7 @@ const Profile = {
|
||||
// 判断国服、B服、外服,获取在配置中的idx
|
||||
let servIdx = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 1, 6: 2, 7: 2, 8: 2, 9: 2 }[uid[0]]
|
||||
|
||||
// 获取对应服务选择的配置数字,0自动,1喵,2Enka,3Mgg
|
||||
// 获取对应服务选择的配置数字,0自动,1喵,2Enka,3Mgg, 4:Hutao
|
||||
let servCfg = Cfg.get('profileServer', '0').toString() || '0'
|
||||
servCfg = servCfg[servIdx] || servCfg[0] || '0'
|
||||
|
||||
@ -45,6 +47,8 @@ const Profile = {
|
||||
return Profile.serv('enka')
|
||||
} else if (servCfg === '3') {
|
||||
return Profile.serv('mgg')
|
||||
} else if (servCfg === '4') {
|
||||
return Profile.serv('hutao')
|
||||
}
|
||||
return Profile.serv(servIdx === 2 ? 'enka' : 'mgg')
|
||||
},
|
||||
@ -84,7 +88,7 @@ const Profile = {
|
||||
|
||||
isProfile (avatar) {
|
||||
// 检查数据源
|
||||
if (!avatar._source || !['enka', 'change', 'miao', 'mgg'].includes(avatar._source)) {
|
||||
if (!avatar._source || !['enka', 'change', 'miao', 'mgg', 'hutao'].includes(avatar._source)) {
|
||||
return false
|
||||
}
|
||||
// 检查武器及天赋
|
||||
|
@ -78,7 +78,7 @@
|
||||
</div>
|
||||
|
||||
<div class="copyright data-source">
|
||||
数据源:{{ {miao:'喵喵API', 'enka':'Enka.Network', 'mgg':'MiniGG-API', mys:'米游社'}[data.source]||data.source }} {{data.updateTime}}
|
||||
数据源:{{ {miao:'喵喵API', 'enka':'Enka.Network', 'mgg':'MiniGG-API', mys:'米游社', 'hutao':'Hutao-Enka' }[data.source]||data.source }} {{data.updateTime}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{if custom}}
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.1 KiB |
@ -10,8 +10,8 @@
|
||||
"birth": "7-9",
|
||||
"astro": "天堂鸟座",
|
||||
"desc": "须弥著名建筑设计师,对太多事物抱有过度关怀心。美学主义者,为现实所困扰。",
|
||||
"cncv": "???",
|
||||
"jpcv": "???",
|
||||
"cncv": "刘三木",
|
||||
"jpcv": "内田雄马",
|
||||
"costume": false,
|
||||
"ver": 1,
|
||||
"baseAttr": {
|
||||
@ -34,7 +34,7 @@
|
||||
"specialty": "悼灵花",
|
||||
"normal": "孢囊晶尘",
|
||||
"talent": "「巧思」的哲学",
|
||||
"weekly": "???"
|
||||
"weekly": "原初绿洲之初绽"
|
||||
},
|
||||
"eta": 1683021600000
|
||||
"eta": 1682992800000
|
||||
}
|
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.9 KiB |