解决QQ频道调用时无法排名的问题 (#631)

QQ频道的group_id格式类似qg_113458249547xxxxxxxx-9719xxx,
x为数字,修改正则表达式适配该格式
This commit is contained in:
石头 2023-09-02 02:22:27 +08:00 committed by GitHub
parent 217400d1bc
commit 0cfcb94706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,7 @@ export default class ProfileRank {
let keys = await redis.keys(`miao:rank:${groupId}:${type}:*`) let keys = await redis.keys(`miao:rank:${groupId}:${type}:*`)
let ret = [] let ret = []
for (let key of keys) { for (let key of keys) {
let keyRet = /^miao:rank:\d+:(?:mark|dmg|crit|valid):(\d{8})$/.exec(key) let keyRet = /^miao:rank:[\w-]+:(?:mark|dmg|crit|valid):(\d{8})$/.exec(key)
if (keyRet && keyRet[1]) { if (keyRet && keyRet[1]) {
let charId = keyRet[1] let charId = keyRet[1]
let uid = await ProfileRank.getGroupMaxUid(groupId, charId, type) let uid = await ProfileRank.getGroupMaxUid(groupId, charId, type)