11using System . IO . Compression ;
22using Lagrange . Core . Common ;
3+ using Lagrange . Core . Common . Entity ;
34using Lagrange . Core . Internal . Events ;
45using Lagrange . Core . Internal . Events . Message ;
56using Lagrange . Core . Internal . Logic ;
@@ -22,17 +23,10 @@ protected override async ValueTask<ReadOnlyMemory<byte>> Build(LongMsgSendEventR
2223 var fakeMsg = await context . EventContext . GetLogic < MessagingLogic > ( ) . BuildFake ( msg ) ;
2324 messages . Add ( fakeMsg ) ;
2425 }
25-
26+
2627 var content = new PbMultiMsgTransmit
2728 {
28- Items =
29- [
30- new PbMultiMsgItem
31- {
32- FileName = "MultiMsg" ,
33- Buffer = new PbMultiMsgNew { Msg = messages }
34- }
35- ]
29+ Items = [ new PbMultiMsgItem { FileName = "MultiMsg" , Buffer = new PbMultiMsgNew { Msg = messages } } ]
3630 } ;
3731
3832 await using var dest = new MemoryStream ( ) ;
@@ -45,9 +39,9 @@ protected override async ValueTask<ReadOnlyMemory<byte>> Build(LongMsgSendEventR
4539 {
4640 SendReq = new LongMsgSendReq
4741 {
48- MsgType = input . GroupUin is null ? 1u : 3u , // 4 for wpamsg, 5 for grpmsg temp
49- PeerInfo = new LongMsgPeerInfo { PeerUid = input . Contact . Uid } ,
50- GroupUin = input . GroupUin ?? 0 ,
42+ MsgType = input . Receiver is not BotGroup ? 1u : 3u , // 4 for wpamsg, 5 for grpmsg temp
43+ PeerInfo = new LongMsgPeerInfo { PeerUid = input . Receiver . Uid } ,
44+ GroupUin = input . Receiver is BotGroup group ? group . Uin : 0 ,
5145 Payload = compressedContent
5246 } ,
5347 Attr = new LongMsgAttr
0 commit comments