mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 02:00:24 +00:00
✨ aifalse 增加 清理缓存
This commit is contained in:
@@ -3,6 +3,7 @@ package aifalse
|
||||
|
||||
import (
|
||||
"math"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/shirou/gopsutil/cpu"
|
||||
@@ -30,6 +31,15 @@ func init() { // 插件主体
|
||||
),
|
||||
)
|
||||
})
|
||||
engine.OnFullMatch("清理缓存", zero.SuperUserPermission).SetBlock(true).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
err := os.RemoveAll("data/cache/*")
|
||||
if err != nil {
|
||||
ctx.Send("错误: " + err.Error())
|
||||
} else {
|
||||
ctx.Send("成功!")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func cpuPercent() float64 {
|
||||
|
||||
Reference in New Issue
Block a user