From 0e7c30e85452854aff7822be168c095089b913e5 Mon Sep 17 00:00:00 2001 From: Mrs4s <1844812067@qq.com> Date: Thu, 27 Aug 2020 23:51:38 +0800 Subject: [PATCH] fix image error. --- coolq/cqcode.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/coolq/cqcode.go b/coolq/cqcode.go index faa9f7e..4e3a1a4 100644 --- a/coolq/cqcode.go +++ b/coolq/cqcode.go @@ -367,12 +367,18 @@ func (bot *CQBot) ToElement(t string, d map[string]string, group bool) (message. if group { rsp, err := bot.Client.QueryGroupImage(1, hash, size) if err != nil { + if url != "" { + return bot.ToElement(t, map[string]string{"file": url}, group) + } return nil, err } return rsp, nil } rsp, err := bot.Client.QueryFriendImage(1, hash, size) if err != nil { + if url != "" { + return bot.ToElement(t, map[string]string{"file": url}, group) + } return nil, err } return rsp, nil