添加qq空间表白墙 (#489)

This commit is contained in:
himawari
2022-11-13 18:03:15 +08:00
committed by GitHub
parent 743e5509a2
commit 4075c92e53
9 changed files with 561 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"net/url"
"os"
"regexp"
"strconv"
"strings"
@@ -62,6 +63,17 @@ func init() { // 插件主体
PrivateDataFolder: "aipaint",
})
datapath = file.BOTPATH + "/" + engine.DataFolder()
if file.IsNotExist(cfg.file) {
s := serverConfig{}
data, err := json.Marshal(s)
if err != nil {
panic(err)
}
err = os.WriteFile(cfg.file, data, 0666)
if err != nil {
panic(err)
}
}
engine.OnPrefixGroup([]string{`ai绘图`, `生成色图`, `生成涩图`, `ai画图`}).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
err := cfg.load()