From 908c525bb0c49202e4a251bd1b620975353e55ab 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: Wed, 22 Nov 2023 22:36:13 +0900 Subject: [PATCH] optimize: media print --- context.go | 3 +++ openapi_message.go | 1 + 2 files changed, 4 insertions(+) diff --git a/context.go b/context.go index c403071..b5d9473 100644 --- a/context.go +++ b/context.go @@ -12,6 +12,7 @@ import ( base14 "github.com/fumiama/go-base16384" "github.com/fumiama/imoto" + "github.com/sirupsen/logrus" ) //go:generate go run codegen/context/main.go @@ -137,6 +138,7 @@ func (ctx *Ctx) Send(messages Messages) (m []*Message, err error) { if err != nil { return } + logrus.Infoln(getLogHeader(), "=> 上传:", reply) reply, err = ctx.Post(isnextreply, &MessagePost{ Content: " ", Media: &MessageMedia{FileInfo: reply.FileInfo}, @@ -260,6 +262,7 @@ func (ctx *Ctx) SendImage(file string, replytosender bool, caption ...any) (repl if err != nil { return } + logrus.Infoln(getLogHeader(), "=> 上传:", reply) post.Media = &MessageMedia{FileInfo: reply.FileInfo} } else { if strings.HasPrefix(file, "http") { diff --git a/openapi_message.go b/openapi_message.go index 3ae65dc..e5e4b7f 100644 --- a/openapi_message.go +++ b/openapi_message.go @@ -48,6 +48,7 @@ func (m *Message) String() string { sb := strings.Builder{} if m.Timestamp != nil { sb.WriteString(m.Timestamp.Format(time.DateTime)) + sb.WriteByte(' ') } if m.FileUUID != "" { sb.WriteString("富媒体: ")