1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-07 04:23:49 +08:00
This commit is contained in:
Mrs4s 2020-08-09 10:21:49 +08:00
parent a38c74a767
commit 8449770b6d

View File

@ -200,6 +200,9 @@ func (bot *CQBot) ToElement(t string, d map[string]string, group bool) (message.
if !global.PathExists(rawPath) && global.PathExists(rawPath+".cqimg") { if !global.PathExists(rawPath) && global.PathExists(rawPath+".cqimg") {
rawPath += ".cqimg" rawPath += ".cqimg"
} }
if !global.PathExists(rawPath) && d["url"] != "" {
return bot.ToElement(t, map[string]string{"file": d["url"]}, group)
}
if global.PathExists(rawPath) { if global.PathExists(rawPath) {
b, err := ioutil.ReadFile(rawPath) b, err := ioutil.ReadFile(rawPath)
if err != nil { if err != nil {