-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fmt: import * feat: 获取剩余@全员次数 * feat: 获取剩余@全员次数 & fix & fmt * fix: error类型破坏
- Loading branch information
Showing
8 changed files
with
180 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package oidb | ||
|
||
import "github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb" | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/group_msg.go#L213 | ||
func BuildAtAllRemainRequest(uin, gin uint32) (*Packet, error) { | ||
body := &oidb.OidbSvcTrpcTcp0X8A7_0_ReqBody{ | ||
SubCmd: 1, | ||
LimitIntervalTypeForUin: 2, | ||
LimitIntervalTypeForGroup: 1, | ||
Uin: uint64(uin), | ||
GroupUin: uint64(gin), | ||
} | ||
return BuildOidbPacket(0x8A7, 0, body, false, true) | ||
} | ||
|
||
type AtAllRemainInfo struct { | ||
CanAtAll bool | ||
CountForGroup uint32 // 当前群默认可用次数 | ||
CountForUin uint32 // 当前QQ剩余次数 | ||
} | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/group_msg.go#L326 | ||
func ParseAtAllRemainResponse(data []byte) (*AtAllRemainInfo, error) { | ||
var rsp oidb.OidbSvcTrpcTcp0X8A7_0_RspBody | ||
_, err := ParseOidbPacket(data, &rsp) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &AtAllRemainInfo{ | ||
CanAtAll: rsp.CanAtAll, | ||
CountForGroup: rsp.CountForGroup, | ||
CountForUin: rsp.CountForUin, | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
client/packets/pb/service/oidb/OidbSvcTrpcTcp0x8A7_0.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
client/packets/pb/service/oidb/OidbSvcTrpcTcp0x8A7_0.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
syntax = "proto3"; | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/master/client/pb/oidb/oidb0x8a7.proto | ||
|
||
option go_package = "github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb"; | ||
|
||
message OidbSvcTrpcTcp0x8A7_0_ReqBody { | ||
uint32 subCmd = 1; | ||
uint32 limitIntervalTypeForUin = 2; | ||
uint32 limitIntervalTypeForGroup = 3; | ||
uint64 uin = 4; | ||
uint64 groupUin = 5; | ||
} | ||
|
||
message OidbSvcTrpcTcp0x8A7_0_RspBody { | ||
bool canAtAll = 1; | ||
uint32 countForUin = 2; | ||
uint32 countForGroup = 3; | ||
//optional bytes promptMsg1 = 4; | ||
//optional bytes promptMsg2 = 5; | ||
} |
68 changes: 36 additions & 32 deletions
68
client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters