mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
为#喵喵设置
增加面板排行人数自定义,范围5~30,默认15 (#434)
This commit is contained in:
parent
0427f6788a
commit
f5f6319ea1
@ -60,7 +60,7 @@ app.reg('profile-list', profileList, {
|
||||
})
|
||||
|
||||
app.reg('profile-stat', profileStat, {
|
||||
rule: /^#(面板|喵喵)?练度统计$/,
|
||||
rule: /^#(面板|喵喵|角色|武器|天赋|技能|圣遗物)?练度统计$/,
|
||||
name: '面板练度统计$'
|
||||
})
|
||||
|
||||
|
@ -3,7 +3,7 @@ import {Cfg, Common, Data } from '../../components/index.js'
|
||||
import { AvatarList, ProfileRank } from '../../models/index.js'
|
||||
|
||||
export async function profileStat (e) {
|
||||
let isMatch = /^#(喵喵|面板)练度统计?$/.test(e.original_msg || e.msg || '')
|
||||
let isMatch = /^#(面板|喵喵|角色|武器|天赋|技能|圣遗物)练度统计?$/.test(e.original_msg || e.msg || '')
|
||||
if (!Cfg.get('profileStat', false) && !isMatch) {
|
||||
return false
|
||||
}
|
||||
|
@ -14,6 +14,9 @@ export const uploadAbyssData = false
|
||||
// 使用【#面板练度统计】功能取代【#练度统计】功能,默认关闭
|
||||
export const profileStat = false
|
||||
|
||||
// 可选值5~30,建议15。设置高排行人数会导致渲染图片速度加长,发送缓慢
|
||||
export const rankNumber = 15
|
||||
|
||||
// 老婆查询
|
||||
export const avatarWife = true
|
||||
|
||||
|
@ -49,6 +49,14 @@ export const cfgSchema = {
|
||||
oldCfgKey: 'profile.stat',
|
||||
desc: '使用【#面板练度统计】功能取代【#练度统计】功能,默认关闭'
|
||||
},
|
||||
rankNumber: {
|
||||
title: '排行人数',
|
||||
key: '排行人数',
|
||||
type: 'num',
|
||||
def: 15,
|
||||
input: (n) => Math.min(30, Math.max(5, (n * 1 || 15))),
|
||||
desc: '可选值5~30,建议15。设置高排行人数会导致渲染图片速度加长,发送缓慢'
|
||||
},
|
||||
avatarWife: {
|
||||
title: '老婆查询',
|
||||
key: '老婆',
|
||||
|
@ -1,6 +1,6 @@
|
||||
import lodash from 'lodash'
|
||||
import moment from 'moment'
|
||||
import { Common, Data } from '../components/index.js'
|
||||
import { Cfg, Common, Data, } from '../components/index.js'
|
||||
|
||||
export default class ProfileRank {
|
||||
constructor (data) {
|
||||
@ -151,7 +151,8 @@ export default class ProfileRank {
|
||||
* @returns {Promise<ConvertArgumentType<ZMember, string>[]|boolean>}
|
||||
*/
|
||||
static async getGroupUidList (groupId, charId, type = 'mark') {
|
||||
let uids = await redis.zRangeWithScores(`miao:rank:${groupId}:${type}:${charId}`, -20, -1)
|
||||
let number = Cfg.get('rankNumber', 15)
|
||||
let uids = await redis.zRangeWithScores(`miao:rank:${groupId}:${type}:${charId}`, -`${number}`, -1)
|
||||
return uids ? uids.reverse() : false
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user