Signed-off-by: 帮帮 <11372541+bbaban@user.noreply.gitee.com>
This commit is contained in:
帮帮 2023-07-08 15:44:53 +00:00 committed by Gitee
parent 0322bb6485
commit af76458dca
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,45 @@
import plugin from '../../../lib/plugins/plugin.js'
import puppeteer from '../../../lib/puppeteer/puppeteer.js'
import Deck from '../model/deck.js'
export class sevenSaints extends plugin {
constructor() {
super({
name: '七圣召唤数据查询',
dsc: '原神角色信息查询',
event: 'message',
priority: 5000,
rule: [
{
reg: '^#*七圣(召唤)?(牌|卡)组(列表)?[0-9]{0,2}$',
fnc: 'deckIndex'
},
]
})
}
async deckIndex() {
let index = this.e.msg.match(/[0-9]{1,2}/g)
if (index && index[0]) {
await this.deck(index[0])
} else {
await this.deck_list()
}
}
async deck(id) {
let data = await Deck.get(this.e, id)
if (!data) return
let img = await puppeteer.screenshot('deck', data)
if (img) await this.reply(img)
}
async deck_list(id = 0) {
let data = await Deck.get(this.e, id, true)
if (!data) return
let img = await puppeteer.screenshot('deckList', data)
if (img) await this.reply(img)
}
}