1
0
mirror of https://github.com/fumiama/NanoBot.git synced 2026-06-05 02:30:23 +08:00

optimize: media print

This commit is contained in:
源文雨
2023-11-22 22:36:13 +09:00
parent 0f21f89ad0
commit 908c525bb0
2 changed files with 4 additions and 0 deletions

View File

@@ -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") {

View File

@@ -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("富媒体: ")