Skip to content

Commit 1bc3818

Browse files
committed
feat: basic guild music share support
1 parent bc2901f commit 1bc3818

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

‎coolq/bot.go‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@ import (
1212
"sync"
1313
"time"
1414

15-
"github.com/segmentio/asm/base64"
16-
17-
"github.com/Mrs4s/go-cqhttp/db"
18-
1915
"github.com/Mrs4s/MiraiGo/binary"
2016
"github.com/Mrs4s/MiraiGo/client"
2117
"github.com/Mrs4s/MiraiGo/message"
2218
"github.com/Mrs4s/MiraiGo/utils"
2319
"github.com/pkg/errors"
20+
"github.com/segmentio/asm/base64"
2421
log "github.com/sirupsen/logrus"
2522

23+
"github.com/Mrs4s/go-cqhttp/db"
2624
"github.com/Mrs4s/go-cqhttp/global"
2725
"github.com/Mrs4s/go-cqhttp/internal/base"
2826
)
@@ -377,7 +375,11 @@ func (bot *CQBot) SendGuildChannelMessage(guildID, channelID uint64, m *message.
377375
}
378376
e = n
379377

380-
case *LocalVoiceElement, *PokeElement, *message.MusicShareElement:
378+
case *message.MusicShareElement:
379+
bot.Client.SendGuildMusicShare(guildID, channelID, i)
380+
return "-1" // todo: fix this
381+
382+
case *LocalVoiceElement, *PokeElement:
381383
log.Warnf("警告: 频道暂不支持发送 %v 消息", i.Type().String())
382384
continue
383385
}

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.17
55
require (
66
github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f
77
github.com/Microsoft/go-winio v0.5.1
8-
github.com/Mrs4s/MiraiGo v0.0.0-20211210183655-416a6c17bee3
8+
github.com/Mrs4s/MiraiGo v0.0.0-20211212091247-abe1fe7770a2
99
github.com/dustin/go-humanize v1.0.0
1010
github.com/fumiama/go-hide-param v0.1.4
1111
github.com/gabriel-vasile/mimetype v1.4.0

‎go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f/g
33
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
44
github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY=
55
github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
6-
github.com/Mrs4s/MiraiGo v0.0.0-20211210183655-416a6c17bee3 h1:IWZEA6yZOwXCEg5a4kuZkzfy3NghjsRtVIbJ4SBpzU0=
7-
github.com/Mrs4s/MiraiGo v0.0.0-20211210183655-416a6c17bee3/go.mod h1:YD9gBKkxC9lPPtx3doYXRG26VBkK6YXjrS76cv01C5w=
6+
github.com/Mrs4s/MiraiGo v0.0.0-20211212091247-abe1fe7770a2 h1:4qcfWsSbVDRBsNSpnvywWZhIrv5rXNJD9OBksuIi4FQ=
7+
github.com/Mrs4s/MiraiGo v0.0.0-20211212091247-abe1fe7770a2/go.mod h1:YD9gBKkxC9lPPtx3doYXRG26VBkK6YXjrS76cv01C5w=
88
github.com/RomiChan/protobuf v0.0.0-20211204042931-ff4f35848737 h1:p4o7/eSoP39jwnGZz08N1IpH/mNzg9SdCn7kPM9A9BE=
99
github.com/RomiChan/protobuf v0.0.0-20211204042931-ff4f35848737/go.mod h1:CKKOWC7mBxd36zxsCB1V8DTrwlTNRQvkSVbYqyUiGEE=
1010
github.com/bits-and-blooms/bitset v1.2.1 h1:M+/hrU9xlMp7t4TyTDQW97d3tRPVuKFC6zBEK16QnXY=

0 commit comments

Comments
 (0)