diff --git a/coolq/bot.go b/coolq/bot.go index 32409c8..8c04ee0 100644 --- a/coolq/bot.go +++ b/coolq/bot.go @@ -12,17 +12,15 @@ import ( "sync" "time" - "github.com/segmentio/asm/base64" - - "github.com/Mrs4s/go-cqhttp/db" - "github.com/Mrs4s/MiraiGo/binary" "github.com/Mrs4s/MiraiGo/client" "github.com/Mrs4s/MiraiGo/message" "github.com/Mrs4s/MiraiGo/utils" "github.com/pkg/errors" + "github.com/segmentio/asm/base64" log "github.com/sirupsen/logrus" + "github.com/Mrs4s/go-cqhttp/db" "github.com/Mrs4s/go-cqhttp/global" "github.com/Mrs4s/go-cqhttp/internal/base" ) @@ -377,7 +375,11 @@ func (bot *CQBot) SendGuildChannelMessage(guildID, channelID uint64, m *message. } e = n - case *LocalVoiceElement, *PokeElement, *message.MusicShareElement: + case *message.MusicShareElement: + bot.Client.SendGuildMusicShare(guildID, channelID, i) + return "-1" // todo: fix this + + case *LocalVoiceElement, *PokeElement: log.Warnf("警告: 频道暂不支持发送 %v 消息", i.Type().String()) continue } diff --git a/go.mod b/go.mod index d0a41dc..2b592cb 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f github.com/Microsoft/go-winio v0.5.1 - github.com/Mrs4s/MiraiGo v0.0.0-20211210183655-416a6c17bee3 + github.com/Mrs4s/MiraiGo v0.0.0-20211212091247-abe1fe7770a2 github.com/dustin/go-humanize v1.0.0 github.com/fumiama/go-hide-param v0.1.4 github.com/gabriel-vasile/mimetype v1.4.0 diff --git a/go.sum b/go.sum index 9b2b005..2d132e3 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f/g github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Mrs4s/MiraiGo v0.0.0-20211210183655-416a6c17bee3 h1:IWZEA6yZOwXCEg5a4kuZkzfy3NghjsRtVIbJ4SBpzU0= -github.com/Mrs4s/MiraiGo v0.0.0-20211210183655-416a6c17bee3/go.mod h1:YD9gBKkxC9lPPtx3doYXRG26VBkK6YXjrS76cv01C5w= +github.com/Mrs4s/MiraiGo v0.0.0-20211212091247-abe1fe7770a2 h1:4qcfWsSbVDRBsNSpnvywWZhIrv5rXNJD9OBksuIi4FQ= +github.com/Mrs4s/MiraiGo v0.0.0-20211212091247-abe1fe7770a2/go.mod h1:YD9gBKkxC9lPPtx3doYXRG26VBkK6YXjrS76cv01C5w= github.com/RomiChan/protobuf v0.0.0-20211204042931-ff4f35848737 h1:p4o7/eSoP39jwnGZz08N1IpH/mNzg9SdCn7kPM9A9BE= github.com/RomiChan/protobuf v0.0.0-20211204042931-ff4f35848737/go.mod h1:CKKOWC7mBxd36zxsCB1V8DTrwlTNRQvkSVbYqyUiGEE= github.com/bits-and-blooms/bitset v1.2.1 h1:M+/hrU9xlMp7t4TyTDQW97d3tRPVuKFC6zBEK16QnXY=