From 8449770b6df2e61350daea0e0caed79675d627a3 Mon Sep 17 00:00:00 2001 From: Mrs4s <1844812067@qq.com> Date: Sun, 9 Aug 2020 10:21:49 +0800 Subject: [PATCH] fix #61. --- coolq/cqcode.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coolq/cqcode.go b/coolq/cqcode.go index 386ce53..9664cac 100644 --- a/coolq/cqcode.go +++ b/coolq/cqcode.go @@ -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") { rawPath += ".cqimg" } + if !global.PathExists(rawPath) && d["url"] != "" { + return bot.ToElement(t, map[string]string{"file": d["url"]}, group) + } if global.PathExists(rawPath) { b, err := ioutil.ReadFile(rawPath) if err != nil {