Tangent_PC

package module
v0.0.0-...-cf331e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2022 License: MPL-2.0 Imports: 24 Imported by: 0

README

❗❗❗协议说明❗❗❗

🚀🚀🚀本核心库是基于PCQQ9.4.8开发的

🚫仅用于学习协议使用!

🚫请勿用于违法犯罪!

❗ 协议遵循MPL 2.0协议进行开源,作者对一切二开行为概不负责

协议功能

登录相关

  • ❌ 账号登录
  • ✅ 扫码登录
  • ✅ 缓存登录
  • ✅ 修改登录状态

群相关

  • ❗ 群消息解析

    • 普通消息
    • At人
    • 普通文本
    • 图片消息 (解析MD5)
    • 图文消息
    • 回复
    • 语音消息
    • 卡片消息
    • 红包消息
  • ✅ 发送消息

    • 普通消息

      • At人
      • 普通文本
    • 图片消息

    • 图文消息

    • 回复

    • 语音消息

    • 卡片消息

  • ✅ 撤回消息

  • ✅ 已读群消息

名片类

括号内为返回Interface的具体类型 强制转一下就行了

  • 年龄查询 (uint8)
  • 昵称查询 (string)
  • 等级查询 (uint8)
  • 邮箱查询
  • 生日查询 (model.Birthday)
  • 名片赞数查询

财付通类 ❌

由于QQ钱包支付用户服务协议, 将不支持一切有关QQ钱包的协议

4.13 您不得利用本服务实施下列任一的行为:

(9) 侵害QQ钱包支付服务系統;

更新日志

2022年3月25日

  1. [Improve] Log库
  2. [Improve] 群消息At

2022年1月28日16:09:58

  1. [New] 发送简单的群消息
  2. [Improve] 压榨性能

2022年1月26日13:52:36

  1. [New] 置群消息已读 🆕
  2. [Fix] 项目结构

Documentation

Index

Constants

View Source
const (
	SummaryNick     = 0x4E_22 //qq昵称
	SummaryQQAge    = 0x65_97 //q龄
	SummaryAge      = 0x4E_45 //年龄
	SummaryEmail    = 0x4E_2B //邮箱
	SummaryBirthday = 0x4E_3F //生日
)
View Source
const (
	Online    = 0x0A //在线
	QMe       = 0x3C //Q我吧
	Leave     = 0x1E //离开
	Busy      = 0x32 //忙碌
	DND       = 0x46 //勿扰
	Invisible = 0x28 //隐身
)

Online 0A=在线,3C=Q我吧,1E=离开,32=忙碌,46=请勿打扰,28=隐身

View Source
const (
	QRNoAgree = 0x1            /*已扫码但未点击确认*/
	QRNoScan  = 0x2            /*未扫码*/
	QROk      = model.LogicSuc /*已确认登录*/
	QRUnKnow  = 0xFF           /*未响应*/
)

二维码状态标识

View Source
const (
	LoginSuc            = model.LogicSuc
	LoginNeedVerifyCode = 0xFB
)
View Source
const (
	Remark = 0x0D //备注信息
)

Variables

View Source
var WaitTime = uint32(3) /*三秒延迟*/

Functions

This section is empty.

Types

type HOOK

type HOOK struct {
	GroupMsg func(Msg model.GroupMsg) //群消息接收
}

HOOK 回调钩子

type TangentPC

type TangentPC struct {
	Uin uint64
	// contains filtered or unexported fields
}

func New

func New(Account string, Computer model.Computer) (this *TangentPC)

New 新建PC_QQ协议类

func (*TangentPC) ChangeOnlineStatus

func (this *TangentPC) ChangeOnlineStatus(OnLineSts uint16) bool

ChangeOnlineStatus 修改在线状态

func (TangentPC) CheckQRCode

func (this TangentPC) CheckQRCode(resp *model.QRResp) uint8

CheckQRCode 检测二维码状态

