mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-12 14:10:47 +08:00
optimize: media print
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
|||||||
|
|
||||||
base14 "github.com/fumiama/go-base16384"
|
base14 "github.com/fumiama/go-base16384"
|
||||||
"github.com/fumiama/imoto"
|
"github.com/fumiama/imoto"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run codegen/context/main.go
|
//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 {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
logrus.Infoln(getLogHeader(), "=> 上传:", reply)
|
||||||
reply, err = ctx.Post(isnextreply, &MessagePost{
|
reply, err = ctx.Post(isnextreply, &MessagePost{
|
||||||
Content: " ",
|
Content: " ",
|
||||||
Media: &MessageMedia{FileInfo: reply.FileInfo},
|
Media: &MessageMedia{FileInfo: reply.FileInfo},
|
||||||
@@ -260,6 +262,7 @@ func (ctx *Ctx) SendImage(file string, replytosender bool, caption ...any) (repl
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
logrus.Infoln(getLogHeader(), "=> 上传:", reply)
|
||||||
post.Media = &MessageMedia{FileInfo: reply.FileInfo}
|
post.Media = &MessageMedia{FileInfo: reply.FileInfo}
|
||||||
} else {
|
} else {
|
||||||
if strings.HasPrefix(file, "http") {
|
if strings.HasPrefix(file, "http") {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ func (m *Message) String() string {
|
|||||||
sb := strings.Builder{}
|
sb := strings.Builder{}
|
||||||
if m.Timestamp != nil {
|
if m.Timestamp != nil {
|
||||||
sb.WriteString(m.Timestamp.Format(time.DateTime))
|
sb.WriteString(m.Timestamp.Format(time.DateTime))
|
||||||
|
sb.WriteByte(' ')
|
||||||
}
|
}
|
||||||
if m.FileUUID != "" {
|
if m.FileUUID != "" {
|
||||||
sb.WriteString("富媒体: ")
|
sb.WriteString("富媒体: ")
|
||||||
|
|||||||
Reference in New Issue
Block a user