Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: SendFriendLike 发送好友赞 #103

Merged
merged 4 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
Loading