搜图增加 yandex

This commit is contained in:
fumiama 2022-02-14 16:34:46 +08:00
parent 30665ad8c6
commit 37033fe48d

View File

@ -5,19 +5,21 @@ import (
"fmt"
"strconv"
"github.com/FloatTech/AnimeAPI/ascii2d"
"github.com/FloatTech/AnimeAPI/pixiv"
"github.com/FloatTech/AnimeAPI/saucenao"
control "github.com/FloatTech/zbputils/control"
"github.com/FloatTech/zbputils/ctxext"
"github.com/FloatTech/zbputils/file"
"github.com/FloatTech/zbputils/img/pool"
"github.com/FloatTech/zbputils/process"
"github.com/sirupsen/logrus"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
"github.com/FloatTech/AnimeAPI/ascii2d"
"github.com/FloatTech/AnimeAPI/pixiv"
"github.com/FloatTech/AnimeAPI/saucenao"
"github.com/FloatTech/AnimeAPI/yandex"
"github.com/FloatTech/zbputils/control"
"github.com/FloatTech/zbputils/control/order"
"github.com/FloatTech/zbputils/ctxext"
"github.com/FloatTech/zbputils/file"
"github.com/FloatTech/zbputils/img/pool"
"github.com/FloatTech/zbputils/process"
)
func init() { // 插件主体
@ -122,6 +124,23 @@ func init() { // 插件主体
)
continue
}
if result, err := yandex.Yandex(pic); err != nil {
ctx.SendChain(message.Text("ERROR: ", err))
} else {
// 返回SauceNAO的结果
ctx.SendChain(
message.Text("我有把握是这个!"),
message.Text(
"\n",
"标题:", result.Title, "\n",
"插画ID", result.Pid, "\n",
"画师:", result.UserName, "\n",
"画师ID", result.UserId, "\n",
"直链:", "https://pixivel.moe/detail?id=", result.Pid,
),
)
continue
}
if result, err := ascii2d.Ascii2d(pic); err != nil {
ctx.SendChain(message.Text("ERROR: ", err))
continue