mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
✨ refactor : 精简内容
This commit is contained in:
parent
63548f599d
commit
1f55f38af0
@ -1,14 +1,14 @@
|
||||
// 主库
|
||||
import { segment } from "oicq";
|
||||
import fetch from "node-fetch";
|
||||
// 配置文件
|
||||
import config from "../model/index.js";
|
||||
// 爬虫库
|
||||
import puppeteer from "../../../lib/puppeteer/puppeteer.js";
|
||||
import _ from "lodash";
|
||||
// http库
|
||||
import axios from "axios";
|
||||
import fs from "node:fs";
|
||||
// 常量
|
||||
import {CAT_LIMIT} from "../utils/constant.js";
|
||||
|
||||
export class query extends plugin {
|
||||
constructor() {
|
||||
@ -64,7 +64,6 @@ export class query extends plugin {
|
||||
},
|
||||
],
|
||||
});
|
||||
this.catConfig = config.getConfig("query");
|
||||
}
|
||||
|
||||
async doctor(e) {
|
||||
@ -147,13 +146,12 @@ export class query extends plugin {
|
||||
}
|
||||
|
||||
async cat(e) {
|
||||
const numb = this.catConfig.count;
|
||||
let images = [];
|
||||
let reqRes = [
|
||||
...(await fetch(`https://shibe.online/api/cats?count=${numb}`).then(data =>
|
||||
...(await fetch(`https://shibe.online/api/cats?count=${CAT_LIMIT}`).then(data =>
|
||||
data.json(),
|
||||
)),
|
||||
...(await fetch(`https://api.thecatapi.com/v1/images/search?limit=${numb}`)
|
||||
...(await fetch(`https://api.thecatapi.com/v1/images/search?limit=${CAT_LIMIT}`)
|
||||
.then(data => data.json())
|
||||
.then(json => json.map(item => item.url))),
|
||||
];
|
||||
|
@ -1,2 +0,0 @@
|
||||
# 发送张数
|
||||
count: 10
|
@ -22,4 +22,6 @@ export const douyinTypeMap = {
|
||||
150: "image",
|
||||
};
|
||||
|
||||
export const TEN_THOUSAND = 10000;
|
||||
export const TEN_THOUSAND = 10000;
|
||||
|
||||
export const CAT_LIMIT = 10;
|
Loading…
x
Reference in New Issue
Block a user