🎨更改目录结构

This commit is contained in:
yeyang
2023-02-13 18:28:33 +08:00
parent 9e21be2d83
commit bbe19bc778
6 changed files with 21 additions and 23 deletions

View File

@@ -2,7 +2,8 @@ import plugin from '../../../lib/plugins/plugin.js'
import { segment } from 'oicq'
import _ from 'lodash'
import { Config } from '../components/index.js'
import { GroupAdmin as ga, common, QQApi, puppeteer, CronValidate } from '../model/index.js'
import { GroupAdmin as ga, common, QQApi, puppeteer } from '../model/index.js'
import cronValidate from '../tools/CronValidate.js'
import moment from 'moment'
// API请求错误文案
@@ -538,7 +539,7 @@ export class GroupAdmin extends plugin {
} else {
cron = RegRet[2]
// 校验cron表达式
let Validate = CronValidate(cron.trim())
let Validate = cronValidate(cron.trim())
if (Validate !== true) return e.reply(Validate)
}

View File

@@ -1,12 +1,12 @@
import plugin from '../../../lib/plugins/plugin.js'
import os from 'os'
import { Config } from '../components/index.js'
import { CPU, common, puppeteer } from '../model/index.js'
import { State, common, puppeteer } from '../model/index.js'
import moment from 'moment'
import _ from 'lodash'
let interval = false
export class State extends plugin {
export class NewState extends plugin {
constructor () {
super({
name: '椰奶状态',
@@ -25,21 +25,21 @@ export class State extends plugin {
async state (e) {
if (!/椰奶/.test(e.msg) && !Config.Notice.state) return false
if (!CPU.si) return e.reply('❎ 没有检测到systeminformation依赖请运行"pnpm add systeminformation -w"进行安装')
if (!State.si) return e.reply('❎ 没有检测到systeminformation依赖请运行"pnpm add systeminformation -w"进行安装')
// 防止多次触发
if (interval) { return false } else interval = true
// 系统
let osinfo = await CPU.si.osInfo()
let osinfo = await State.si.osInfo()
// 可视化数据
let visualData = _.compact([
// CPU板块
await CPU.getCpuInfo(osinfo.arch),
await State.getCpuInfo(osinfo.arch),
// 内存板块
await CPU.getMemUsage(),
await State.getMemUsage(),
// GPU板块
await CPU.getGPU(),
await State.getGPU(),
// Node板块
await CPU.getNodeInfo()
await State.getNodeInfo()
])
// 渲染数据
let data = {
@@ -70,15 +70,15 @@ export class State extends plugin {
// 在线状态
status: common.status[Bot.status],
// 硬盘内存
HardDisk: await CPU.getfsSize(),
HardDisk: await State.getfsSize(),
// FastFetch
FastFetch: await CPU.getFastFetch(e),
FastFetch: await State.getFastFetch(e),
// 取插件
plugin: CPU.numberOfPlugIns,
plugin: State.numberOfPlugIns,
// 硬盘速率
fsStats: CPU.DiskSpeed,
fsStats: State.DiskSpeed,
// 网络
network: CPU.getnetwork,
network: State.getnetwork,
// 可视化数据
visualData,
// 系统信息

View File

@@ -1,9 +1,8 @@
import puppeteer from '../lib/puppeteer/puppeteer.js'
import uploadRecord from '../lib/uploadRecord/uploadRecord.js'
import uploadRecord from '../tools/uploadRecord.js'
import Bika from './Bika.js'
import common from '../lib/common/common.js'
import CPU from './CPU.js'
import CronValidate from './CronValidate.js'
import State from './State.js'
import GroupAdmin from './GroupAdmin.js'
import funApi from './api/funApi.js'
import Pixiv from './Pixiv.js'
@@ -12,7 +11,7 @@ import setu from './setu.js'
import Ascii2D from './PicSearch/ascii2d.js'
import SauceNAO from './PicSearch/saucenao.js'
import WhatAnime from './PicSearch/whatanime.js'
const PicSearch = {
export const PicSearch = {
Ascii2D,
SauceNAO,
WhatAnime
@@ -20,14 +19,12 @@ const PicSearch = {
export {
puppeteer,
common,
CPU,
State,
Pixiv,
setu,
Bika,
uploadRecord,
CronValidate,
GroupAdmin,
QQApi,
funApi,
PicSearch
funApi
}