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

@@ -36,7 +36,7 @@ func init() { // 插件主体
// 获取P站插图信息
illust, err := pixiv.Works(id)
if err != nil {
ctx.SendChain(message.Text("ERROR: ", err))
ctx.SendChain(message.Text("ERROR:", err))
return
}
if illust.Pid > 0 {
@@ -91,7 +91,7 @@ func init() { // 插件主体
for _, pic := range ctx.State["image_url"].([]string) {
fmt.Println(pic)
if result, err := saucenao.SauceNAO(pic); err != nil {
ctx.SendChain(message.Text("ERROR: ", err))
ctx.SendChain(message.Text("ERROR:", err))
} else {
// 返回SauceNAO的结果
ctx.SendChain(
@@ -110,7 +110,7 @@ func init() { // 插件主体
continue
}
if result, err := yandex.Yandex(pic); err != nil {
ctx.SendChain(message.Text("ERROR: ", err))
ctx.SendChain(message.Text("ERROR:", err))
} else {
ctx.SendChain(
message.Text("也许是这个?"),
@@ -126,7 +126,7 @@ func init() { // 插件主体
}
// 不论结果如何都执行 ascii2d 搜索
if result, err := ascii2d.Ascii2d(pic); err != nil {
ctx.SendChain(message.Text("ERROR: ", err))
ctx.SendChain(message.Text("ERROR:", err))
continue
} else {
msg := message.Message{ctxext.FakeSenderForwardNode(ctx, message.Text("ascii2d搜图结果"))}
@@ -147,7 +147,7 @@ func init() { // 插件主体
ctx.Event.GroupID,
msg,
).Get("message_id").Int(); id == 0 {
ctx.SendChain(message.Text("ERROR: 可能被风控了"))
ctx.SendChain(message.Text("ERROR:可能被风控了"))
}
}
}