modified: apps/fun.js

This commit is contained in:
yeyang
2022-10-27 15:38:50 +08:00
parent ccb153ca69
commit d06f8ef885

View File

@@ -273,6 +273,7 @@ export class example extends plugin {
let api = 'https://xiaobai.klizi.cn/API/other/bcy_topic.php'
let res = await fetch(api).then(res => res.json()).catch(err => console.log(err))
if (!res) return e.reply("接口失效")
if (res.code != 200) return e.reply(`请求错误!,错误码:${res.code}`)
let msg = [];
for (let i of res.data) {
msg.push(i.title);