Files
NapCatQQ/.pnpm-store/v3/files/60/536d1b3631511d16f3e64b7157b6c59499d4af2b0f305598d143f72bd6a3cd8e8a2891963875c04d9dcac31add72e6d6ee1b2521827ec75f7270ed37d0b64b
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

28 lines
692 B
Plaintext

const data = require('./data.json')
function get(id) {
id = String(id)
return data.find((el) => el.QSid === id)
}
function getByText(input) {
if (input[0] === '/') input = input.substring(1)
const match = data.find((el) => el.QDes.substring(1) === input)
|| data.find((el) => el.Input.includes(input))
|| data.find((el) => el.Input.some((i) => i.startsWith(input)))
return match ? match.QSid : null
}
function getUrl(id, base = 'https://koishi.js.org/QFace') {
const item = get(id)
if (!item) return ''
return base + (item.isStatic ? `/static/s${id}.png` : `/gif/s${id}.gif`)
}
module.exports = {
data,
get,
getUrl,
getByText,
}