mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 19:43:49 +08:00
fix show pic error.
This commit is contained in:
parent
38a2c3a945
commit
ef713bc59c
@ -1039,7 +1039,7 @@ func (bot *CQBot) makeShowPic(elem message.IMessageElement, source string, icon
|
||||
var suf message.IMessageElement
|
||||
if i, ok := elem.(*LocalImageElement); ok {
|
||||
if group == false {
|
||||
gm, err := bot.Client.UploadPrivateImage(1, i.Stream)
|
||||
gm, err := bot.UploadLocalImageAsPrivate(1, i)
|
||||
if err != nil {
|
||||
log.Warnf("警告: 好友消息 %v 消息图片上传失败: %v", 1, err)
|
||||
return nil, err
|
||||
@ -1047,7 +1047,7 @@ func (bot *CQBot) makeShowPic(elem message.IMessageElement, source string, icon
|
||||
suf = gm
|
||||
xml = fmt.Sprintf(`<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><msg serviceID="5" templateID="12345" action="" brief="[分享]我看到一张很赞的图片,分享给你,快来看!" sourceMsgId="0" url="%s" flag="0" adverSign="0" multiMsgFlag="0"><item layout="0" advertiser_id="0" aid="0"><image uuid="%x" md5="%x" GroupFiledid="0" filesize="%d" local_path="%s" minWidth="%d" minHeight="%d" maxWidth="%d" maxHeight="%d" /></item><source name="%s" icon="%s" action="" appid="-1" /></msg>`, "", gm.Md5, gm.Md5, len(i.Data), "", minWidth, minHeight, maxWidth, maxHeight, source, icon)
|
||||
} else {
|
||||
gm, err := bot.Client.UploadGroupImage(1, i.Stream)
|
||||
gm, err := bot.UploadLocalImageAsGroup(1, i)
|
||||
if err != nil {
|
||||
log.Warnf("警告: 群 %v 消息图片上传失败: %v", 1, err)
|
||||
return nil, err
|
||||
|
Loading…
x
Reference in New Issue
Block a user