Skip to content

Commit

Permalink
add: SendFriendLike 发送好友赞 (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
icarus-ai authored Oct 14, 2024
1 parent fe608d5 commit d740596
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
23 changes: 18 additions & 5 deletions client/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,21 @@ import (
"strings"
"time"

"github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/highway"

"github.com/LagrangeDev/LagrangeGo/client/packets/pb/action"
"github.com/tidwall/gjson"

"golang.org/x/net/html"

"github.com/LagrangeDev/LagrangeGo/client/entity"
messagePkt "github.com/LagrangeDev/LagrangeGo/client/packets/message"
oidb2 "github.com/LagrangeDev/LagrangeGo/client/packets/oidb"
oidb2 "github.com/LagrangeDev/LagrangeGo/client/packets/oidb"
"github.com/LagrangeDev/LagrangeGo/client/packets/pb/action"
"github.com/LagrangeDev/LagrangeGo/client/packets/pb/message"
"github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/highway"
"github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb"
"github.com/LagrangeDev/LagrangeGo/internal/proto"
message2 "github.com/LagrangeDev/LagrangeGo/message"
"github.com/LagrangeDev/LagrangeGo/utils/binary"
"github.com/LagrangeDev/LagrangeGo/utils/crypto"
"github.com/tidwall/gjson"
)

func (c *QQClient) SetOnlineStatus(status, ext, battery uint32) error {
Expand Down Expand Up @@ -1217,3 +1216,17 @@ func (c *QQClient) SetEssenceMessage(groupUin, seq, random uint32, isSet bool) e
}
return oidb2.ParseSetEssenceMessageResp(resp)
}

// SendFriendLike 发送好友赞
func (c *QQClient) SendFriendLike(uin uint32, count uint32) error {
if count > 20 { count = 20 } else if count < 1 { count = 1 }
pkt, err := oidb2.BuildFriendLikeReq(c.GetUid(uin), count)
if err != nil {
return err
}
resp, err := c.sendOidbPacketAndWait(pkt)
if err != nil {
return err
}
return oidb2.ParseFriendLikeResp(resp)
}
4 changes: 2 additions & 2 deletions client/packets/oidb/friend_like.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
func BuildFriendLikeReq(uid string, count uint32) (*OidbPacket, error) {
body := &oidb.OidbSvcTrpcTcp0X7E5_104{
TargetUid: proto.Some(uid),
Field2: 71,
Field3: count,
Source : 71,
Count : count,
}
return BuildOidbPacket(0x7E5, 104, body, false, false)
}
Expand Down
6 changes: 3 additions & 3 deletions client/packets/pb/service/oidb/OidbSvcTrpcTcp0x7E5_104.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client/packets/pb/service/oidb/OidbSvcTrpcTcp0x7E5_104.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ option go_package = "github.com/LagrangeDev/LagrangeGo/client/packets/pb/service
// Friend Likes
message OidbSvcTrpcTcp0x7E5_104 {
optional string TargetUid = 11;
uint32 Field2 = 12; // 71
uint32 Field3 = 13; // 1
uint32 Source = 12; // 71
uint32 Count = 13; // 1
}

0 comments on commit d740596

Please sign in to comment.