mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-06 20:13:50 +08:00
fix forward img & video upload.
This commit is contained in:
parent
b2d8a61a99
commit
85624d1a27
11
coolq/api.go
11
coolq/api.go
@ -303,7 +303,7 @@ func (bot *CQBot) CQSendGroupForwardMessage(groupId int64, m gjson.Result) MSG {
|
||||
var newElem []message.IMessageElement
|
||||
for _, elem := range content {
|
||||
if img, ok := elem.(*LocalImageElement); ok {
|
||||
gm, err := bot.Client.UploadGroupImage(groupId, img.Stream)
|
||||
gm, err := bot.UploadLocalImageAsGroup(groupId, img)
|
||||
if err != nil {
|
||||
log.Warnf("警告:群 %v 图片上传失败: %v", groupId, err)
|
||||
continue
|
||||
@ -311,6 +311,15 @@ func (bot *CQBot) CQSendGroupForwardMessage(groupId int64, m gjson.Result) MSG {
|
||||
newElem = append(newElem, gm)
|
||||
continue
|
||||
}
|
||||
if video, ok := elem.(*LocalVideoElement); ok {
|
||||
gm, err := bot.UploadLocalVideo(groupId, video)
|
||||
if err != nil {
|
||||
log.Warnf("警告:群 %v 视频上传失败: %v", groupId, err)
|
||||
continue
|
||||
}
|
||||
newElem = append(newElem, gm)
|
||||
continue
|
||||
}
|
||||
newElem = append(newElem, elem)
|
||||
}
|
||||
nodes = append(nodes, &message.ForwardNode{
|
||||
|
Loading…
x
Reference in New Issue
Block a user