pull
Signed-off-by: 帮帮 <11372541+bbaban@user.noreply.gitee.com>
This commit is contained in:
parent
0322bb6485
commit
af76458dca
|
@ -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)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue