From 36532a87821ff3c45ff69fb1b0349a47c1f82787 Mon Sep 17 00:00:00 2001 From: Mrs4s <1844812067@qq.com> Date: Mon, 11 Jan 2021 00:33:41 +0800 Subject: [PATCH] fix message. --- coolq/cqcode.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coolq/cqcode.go b/coolq/cqcode.go index fedb87b..5f8c956 100644 --- a/coolq/cqcode.go +++ b/coolq/cqcode.go @@ -911,6 +911,9 @@ func (bot *CQBot) makeImageOrVideoElem(d map[string]string, video, group bool) ( } info, err := os.Stat(fu.Path) if err != nil { + if !os.IsExist(err) { + return nil, errors.New("file not found") + } return nil, err } if video { @@ -1017,7 +1020,7 @@ video: if path.Ext(rawPath) == ".video" { b, _ := ioutil.ReadFile(rawPath) r := binary.NewReader(b) - return &LocalVideoElement{ShortVideoElement: message.ShortVideoElement{// todo 检查缓存是否有效 + return &LocalVideoElement{ShortVideoElement: message.ShortVideoElement{ // todo 检查缓存是否有效 Md5: r.ReadBytes(16), Size: r.ReadInt32(), Name: r.ReadString(),