diff --git a/.github/hua_nobg_512.gif b/.github/hua_nobg_512.gif new file mode 100644 index 00000000..dc84fbcc Binary files /dev/null and b/.github/hua_nobg_512.gif differ diff --git a/.github/黒金.jpg b/.github/黒金.jpg deleted file mode 100644 index 8989c8f0..00000000 Binary files a/.github/黒金.jpg and /dev/null differ diff --git a/README.md b/README.md index b6d505aa..0394d36c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@
- 看板娘 + 椛

ZeroBot-Plugin

- ZeroBot-Plugin 是 ZeroBot 的 实用插件合集

+ + “椛椛是[真寻](https://github.com/HibiKier/zhenxun_bot)的朋友!” + +

ZeroBot-Plugin 是 ZeroBot 的 实用插件合集


diff --git a/go.mod b/go.mod index bc8d9613..4a0dd5dc 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/Baidu-AIP/golang-sdk v1.1.1 github.com/Coloured-glaze/gg v1.3.4 - github.com/FloatTech/AnimeAPI v1.6.1-0.20221214084932-8c0223841d43 + github.com/FloatTech/AnimeAPI v1.6.1-0.20221225063958-b02234d50cc0 github.com/FloatTech/floatbox v0.0.0-20221210051813-4bd44af40c60 github.com/FloatTech/sqlite v1.5.7 github.com/FloatTech/ttl v0.0.0-20220715042055-15612be72f5b diff --git a/go.sum b/go.sum index ff9b9cd5..f8ca8037 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/Coloured-glaze/gg v1.3.4 h1:l31zIF/HaVwkzjrj+A56RGQoSKyKuR1IWtIrqXGFStI= github.com/Coloured-glaze/gg v1.3.4/go.mod h1:Ih5NLNNDHOy3RJbB0EPqGTreIzq/H02TGThIagh8HJg= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/FloatTech/AnimeAPI v1.6.1-0.20221214084932-8c0223841d43 h1:a0Hl8o6sYaepeuFZ3rboCM3Wh+sikKhsFm6pFmtyom8= -github.com/FloatTech/AnimeAPI v1.6.1-0.20221214084932-8c0223841d43/go.mod h1:Ri2Qa0552braxZVsk+axbBHL6UIWkGqQRETiIT9QTXI= +github.com/FloatTech/AnimeAPI v1.6.1-0.20221225063958-b02234d50cc0 h1:0pzhpmqw13bf+QssdqfFx07vnwHETtEiJhCQIinbpSU= +github.com/FloatTech/AnimeAPI v1.6.1-0.20221225063958-b02234d50cc0/go.mod h1:Ri2Qa0552braxZVsk+axbBHL6UIWkGqQRETiIT9QTXI= github.com/FloatTech/floatbox v0.0.0-20221210051813-4bd44af40c60 h1:S4KfcdK6LdOa0+TTyacHYOZ8aWkR6YbvlnI6GWe66Jc= github.com/FloatTech/floatbox v0.0.0-20221210051813-4bd44af40c60/go.mod h1:/k2zxRJtAJ17w9fSpc7xf2QjPDTUBmqhBsOGyHVyX0U= github.com/FloatTech/rendercard v0.0.2-0.20221128165614-a41216d2422e h1:7bF01RHsYS99Zp+OWfob1W/Cymho6fcggoRSpiuiYB8= diff --git a/plugin/image_finder/keyword.go b/plugin/image_finder/keyword.go index 99849952..0fcb17f2 100644 --- a/plugin/image_finder/keyword.go +++ b/plugin/image_finder/keyword.go @@ -81,6 +81,10 @@ func init() { ctx.SendChain(message.Text("ERROR: ", err)) return } + if len(illust.ImageUrls) == 0 { + ctx.SendChain(message.Text("ERROR: nil image url")) + return + } u := illust.ImageUrls[0] n := u[strings.LastIndex(u, "/")+1 : len(u)-4] f := illust.Path(0) diff --git a/plugin/setutime/setu_geter.go b/plugin/setutime/setu_geter.go index 6c1a3e2e..b01370e0 100644 --- a/plugin/setutime/setu_geter.go +++ b/plugin/setutime/setu_geter.go @@ -2,6 +2,7 @@ package setutime import ( + "errors" "fmt" "strconv" "strings" @@ -154,6 +155,9 @@ func (p *imgpool) size(imgtype string) int { } func (p *imgpool) push(ctx *zero.Ctx, imgtype string, illust *pixiv.Illust) { + if len(illust.ImageUrls) == 0 { + return + } u := illust.ImageUrls[0] n := u[strings.LastIndex(u, "/")+1 : len(u)-4] m, err := imagepool.GetImage(n) @@ -222,6 +226,9 @@ func (p *imgpool) add(ctx *zero.Ctx, imgtype string, id int64) error { if err != nil { return err } + if len(illust.ImageUrls) == 0 { + return errors.New("nil image url") + } err = imagepool.SendImageFromPool(strconv.FormatInt(illust.Pid, 10)+"_p0", illust.Path(0), func() error { return illust.DownloadToCache(0) }, ctxext.Send(ctx), ctxext.GetMessage(ctx))