mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 11:33:48 +08:00
commit
4cb3d8f33e
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -16,12 +16,16 @@ jobs:
|
||||
matrix:
|
||||
# build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64
|
||||
goos: [linux, windows, darwin]
|
||||
goarch: ["386", amd64, arm]
|
||||
goarch: ["386", amd64, arm, arm64]
|
||||
exclude:
|
||||
- goos: darwin
|
||||
goarch: arm
|
||||
- goos: darwin
|
||||
goarch: arm64
|
||||
- goos: darwin
|
||||
goarch: "386"
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
fail-fast: true
|
||||
|
||||
steps:
|
||||
|
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@ -10,12 +10,16 @@ jobs:
|
||||
matrix:
|
||||
# build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/386, darwin/amd64
|
||||
goos: [linux, windows, darwin]
|
||||
goarch: ["386", amd64, arm]
|
||||
goarch: ["386", amd64, arm, arm64]
|
||||
exclude:
|
||||
- goos: darwin
|
||||
goarch: arm
|
||||
- goos: darwin
|
||||
goarch: arm64
|
||||
- goos: darwin
|
||||
goarch: "386"
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
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{
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,5 @@
|
||||
// +build linux windows darwin
|
||||
// +build 386 amd64 arm
|
||||
// +build 386 amd64 arm arm64
|
||||
|
||||
package codec
|
||||
|
||||
|
13
global/codec/codec_unsupportedarch.go
Normal file
13
global/codec/codec_unsupportedarch.go
Normal file
@ -0,0 +1,13 @@
|
||||
// +build !386,!arm64,!amd64,!arm
|
||||
|
||||
package codec
|
||||
|
||||
import "errors"
|
||||
|
||||
func Init() error {
|
||||
return errors.New("Unsupport arch now")
|
||||
}
|
||||
|
||||
func EncodeToSilk(record []byte, tempName string, useCache bool) ([]byte, error) {
|
||||
return nil, errors.New("Unsupport arch now")
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
// +build !linux,!windows,!darwin
|
||||
// +build !386,!amd64,!arm
|
||||
// +build !windows,!linux,!darwin
|
||||
|
||||
package codec
|
||||
|
Loading…
x
Reference in New Issue
Block a user