Skip to content

Commit

Permalink
✨ 搜图增加 yandex
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Feb 14, 2022
1 parent 30665ad commit 37033fe
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions plugin_saucenao/searcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ import (
"fmt"
"strconv"

"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"
control "github.com/FloatTech/zbputils/control"
"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"
"github.com/sirupsen/logrus"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"

"github.com/FloatTech/zbputils/control/order"
)

func init() { // 插件主体
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 37033fe

Please sign in to comment.