edit README

This commit is contained in:
源文雨 2022-12-26 13:11:38 +08:00
parent 19e3688499
commit 7d1a4b4005
7 changed files with 19 additions and 5 deletions

BIN
.github/hua_nobg_512.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

BIN
.github/黒金.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

View File

@ -1,10 +1,13 @@
<div align="center">
<a href="https://crypko.ai/crypko/5k8HyUVTq5421/">
<img src=".github/黒金.jpg" alt="看板娘" width = "400">
<img src=".github/hua_nobg_512.gif" alt="椛" width = "400">
</a><br>
<h1>ZeroBot-Plugin</h1>
ZeroBot-Plugin 是 ZeroBot 的 实用插件合集<br><br>
“椛椛是[真寻](https://github.com/HibiKier/zhenxun_bot)的朋友!”
<br><br>ZeroBot-Plugin 是 ZeroBot 的 实用插件合集<br><br>
<img src="http://cmoe.azurewebsites.net/cmoe?name=ZeroBot-Plugin&theme=r34" /><br>

2
go.mod
View File

@ -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

4
go.sum
View File

@ -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=

View File

@ -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)

View File

@ -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))