补充抽卡统计的命令匹配关键词

This commit is contained in:
Kokomi 2023-03-01 08:38:13 +08:00
parent 24c6964a6e
commit c59698b954
4 changed files with 12 additions and 7 deletions

View File

@ -5,7 +5,7 @@ import { segment } from 'oicq'
import MD5 from 'md5' import MD5 from 'md5'
import fetch from 'node-fetch' import fetch from 'node-fetch'
import lodash from 'lodash' import lodash from 'lodash'
import { Data } from '../../components/index.js' import { Cfg, Data } from '../../components/index.js'
import { Character } from '../../models/index.js' import { Character } from '../../models/index.js'
const resPath = process.cwd() + '/plugins/miao-plugin/resources/' const resPath = process.cwd() + '/plugins/miao-plugin/resources/'
@ -200,6 +200,9 @@ export async function profileImgList (e) {
if (!char || !char.name) { if (!char || !char.name) {
return false return false
} }
if ([1, 0].includes(Cfg.get('originalPic') * 1)) {
e.reply('已禁止获取面板图列表')
}
let nickname = Bot.nickname let nickname = Bot.nickname
if (e.isGroup) { if (e.isGroup) {
let info = await Bot.getGroupMemberInfo(e.group_id, Bot.uin) let info = await Bot.getGroupMemberInfo(e.group_id, Bot.uin)

View File

@ -9,15 +9,15 @@ app.reg({
detail: { detail: {
name: '抽卡记录', name: '抽卡记录',
fn: Gacha.detail, fn: Gacha.detail,
rule: /^#*喵喵(抽卡|抽奖|角色|武器|常驻|up)池*(记录|祈愿|分析)$/, rule: /^#*喵喵(抽卡|抽奖|角色|武器|常驻|up)+池?(记录|祈愿|分析)$/,
yzRule: /^#*(抽卡|抽奖|角色|武器|常驻|up)池*(记录|祈愿|分析)$/, yzRule: /^#*(抽卡|抽奖|角色|武器|常驻|up)+池?(记录|祈愿|分析)$/,
yzCheck: () => Cfg.get('gachaStat', false) yzCheck: () => Cfg.get('gachaStat', false)
}, },
stat: { stat: {
name: '抽卡统计', name: '抽卡统计',
fn: Gacha.stat, fn: Gacha.stat,
rule: /^#*喵喵(全部|抽卡|抽奖|角色|武器|常驻|up|版本)池*统计$/, rule: /^#*喵喵(全部|抽卡|抽奖|角色|武器|常驻|up|版本)+池?统计$/,
yzRule: /^#*(抽奖|角色|武器|常驻|up|版本)池*统计$/, yzRule: /^#*(全部|抽卡|抽奖|角色|武器|常驻|up|版本)+池?统计$/,
yzCheck: () => Cfg.get('gachaStat', false) yzCheck: () => Cfg.get('gachaStat', false)
} }

View File

@ -107,7 +107,9 @@ export default class MysApi {
} }
e._reqCount++ e._reqCount++
let ret = await mys.getData(api, data) let ret = await mys.getData(api, data)
if (mysInfo && mysInfo.checkCode) {
ret = await mysInfo.checkCode(ret, api, this.mys) ret = await mysInfo.checkCode(ret, api, this.mys)
}
e._reqCount-- e._reqCount--
if (e._reqCount === 0) { if (e._reqCount === 0) {
e.reply = e._original_reply e.reply = e._original_reply

View File

@ -60,7 +60,7 @@ export default class ProfileReq extends Base {
} }
log (msg) { log (msg) {
logger.mark(`${logger.cyan(`【面板】${this.uid}`)} ${msg}`) logger.mark(`【面板】${this.uid} ${msg}`)
} }
async requestProfile (player, serv) { async requestProfile (player, serv) {