github.com/LagrangeDev/LagrangeGo@v0.0.0-20240512064304-ad4a85e10cb4/client/packets/oidb/FetchGroupRequests.go (about)

     1  package oidb
     2  
     3  import (
     4  	"errors"
     5  
     6  	"github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb"
     7  )
     8  
     9  func BuildFetchGroupRequestsReq() (*OidbPacket, error) {
    10  	body := &oidb.OidbSvcTrpcTcp0X10C0_1{
    11  		Count:  20,
    12  		Field2: 0,
    13  	}
    14  	return BuildOidbPacket(0x10C0, 1, body, false, false)
    15  }
    16  
    17  func ParseFetchGroupRequestsReq(data []byte) (*oidb.OidbSvcTrpcTcp0X10C0_1Response, error) {
    18  	var resp oidb.OidbSvcTrpcTcp0X10C0_1Response
    19  	baseResp, err := ParseOidbPacket(data, &resp)
    20  	if err != nil {
    21  		return nil, err
    22  	}
    23  	if baseResp.ErrorCode != 0 {
    24  		return nil, errors.New(baseResp.ErrorMsg)
    25  	}
    26  	return &resp, nil
    27  }