From c9ba2f7350693ad795edd89fa0bced9a7e5e55b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Fri, 17 Nov 2023 00:04:29 +0900 Subject: [PATCH] optimize(context): SendImage --- context.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/context.go b/context.go index ca15044..e5f211c 100644 --- a/context.go +++ b/context.go @@ -204,7 +204,9 @@ func (ctx *Ctx) SendImage(file string, replytosender bool, caption ...any) (repl Type: FileTypeImage, URL: file, } - _, _ = ctx.SendPlainMessage(replytosender, caption...) + if len(caption) > 0 { + _, _ = ctx.SendPlainMessage(replytosender, caption...) + } if OnlyQQGroup(ctx) { reply, err = ctx.PostFileToQQGroup(ctx.Message.ChannelID, fp) } else if OnlyQQPrivate(ctx) {