mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 22:40:23 +08:00
fix: 缓存池有时无法发出图片
This commit is contained in:
parent
f1c9e2331c
commit
9986c57727
@ -115,7 +115,14 @@ func init() { // 插件主体
|
|||||||
|
|
||||||
m, hassent, err := pool.NewImage(ctxext.Send(ctx), ctxext.GetMessage(ctx), dhash, u)
|
m, hassent, err := pool.NewImage(ctxext.Send(ctx), ctxext.GetMessage(ctx), dhash, u)
|
||||||
if err == nil && !hassent {
|
if err == nil && !hassent {
|
||||||
ctx.SendChain(message.Image(m.String()))
|
// 发送图片
|
||||||
|
id := ctx.SendChain(message.Image(m.String()))
|
||||||
|
if id.ID() == 0 {
|
||||||
|
id = ctx.SendChain(message.Image(m.String()).Add("cache", "0"))
|
||||||
|
if id.ID() == 0 {
|
||||||
|
ctx.SendChain(message.Text("图片发送失败,可能被风控了~"))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -154,7 +161,9 @@ func reply(ctx *zero.Ctx, class int, dhash string, comment string) error {
|
|||||||
|
|
||||||
m, hassent, err := pool.NewImage(send, ctxext.GetMessage(ctx), b14, u)
|
m, hassent, err := pool.NewImage(send, ctxext.GetMessage(ctx), b14, u)
|
||||||
if err == nil && !hassent {
|
if err == nil && !hassent {
|
||||||
send(message.Message{message.Image(m.String())})
|
if send(message.Message{message.Image(m.String())}) == 0 {
|
||||||
|
send(message.Message{message.Image(m.String()).Add("cache", "0")})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user