mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
fix: #667
This commit is contained in:
parent
76520714d3
commit
56d222f8df
@ -142,7 +142,7 @@ app.reg({
|
||||
name: '删除面板',
|
||||
describe: '【#角色】 删除游戏橱窗详情数据',
|
||||
fn: ProfileList.del,
|
||||
rule: /^#(删除全部面板|删除面板|删除面板数据)\s*(\d{9,10})?$/
|
||||
rule: /^#(星铁|原神)?(删除全部面板|删除面板|删除面板数据)\s*(\d{9,10})?$/
|
||||
},
|
||||
|
||||
profileReload: {
|
||||
|
@ -9,7 +9,7 @@ const ProfileList = {
|
||||
* @param e
|
||||
* @returns {Promise<boolean|*>}
|
||||
*/
|
||||
async refresh(e) {
|
||||
async refresh (e) {
|
||||
let uid = await getTargetUid(e)
|
||||
if (!uid) {
|
||||
e._replyNeedUid || e.reply(['请先发送【#绑定+你的UID】来绑定查询目标\n星铁请使用【#星铁绑定+UID】', new Button(e).bindUid()])
|
||||
@ -48,7 +48,7 @@ const ProfileList = {
|
||||
* @returns {Promise<boolean|*>}
|
||||
*/
|
||||
|
||||
async render(e) {
|
||||
async render (e) {
|
||||
let uid = await getTargetUid(e)
|
||||
if (!uid) {
|
||||
e._replyNeedUid || e.reply(['请先发送【#绑定+你的UID】来绑定查询目标\n星铁请使用【#星铁绑定+UID】', new Button(e).bindUid()])
|
||||
@ -141,7 +141,7 @@ const ProfileList = {
|
||||
allowRank: rank && rank.allowRank,
|
||||
rankCfg,
|
||||
elem: player.isGs ? 'hydro' : 'sr'
|
||||
}, { e, scale: 1.6, retType: "base64" }), new Button(e).profileList(uid, newChar)])
|
||||
}, { e, scale: 1.6, retType: 'base64' }), new Button(e).profileList(uid, newChar)])
|
||||
},
|
||||
|
||||
/**
|
||||
@ -149,13 +149,13 @@ const ProfileList = {
|
||||
* @param e
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
async del(e) {
|
||||
let ret = /^#(删除全部面板|删除面板|删除面板数据)\s*(\d{9,10})?$/.exec(e.msg)
|
||||
async del (e) {
|
||||
let ret = /^#(星铁)?(删除全部面板|删除面板|删除面板数据)\s*(\d{9,10})?$/.exec(e.msg)
|
||||
let uid = await getTargetUid(e)
|
||||
if (!uid) {
|
||||
return true
|
||||
}
|
||||
let targetUid = ret[2]
|
||||
let targetUid = ret[3]
|
||||
|
||||
let user = e?.runtime?.user || {}
|
||||
if (!user.hasCk && !e.isMaster) {
|
||||
@ -168,18 +168,20 @@ const ProfileList = {
|
||||
return true
|
||||
}
|
||||
|
||||
let ckUids = (user?.ckUids || []).join(',').split(',')
|
||||
const game = /星铁/.test(e.msg) ? 'sr' : 'gs'
|
||||
let uidList = user?.getCkUidList(game)
|
||||
let ckUids = (lodash.map(uidList, (ds) => ds.uid) || []).join(',').split(',')
|
||||
if (!ckUids.includes(targetUid) && !e.isMaster) {
|
||||
e.reply([`仅允许删除自己的UID数据[${ckUids.join(',')}]`, new Button(e).profileList(uid)])
|
||||
return true
|
||||
}
|
||||
|
||||
Player.delByUid(targetUid)
|
||||
Player.delByUid(targetUid, game)
|
||||
e.reply([`UID${targetUid}的本地数据已删除,排名数据已清除...`, new Button(e).profileList(uid)])
|
||||
return true
|
||||
},
|
||||
|
||||
async reload(e) {
|
||||
async reload (e) {
|
||||
let uid = await getTargetUid(e)
|
||||
if (!uid) {
|
||||
return true
|
||||
@ -189,4 +191,4 @@ const ProfileList = {
|
||||
return ProfileList.render(e)
|
||||
}
|
||||
}
|
||||
export default ProfileList
|
||||
export default ProfileList
|
||||
|
Loading…
Reference in New Issue
Block a user