mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
💩👌 make lint happy
This commit is contained in:
parent
1971e2274a
commit
63784b4ed0
@ -35,28 +35,27 @@ func init() {
|
|||||||
u2 := fmt.Sprintf(bed, emojis[r2], r2, r2, r1)
|
u2 := fmt.Sprintf(bed, emojis[r2], r2, r2, r1)
|
||||||
logrus.Debugln("[emojimix] u1:", u1)
|
logrus.Debugln("[emojimix] u1:", u1)
|
||||||
logrus.Debugln("[emojimix] u2:", u2)
|
logrus.Debugln("[emojimix] u2:", u2)
|
||||||
buf := bytes.NewBuffer(make([]byte, 0, 65536))
|
send := func(resp *http.Response) {
|
||||||
buf.WriteString("base64://")
|
buf := bytes.NewBuffer(make([]byte, 0, 65536))
|
||||||
resp, err := http2.Get(u1)
|
buf.WriteString("base64://")
|
||||||
sendandclose := func(resp *http.Response) {
|
|
||||||
enc := base64.NewEncoder(base64.StdEncoding, buf)
|
enc := base64.NewEncoder(base64.StdEncoding, buf)
|
||||||
_, err = io.Copy(enc, resp.Body)
|
_, err := io.Copy(enc, resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_ = enc.Close()
|
_ = enc.Close()
|
||||||
_ = resp.Body.Close()
|
|
||||||
ctx.SendChain(message.Image(binary.BytesToString(buf.Bytes())))
|
ctx.SendChain(message.Image(binary.BytesToString(buf.Bytes())))
|
||||||
}
|
}
|
||||||
|
resp, err := http2.Get(u1)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
sendandclose(resp)
|
send(resp)
|
||||||
|
_ = resp.Body.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
buf.Reset()
|
|
||||||
buf.WriteString("base64://")
|
|
||||||
resp, err = http2.Head(u2)
|
resp, err = http2.Head(u2)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
sendandclose(resp)
|
send(resp)
|
||||||
|
_ = resp.Body.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user