func (*TangentPC) FetchQRCode

func (this *TangentPC) FetchQRCode() *model.QRResp

FetchQRCode 获取登录二维码

func (*TangentPC) GetCommonHttpConnSig

func (this *TangentPC) GetCommonHttpConnSig(subCmd uint32) []byte

func (*TangentPC) GetGroupMemberCardFromCache

func (this *TangentPC) GetGroupMemberCardFromCache(GroupUin, uin uint64) string

GetGroupMemberCardFromCache 从缓存获取群员的群名片

func (*TangentPC) GetJoinedGroupName

func (this *TangentPC) GetJoinedGroupName(GroupUin uint64) string

GetJoinedGroupName 获取已加入的群列表

func (*TangentPC) GetSelfInfo

func (this *TangentPC) GetSelfInfo() model.Information

GetSelfInfo 获取账号信息

func (*TangentPC) GetServerMsg

func (this *TangentPC) GetServerMsg(Cmd, subCmd uint16, seq uint16, MsgInfo, data []byte)

GetServerMsg 读取系统信息

func (*TangentPC) HeatBoat

func (this *TangentPC) HeatBoat() bool

HeatBoat 心跳

func (*TangentPC) Hook

func (this *TangentPC) Hook(GroupMsg func(Msg model.GroupMsg))

Hook 事件回调

func (*TangentPC) Login

func (this *TangentPC) Login(Password string)

Login 账号密码登录

func (*TangentPC) LoginByToken

func (this *TangentPC) LoginByToken(tgt *model.TgtInfo) (code uint8, err error)

LoginByToken 令牌登录

func (*TangentPC) NewLevelSpeedUp

func (this *TangentPC) NewLevelSpeedUp()

func (*TangentPC) PacketHttpConn

func (this *TangentPC) PacketHttpConn(bin ...[]byte) []byte

func (*TangentPC) PingServer

func (this *TangentPC) PingServer() bool

PingServer 连接初始化,Ping服务器

func (*TangentPC) QRLogin

func (this *TangentPC) QRLogin() (err error, tgt *model.TgtInfo)

QRLogin 二维码登录

func (*TangentPC) ReadGroupMsg

func (this *TangentPC) ReadGroupMsg(GroupCode uint64, MsgSeq uint32) bool

ReadGroupMsg 置群消息已读

内部会自动调用不用管

func (*TangentPC) ResetAccount

func (this *TangentPC) ResetAccount(account string)

ResetAccount 账号重新设置

func (*TangentPC) RevokeGroupMessage

func (this *TangentPC) RevokeGroupMessage(GroupCode uint64, MsgSeq, MsgID uint32) error

RevokeGroupMessage 撤回消息 (:要有管理员权限

func (*TangentPC) SendFriendMsg

func (this *TangentPC) SendFriendMsg(FriendUin uint64, Msg ...Msg.Builder) (Code bool, MsgSeq uint32)

func (*TangentPC) SendGroupMsg

func (this *TangentPC) SendGroupMsg(GroupCode uint64, Msg ...Msg.Builder) (Code bool, MsgSeq uint32)

SendGroupMsg 发送群消息

GroupCode 群号
Msg 	  消息内容

func (*TangentPC) U948

func (this *TangentPC) U948() *TangentPC

Directories

Path Synopsis
protocal
Msg
Tlv
* @Author: Trial * @email: shenpan233@vip.qq.com * @app: 公共参数 * @Creat: 2021/11/26 0026 22:39
* @Author: Trial * @email: shenpan233@vip.qq.com * @app: 公共参数 * @Creat: 2021/11/26 0026 22:39
udper
* @Author: Trial * @email: shenpan233@vip.qq.com * @app: 发送 * @Creat: 2021/11/27 0027 13:10
* @Author: Trial * @email: shenpan233@vip.qq.com * @app: 发送 * @Creat: 2021/11/27 0027 13:10

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL