add plugin 渲染任意文字到图片

This commit is contained in:
源文雨
2022-03-27 13:54:26 +08:00
parent 1bfb76a4b3
commit 5837a765f1
31 changed files with 106 additions and 60 deletions

View File

@@ -39,12 +39,12 @@ func init() {
for i := 0; i < math.Min(cap(queue)-len(queue), 2); i++ {
data, err := web.GetData(api)
if err != nil {
ctx.SendChain(message.Text("ERROR: ", err))
ctx.SendChain(message.Text("ERROR:", err))
continue
}
json := gjson.ParseBytes(data)
if e := json.Get("error").Str; e != "" {
ctx.SendChain(message.Text("ERROR: ", e))
ctx.SendChain(message.Text("ERROR:", e))
continue
}
url := json.Get("data.0.urls.original").Str
@@ -65,7 +65,7 @@ func init() {
}()
select {
case <-time.After(time.Minute):
ctx.SendChain(message.Text("ERROR: 等待填充,请稍后再试......"))
ctx.SendChain(message.Text("ERROR:等待填充,请稍后再试......"))
case img := <-queue:
id := ctx.SendChain(message.Image(img))
if id.ID() == 0 {