client

package
v0.0.0-...-54bdd87 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: AGPL-3.0 Imports: 70 Imported by: 123

Documentation

Index

Constants

View Source
const (
	NeedCaptcha            LoginError = 1
	OtherLoginError        LoginError = 3
	UnsafeDeviceError      LoginError = 4
	SMSNeededError         LoginError = 5
	TooManySMSRequestError LoginError = 6
	SMSOrVerifyNeededError LoginError = 7
	SliderNeededError      LoginError = 8
	UnknownLoginError      LoginError = -1

	QRCodeImageFetch        QRCodeLoginState = 1
	QRCodeWaitingForScan    QRCodeLoginState = 2
	QRCodeWaitingForConfirm QRCodeLoginState = 3
	QRCodeTimeout           QRCodeLoginState = 4
	QRCodeConfirmed         QRCodeLoginState = 5
	QRCodeCanceled          QRCodeLoginState = 6

	StatusOnline        UserOnlineStatus = 11   // 在线
	StatusOffline       UserOnlineStatus = 21   // 离线
	StatusAway          UserOnlineStatus = 31   // 离开
	StatusInvisible     UserOnlineStatus = 41   // 隐身
	StatusBusy          UserOnlineStatus = 50   // 忙
	StatusBattery       UserOnlineStatus = 1000 // 当前电量
	StatusListening     UserOnlineStatus = 1028 // 听歌中
	StatusConstellation UserOnlineStatus = 1040 // 星座运势
	StatusWeather       UserOnlineStatus = 1030 // 今日天气
	StatusMeetSpring    UserOnlineStatus = 1069 // 遇见春天
	StatusTimi          UserOnlineStatus = 1027 // Timi中
	StatusEatChicken    UserOnlineStatus = 1064 // 吃鸡中
	StatusLoving        UserOnlineStatus = 1051 // 恋爱中
	StatusWangWang      UserOnlineStatus = 1053 // 汪汪汪
	StatusCookedRice    UserOnlineStatus = 1019 // 干饭中
	StatusStudy         UserOnlineStatus = 1018 // 学习中
	StatusStayUp        UserOnlineStatus = 1032 // 熬夜中
	StatusPlayBall      UserOnlineStatus = 1050 // 打球中
	StatusSignal        UserOnlineStatus = 1011 // 信号弱
	StatusStudyOnline   UserOnlineStatus = 1024 // 在线学习
	StatusGaming        UserOnlineStatus = 1017 // 游戏中
	StatusVacationing   UserOnlineStatus = 1022 // 度假中
	StatusWatchingTV    UserOnlineStatus = 1021 // 追剧中
	StatusFitness       UserOnlineStatus = 1020 // 健身中

	Owner         MemberPermission = 1
	Administrator MemberPermission = 2
	Member        MemberPermission = 3

	Unset        = auth.Unset
	AndroidPhone = auth.AndroidPhone
	AndroidWatch = auth.AndroidWatch
	MacOS        = auth.MacOS
	QiDian       = auth.QiDian
	IPad         = auth.IPad
	AndroidPad   = auth.AndroidPad
)
View Source
const (
	UnknownDecoder = iota
)

Variables

View Source
var (
	ErrAlreadyOnline  = errors.New("already online")
	ErrMemberNotFound = errors.New("member not found")
	ErrNotExists      = errors.New("not exists")
)
View Source
var EmptyBytes = make([]byte, 0)

Functions

func GenIMEI

func GenIMEI() string

func NewUinFilterPrivate

func NewUinFilterPrivate(uin int64) func(*message.PrivateMessage) bool

func UpdateAppVersion

func UpdateAppVersion(protocolType auth.ProtocolType, data []byte) error

Types

type AtAllRemainInfo

type AtAllRemainInfo struct {
	CanAtAll                 bool   `json:"can_at_all"`
	RemainAtAllCountForGroup uint32 `json:"remain_at_all_count_for_group"`
	RemainAtAllCountForUin   uint32 `json:"remain_at_all_count_for_uin"`
}

type ChannelInfo

type ChannelInfo struct {
	ChannelId   uint64
	ChannelName string
	Time        uint64
	EventTime   uint32
	NotifyType  uint32
	ChannelType ChannelType
	AtAllSeq    uint64
	Meta        *ChannelMeta
	// contains filtered or unexported fields
}

ChannelInfo 子频道信息

type ChannelMeta

type ChannelMeta struct {
	CreatorUin           int64
	CreatorTinyId        uint64
	CreateTime           int64
	GuildId              uint64
	VisibleType          int32
	TopMessageSeq        uint64
	TopMessageTime       int64
	TopMessageOperatorId uint64
	CurrentSlowMode      int32
	TalkPermission       int32
	SlowModes            []*ChannelSlowModeInfo
}

type ChannelSlowModeInfo

type ChannelSlowModeInfo struct {
	SlowModeKey    int32
	SpeakFrequency int32
	SlowModeCircle int32
	SlowModeText   string
}

type ChannelType

type ChannelType int32
const (
	ChannelTypeText  ChannelType = 1
	ChannelTypeVoice ChannelType = 2
	ChannelTypeLive  ChannelType = 5
	ChannelTypeTopic ChannelType = 7
)

type ClientDisconnectedEvent

type ClientDisconnectedEvent struct {
	Message string
}

type ClientProtocol

type ClientProtocol = auth.ProtocolType

type ConnectionQualityInfo

type ConnectionQualityInfo struct {
	// ChatServerLatency 聊天服务器延迟
	ChatServerLatency int64
	// ChatServerPacketLoss 聊天服务器ICMP丢包数
	ChatServerPacketLoss int
	// LongMessageServerLatency 长消息服务器延迟. 涉及长消息以及合并转发消息下载
	LongMessageServerLatency int64
	// LongMessageServerResponseLatency 长消息服务器返回延迟
	LongMessageServerResponseLatency int64
	// SrvServerLatency Highway服务器延迟. 涉及媒体以及群文件上传
	SrvServerLatency int64
	// SrvServerPacketLoss Highway服务器ICMP丢包数.
	SrvServerPacketLoss int
}

ConnectionQualityInfo 客户端连接质量测试结果 延迟单位为 ms 如为 9999 则测试失败 测试方法为 TCP 连接测试 丢包测试方法为 ICMP. 总共发送 10 个包, 记录丢包数

type Coordinate

type Coordinate struct {
	X int32 `json:"x"`
	Y int32 `json:"y"`
}

type CurrentTalkative

type CurrentTalkative struct {
	Uin      int64  `json:"uin"`
	DayCount int32  `json:"day_count"`
	Avatar   string `json:"avatar"`
	Name     string `json:"nick"`
}

type CustomFace

type CustomFace struct {
	ResId string
	Url   string
}

type DeleteFriendEvent

type DeleteFriendEvent struct {
	Uin      int64
	Nickname string
}

type DeviceInfo

type DeviceInfo = auth.Device

func GenRandomDevice

func GenRandomDevice() *DeviceInfo

type EventHandle

type EventHandle[T any] struct {
	// contains filtered or unexported fields
}

func (*EventHandle[T]) Subscribe

func (handle *EventHandle[T]) Subscribe(handler func(client *QQClient, event T))

type FetchGuildMemberListWithRoleResult

type FetchGuildMemberListWithRoleResult struct {
	Members        []*GuildMemberInfo
	NextIndex      uint32
	NextRoleId     uint64
	NextQueryParam string
	Finished       bool
}

type ForwardMessageBuilder

type ForwardMessageBuilder struct {
	// contains filtered or unexported fields
}
func (builder *ForwardMessageBuilder) Link(reloc *message.ForwardElement, fmsg *message.ForwardMessage)

Link 将真实的消息内容填充 reloc

func (*ForwardMessageBuilder) Main

Main 最外层的转发消息, 调用该方法后即上传消息

func (*ForwardMessageBuilder) NestedNode

func (builder *ForwardMessageBuilder) NestedNode() *message.ForwardElement

NestedNode 返回一个嵌套转发节点,其内容将会被 Builder 重定位

type FriendInfo

type FriendInfo struct {
	Uin      int64
	Nickname string
	Remark   string
	FaceId   int16
}

type FriendListResponse

type FriendListResponse struct {
	TotalCount int32
	List       []*FriendInfo
}

type FriendMessageRecalledEvent

type FriendMessageRecalledEvent struct {
	FriendUin int64
	MessageId int32
	Time      int64
}

type FriendPokeNotifyEvent

type FriendPokeNotifyEvent struct {
	Sender   int64
	Receiver int64
}

FriendPokeNotifyEvent 好友戳一戳提示事件

func (*FriendPokeNotifyEvent) Content

func (e *FriendPokeNotifyEvent) Content() string

func (*FriendPokeNotifyEvent) From

func (e *FriendPokeNotifyEvent) From() int64

type GroupDigest

type GroupDigest struct {
	GroupCode         int64  `json:"group_code,string"`
	MessageID         uint32 `json:"msg_seq"`
	InternalMessageID uint32 `json:"msg_random"`
	SenderUin         int64  `json:"sender_uin,string"`
	SenderNick        string `json:"sender_nick"`
	SenderTime        int64  `json:"sender_time"`
	AddDigestUin      int64  `json:"add_digest_uin,string"`
	AddDigestNick     string `json:"add_digest_nick"`
	AddDigestTime     int64  `json:"add_digest_time"`
}

GroupDigest 群精华消息

type GroupDigestEvent

type GroupDigestEvent struct {
	GroupCode         int64
	MessageID         int32
	InternalMessageID int32
	OperationType     int32 // 1 -> 设置精华消息, 2 -> 移除精华消息
	OperateTime       uint32
	SenderUin         int64
	OperatorUin       int64
	SenderNick        string
	OperatorNick      string
}

GroupDigestEvent 群精华消息 不知道tx为什么搞两种名字

type GroupDisbandEvent

type GroupDisbandEvent struct {
	Group    *GroupInfo
	Time     int64
	Operator *GroupMemberInfo
}

type GroupFile

type GroupFile struct {
	GroupCode     int64  `json:"group_id"`
	FileId        string `json:"file_id"`
	FileName      string `json:"file_name"`
	BusId         int32  `json:"busid"`
	FileSize      int64  `json:"file_size"`
	UploadTime    int64  `json:"upload_time"`
	DeadTime      int64  `json:"dead_time"`
	ModifyTime    int64  `json:"modify_time"`
	DownloadTimes int64  `json:"download_times"`
	Uploader      int64  `json:"uploader"`
	UploaderName  string `json:"uploader_name"`
}

type GroupFileSystem

type GroupFileSystem struct {
	FileCount  uint32 `json:"file_count"`
	LimitCount uint32 `json:"limit_count"`
	UsedSpace  uint64 `json:"used_space"`
	TotalSpace uint64 `json:"total_space"`
	GroupCode  int64  `json:"group_id"`
	// contains filtered or unexported fields
}

func (*GroupFileSystem) CreateFolder

func (fs *GroupFileSystem) CreateFolder(parentFolder, name string) error

func (*GroupFileSystem) DeleteFile

func (fs *GroupFileSystem) DeleteFile(parentFolderID, fileId string, busId int32) string

DeleteFile 删除群文件,需要管理权限. 返回错误, 空为删除成功

func (*GroupFileSystem) DeleteFolder

func (fs *GroupFileSystem) DeleteFolder(folderId string) error

func (*GroupFileSystem) GetDownloadUrl

func (fs *GroupFileSystem) GetDownloadUrl(file *GroupFile) string

func (*GroupFileSystem) GetFilesByFolder

func (fs *GroupFileSystem) GetFilesByFolder(folderID string) ([]*GroupFile, []*GroupFolder, error)

func (*GroupFileSystem) MoveFile

func (fs *GroupFileSystem) MoveFile(parentFolderID, fileId string, busId int32, DestFolderId string) string

MoveFile 移动群文件,需要管理权限或者是自己发的文件. 返回错误, 空为移动成功

func (*GroupFileSystem) RenameFile

func (fs *GroupFileSystem) RenameFile(parentFolderID, fileId string, busId int32, newFileName string) string

RenameFile 重命名群文件,需要管理权限或者是自己发的文件. 返回错误, 空为重命名成功

func (*GroupFileSystem) RenameFolder

func (fs *GroupFileSystem) RenameFolder(folderId, newName string) error

func (*GroupFileSystem) Root

func (fs *GroupFileSystem) Root() ([]*GroupFile, []*GroupFolder, error)

func (*GroupFileSystem) UploadFile

func (fs *GroupFileSystem) UploadFile(p, name, folderId string) error

type GroupFolder

type GroupFolder struct {
	GroupCode      int64  `json:"group_id"`
	FolderId       string `json:"folder_id"`
	FolderName     string `json:"folder_name"`
	CreateTime     int64  `json:"create_time"`
	Creator        int64  `json:"creator"`
	CreatorName    string `json:"creator_name"`
	TotalFileCount uint32 `json:"total_file_count"`
}

type GroupHonorInfo

type GroupHonorInfo struct {
	GroupCode        string            `json:"gc"`
	Uin              string            `json:"uin"`
	Type             HonorType         `json:"type"`
	TalkativeList    []HonorMemberInfo `json:"talkativeList"`
	CurrentTalkative CurrentTalkative  `json:"currentTalkative"`
	ActorList        []HonorMemberInfo `json:"actorList"`
	LegendList       []HonorMemberInfo `json:"legendList"`
	StrongNewbieList []HonorMemberInfo `json:"strongnewbieList"`
	EmotionList      []HonorMemberInfo `json:"emotionList"`
}

type GroupInfo

type GroupInfo struct {
	Uin             int64
	Code            int64
	Name            string
	OwnerUin        int64
	GroupCreateTime uint32
	GroupLevel      uint32
	MemberCount     uint16
	MaxMemberCount  uint16
	Members         []*GroupMemberInfo
	// 最后一条信息的SEQ,只有通过 GetGroupInfo 函数获取的 GroupInfo 才会有
	LastMsgSeq int64
	// contains filtered or unexported fields
}

func (*GroupInfo) AdministratorOrOwner

func (g *GroupInfo) AdministratorOrOwner() bool

func (*GroupInfo) FindMember

func (g *GroupInfo) FindMember(uin int64) *GroupMemberInfo

func (*GroupInfo) FindMemberWithoutLock

func (g *GroupInfo) FindMemberWithoutLock(uin int64) *GroupMemberInfo

func (*GroupInfo) MuteAll

func (g *GroupInfo) MuteAll(mute bool)

func (*GroupInfo) MuteAnonymous

func (g *GroupInfo) MuteAnonymous(id, nick string, seconds int32) error

func (*GroupInfo) Quit

func (g *GroupInfo) Quit()

func (*GroupInfo) Read

func (g *GroupInfo) Read(f func(*GroupInfo) any) any

func (*GroupInfo) SelfPermission

func (g *GroupInfo) SelfPermission() MemberPermission

func (*GroupInfo) SetAnonymous

func (g *GroupInfo) SetAnonymous(enable bool)

func (*GroupInfo) Update

func (g *GroupInfo) Update(f func(*GroupInfo))

func (*GroupInfo) UpdateGroupHeadPortrait

func (g *GroupInfo) UpdateGroupHeadPortrait(img []byte)

func (*GroupInfo) UpdateName

func (g *GroupInfo) UpdateName(newName string)

type GroupInvitedRequest

type GroupInvitedRequest struct {
	RequestId   int64  `json:"request_id"`
	InvitorUin  int64  `json:"invitor_uin"`
	InvitorNick string `json:"invitor_nick"`
	GroupCode   int64  `json:"group_id"`
	GroupName   string `json:"group_name"`

	Checked bool  `json:"checked"`
	Actor   int64 `json:"actor"`
	// contains filtered or unexported fields
}

func (*GroupInvitedRequest) Accept

func (r *GroupInvitedRequest) Accept()

func (*GroupInvitedRequest) Reject

func (r *GroupInvitedRequest) Reject(block bool, reason string)

type GroupLeaveEvent

type GroupLeaveEvent struct {
	Group    *GroupInfo
	Operator *GroupMemberInfo
}

type GroupMemberInfo

type GroupMemberInfo struct {
	Group           *GroupInfo
	Uin             int64
	Nickname        string
	CardName        string
	JoinTime        int64
	LastSpeakTime   int64
	SpecialTitle    string
	ShutUpTimestamp int64
	Permission      MemberPermission
	Level           uint16
	Gender          byte
}

func (*GroupMemberInfo) CardChangable

func (m *GroupMemberInfo) CardChangable() bool

func (*GroupMemberInfo) DisplayName

func (m *GroupMemberInfo) DisplayName() string

func (*GroupMemberInfo) EditCard

func (m *GroupMemberInfo) EditCard(card string)

func (*GroupMemberInfo) EditSpecialTitle

func (m *GroupMemberInfo) EditSpecialTitle(title string)

func (*GroupMemberInfo) Kick

func (m *GroupMemberInfo) Kick(msg string, block bool) error

func (*GroupMemberInfo) Manageable

func (m *GroupMemberInfo) Manageable() bool

func (*GroupMemberInfo) Mute

func (m *GroupMemberInfo) Mute(time uint32) error

func (*GroupMemberInfo) Poke

func (m *GroupMemberInfo) Poke()

func (*GroupMemberInfo) SetAdmin

func (m *GroupMemberInfo) SetAdmin(flag bool)

type GroupMessageRecalledEvent

type GroupMessageRecalledEvent struct {
	GroupCode   int64
	OperatorUin int64
	AuthorUin   int64
	MessageId   int32
	Time        int32
}

type GroupMuteEvent

type GroupMuteEvent struct {
	GroupCode   int64
	OperatorUin int64
	TargetUin   int64
	Time        int32
}

type GroupNameUpdatedEvent

type GroupNameUpdatedEvent struct {
	Group       *GroupInfo
	OldName     string
	NewName     string
	OperatorUin int64
}

type GroupNoticeFeed

type GroupNoticeFeed struct {
	NoticeId    string `json:"fid"`
	SenderId    uint32 `json:"u"`
	PublishTime uint64 `json:"pubt"`
	Message     struct {
		Text   string        `json:"text"`
		Images []noticeImage `json:"pics"`
	} `json:"msg"`
}

type GroupNoticeImage

type GroupNoticeImage struct {
	Height string `json:"height"`
	Width  string `json:"width"`
	ID     string `json:"id"`
}

type GroupNoticeMessage

type GroupNoticeMessage struct {
	NoticeId    string `json:"notice_id"`
	SenderId    uint32 `json:"sender_id"`
	PublishTime uint64 `json:"publish_time"`
	Message     struct {
		Text   string             `json:"text"`
		Images []GroupNoticeImage `json:"images"`
	} `json:"message"`
}

type GroupPokeNotifyEvent

type GroupPokeNotifyEvent struct {
	GroupCode int64
	Sender    int64
	Receiver  int64
}

GroupPokeNotifyEvent 群内戳一戳提示事件

func (*GroupPokeNotifyEvent) Content

func (e *GroupPokeNotifyEvent) Content() string

func (*GroupPokeNotifyEvent) From

func (e *GroupPokeNotifyEvent) From() int64

type GroupRedBagLuckyKingNotifyEvent

type GroupRedBagLuckyKingNotifyEvent struct {
	GroupCode int64
	Sender    int64
	LuckyKing int64
}

GroupRedBagLuckyKingNotifyEvent 群内抢红包运气王提示事件

func (*GroupRedBagLuckyKingNotifyEvent) Content

func (*GroupRedBagLuckyKingNotifyEvent) From

type GroupSearchInfo

type GroupSearchInfo struct {
	Code int64  // 群号
	Name string // 群名
	Memo string // 简介
}

GroupSearchInfo 通过搜索得到的群信息

type GroupSessionInfo

type GroupSessionInfo struct {
	GroupCode      int64
	UnreadCount    uint32
	LatestMessages []*message.GroupMessage
}

GroupSessionInfo 群会话信息

type GroupSystemMessages

type GroupSystemMessages struct {
	InvitedRequests []*GroupInvitedRequest  `json:"invited_requests"`
	JoinRequests    []*UserJoinGroupRequest `json:"join_requests"`
}

type GuildChannelOperationEvent

type GuildChannelOperationEvent struct {
	OperatorId  uint64
	GuildId     uint64
	ChannelInfo *ChannelInfo
}

type GuildChannelUpdatedEvent

type GuildChannelUpdatedEvent struct {
	OperatorId     uint64
	GuildId        uint64
	ChannelId      uint64
	OldChannelInfo *ChannelInfo
	NewChannelInfo *ChannelInfo
}

type GuildInfo

type GuildInfo struct {
	GuildId   uint64
	GuildCode uint64
	GuildName string
	CoverUrl  string
	AvatarUrl string
	Channels  []*ChannelInfo
}

GuildInfo 频道信息

func (*GuildInfo) FindChannel

func (g *GuildInfo) FindChannel(channelId uint64) *ChannelInfo

type GuildMemberInfo

type GuildMemberInfo struct {
	TinyId        uint64
	Title         string
	Nickname      string
	LastSpeakTime int64
	Role          uint64
	RoleName      string
}

GuildMemberInfo 频道成员信息, 仅通过频道成员列表API获取

type GuildMessageReactionsUpdatedEvent

type GuildMessageReactionsUpdatedEvent struct {
	OperatorId uint64 // OperatorId 操作者TinyId, 删除贴表情的事件下不会有值
	EmojiId    int32  // EmojiId 被贴的表情, 只有自身消息被贴表情才会有值
	GuildId    uint64
	ChannelId  uint64
	MessageId  uint64
	// MessageSenderUin int64 // MessageSenderUin 被贴表情的消息发送者QQ号
	CurrentReactions []*message.GuildMessageEmojiReaction
}

type GuildMessageRecalledEvent

type GuildMessageRecalledEvent struct {
	OperatorId uint64
	GuildId    uint64
	ChannelId  uint64
	MessageId  uint64
	RecallTime int64
}

type GuildMeta

type GuildMeta struct {
	GuildId        uint64
	GuildName      string
	GuildProfile   string
	MaxMemberCount int64
	MemberCount    int64
	CreateTime     int64
	MaxRobotCount  int32
	MaxAdminCount  int32
	OwnerId        uint64
}

GuildMeta 频道数据

type GuildRole

type GuildRole struct {
	RoleId      uint64
	RoleName    string
	ArgbColor   uint32
	Independent bool
	Num         int32
	Owned       bool
	Disabled    bool
	MaxNum      int32
}

GuildRole 频道身份组信息

type GuildService

type GuildService struct {
	TinyId     uint64
	Nickname   string
	AvatarUrl  string
	GuildCount uint32
	// Guilds 由服务器推送的频道列表
	Guilds []*GuildInfo
	// contains filtered or unexported fields
}

GuildService 频道模块内自身的信息

func (*GuildService) CreateGuildRole

func (s *GuildService) CreateGuildRole(guildId uint64, name string, color uint32, independent bool, initialUsers []uint64) (uint64, error)

func (*GuildService) DeleteGuildRole

func (s *GuildService) DeleteGuildRole(guildId uint64, roleId uint64) error

func (*GuildService) FetchChannelInfo

func (s *GuildService) FetchChannelInfo(guildId, channelId uint64) (*ChannelInfo, error)

func (*GuildService) FetchChannelList

func (s *GuildService) FetchChannelList(guildId uint64) (r []*ChannelInfo, e error)

func (*GuildService) FetchGuestGuild

func (s *GuildService) FetchGuestGuild(guildId uint64) (*GuildMeta, error)

func (*GuildService) FetchGuildMemberListWithRole

func (s *GuildService) FetchGuildMemberListWithRole(guildId, channelId uint64, startIndex uint32, roleIdIndex uint64, param string) (*FetchGuildMemberListWithRoleResult, error)

FetchGuildMemberListWithRole 获取频道成员列表 第一次请求: startIndex = 0 , roleIdIndex = 2 param = "" 后续请求请根据上次请求的返回值进行设置

func (*GuildService) FetchGuildMemberProfileInfo

func (s *GuildService) FetchGuildMemberProfileInfo(guildId, tinyId uint64) (*GuildUserProfile, error)

FetchGuildMemberProfileInfo 获取单个频道成员资料

func (*GuildService) FindGuild

func (s *GuildService) FindGuild(guildId uint64) *GuildInfo

func (*GuildService) GetGuildRoles

func (s *GuildService) GetGuildRoles(guildId uint64) ([]*GuildRole, error)

func (*GuildService) GetTopicChannelFeeds

func (s *GuildService) GetTopicChannelFeeds(guildId, channelId uint64) ([]*topic.Feed, error)

func (*GuildService) GetUserProfile

func (s *GuildService) GetUserProfile(tinyId uint64) (*GuildUserProfile, error)

func (*GuildService) ModifyRoleInGuild

func (s *GuildService) ModifyRoleInGuild(guildId uint64, roleId uint64, name string, color uint32, indepedent bool) error

func (*GuildService) OnGuildChannelCreated

func (s *GuildService) OnGuildChannelCreated(f func(*QQClient, *GuildChannelOperationEvent))

func (*GuildService) OnGuildChannelDestroyed

func (s *GuildService) OnGuildChannelDestroyed(f func(*QQClient, *GuildChannelOperationEvent))

func (*GuildService) OnGuildChannelMessage

func (s *GuildService) OnGuildChannelMessage(f func(*QQClient, *message.GuildChannelMessage))

func (*GuildService) OnGuildChannelUpdated

func (s *GuildService) OnGuildChannelUpdated(f func(*QQClient, *GuildChannelUpdatedEvent))

func (*GuildService) OnGuildMessageReactionsUpdated

func (s *GuildService) OnGuildMessageReactionsUpdated(f func(*QQClient, *GuildMessageReactionsUpdatedEvent))

func (*GuildService) OnGuildMessageRecalled

func (s *GuildService) OnGuildMessageRecalled(f func(*QQClient, *GuildMessageRecalledEvent))

func (*GuildService) OnMemberJoinedGuild

func (s *GuildService) OnMemberJoinedGuild(f func(*QQClient, *MemberJoinGuildEvent))

func (*GuildService) PostTopicChannelFeed

func (s *GuildService) PostTopicChannelFeed(guildId, channelId uint64, feed *topic.Feed) error

func (*GuildService) PullGuildChannelMessage

func (s *GuildService) PullGuildChannelMessage(guildId, channelId, beginSeq, endSeq uint64) (r []*message.GuildChannelMessage, e error)

func (*GuildService) QueryImage

func (s *GuildService) QueryImage(guildId, channelId uint64, hash []byte, size uint64) (*message.GuildImageElement, error)

func (*GuildService) SendGuildChannelMessage

func (s *GuildService) SendGuildChannelMessage(guildId, channelId uint64, m *message.SendingMessage) (*message.GuildChannelMessage, error)

func (*GuildService) SetUserRoleInGuild

func (s *GuildService) SetUserRoleInGuild(guildId uint64, set bool, roleId uint64, user []uint64) error

func (*GuildService) UploadGuildImage deprecated

func (s *GuildService) UploadGuildImage(guildId, channelId uint64, img io.ReadSeeker) (*message.GuildImageElement, error)

Deprecated: use QQClient.UploadImage instead

type GuildUserProfile

type GuildUserProfile struct {
	TinyId    uint64
	Nickname  string
	AvatarUrl string
	JoinTime  int64 // 只有 GetGuildMemberProfileInfo 函数才会有
	Roles     []*GuildRole
}

GuildUserProfile 频道系统用户资料

type HonorMemberInfo

type HonorMemberInfo struct {
	Uin    int64  `json:"uin"`
	Avatar string `json:"avatar"`
	Name   string `json:"name"`
	Desc   string `json:"desc"`
}

type HonorType

type HonorType int
const (
	Talkative    HonorType = 1 // 龙王
	Performer    HonorType = 2 // 群聊之火
	Legend       HonorType = 3 // 群聊炙焰
	StrongNewbie HonorType = 5 // 冒尖小春笋
	Emotion      HonorType = 6 // 快乐源泉
)

type INotifyEvent

type INotifyEvent interface {
	From() int64
	Content() string
}

type LocalFile

type LocalFile struct {
	FileName     string
	Body         io.ReadSeeker // LocalFile content body
	RemoteFolder string
	// contains filtered or unexported fields
}

type Logger

type Logger interface {
	Info(format string, args ...any)
	Warning(format string, args ...any)
	Error(format string, args ...any)
	Debug(format string, args ...any)
	Dump(dumped []byte, format string, args ...any)
}

type LoginError

type LoginError int

func (LoginError) String

func (i LoginError) String() string

type LoginResponse

type LoginResponse struct {
	Success bool
	Code    byte
	Error   LoginError

	// Captcha info
	CaptchaImage []byte
	CaptchaSign  []byte

	// Unsafe device
	VerifyUrl string

	// SMS needed
	SMSPhone string

	// other error
	ErrorMessage string
}

type MemberCardUpdatedEvent

type MemberCardUpdatedEvent struct {
	Group   *GroupInfo
	OldCard string
	Member  *GroupMemberInfo
}

type MemberHonorChangedNotifyEvent

type MemberHonorChangedNotifyEvent struct {
	GroupCode int64
	Honor     HonorType
	Uin       int64
	Nick      string
}

MemberHonorChangedNotifyEvent 群成员荣誉变更提示事件

func (*MemberHonorChangedNotifyEvent) Content

func (*MemberHonorChangedNotifyEvent) From

type MemberJoinGroupEvent

type MemberJoinGroupEvent struct {
	Group  *GroupInfo
	Member *GroupMemberInfo
}

type MemberJoinGuildEvent

type MemberJoinGuildEvent struct {
	Guild  *GuildInfo
	Member *GuildMemberInfo
}

type MemberLeaveGroupEvent

type MemberLeaveGroupEvent struct {
	Group    *GroupInfo
	Member   *GroupMemberInfo
	Operator *GroupMemberInfo
}

type MemberPermission

type MemberPermission int

type MemberPermissionChangedEvent

type MemberPermissionChangedEvent struct {
	Group         *GroupInfo
	Member        *GroupMemberInfo
	OldPermission MemberPermission
	NewPermission MemberPermission
}

type MemberSpecialTitleUpdatedEvent

type MemberSpecialTitleUpdatedEvent struct {
	GroupCode int64
	Uin       int64
	NewTitle  string
}

MemberSpecialTitleUpdatedEvent 群成员头衔更新事件

type ModelGet

type ModelGet struct {
	Req ModelReq `json:"13030"`
}

type ModelReq

type ModelReq struct {
	Req ModelReqData `json:"req"`
}

type ModelReqData

type ModelReqData struct {
	Uin            int64  `json:"lUin"`
	Model          string `json:"sModel"`
	AppType        int32  `json:"iAppType"`
	IMei           string `json:"sIMei"`
	ShowInfo       bool   `json:"bShowInfo"`
	ModelShow      string `json:"sModelShow"`
	RecoverDefault bool   `json:"bRecoverDefault"`
}

type ModelSet

type ModelSet struct {
	Req ModelReq `json:"13031"`
}

type ModelVariant

type ModelVariant struct {
	NeedPay   bool
	ModelShow string
}

type NewFriendEvent

type NewFriendEvent struct {
	Friend *FriendInfo
}

type NewFriendRequest

type NewFriendRequest struct {
	RequestId     int64
	Message       string
	RequesterUin  int64
	RequesterNick string
	// contains filtered or unexported fields
}

func (*NewFriendRequest) Accept

func (r *NewFriendRequest) Accept()

func (*NewFriendRequest) Reject

func (r *NewFriendRequest) Reject()

type OcrResponse

type OcrResponse struct {
	Texts    []*TextDetection `json:"texts"`
	Language string           `json:"language"`
}

type OfflineFileEvent

type OfflineFileEvent struct {
	FileName    string
	FileSize    int64
	Sender      int64
	DownloadUrl string
}

type OtherClientInfo

type OtherClientInfo struct {
	AppId      int64
	DeviceName string
	DeviceKind string
}

type OtherClientStatusChangedEvent

type OtherClientStatusChangedEvent struct {
	Client *OtherClientInfo
	Online bool
}

type ProfileDetailUpdate

type ProfileDetailUpdate map[uint16][]byte

func NewProfileDetailUpdate

func NewProfileDetailUpdate() ProfileDetailUpdate

func (ProfileDetailUpdate) College

func (ProfileDetailUpdate) Company

func (ProfileDetailUpdate) Email

func (ProfileDetailUpdate) Nick

func (ProfileDetailUpdate) PersonalNote

func (p ProfileDetailUpdate) PersonalNote(value string) ProfileDetailUpdate

type QQClient

type QQClient struct {
	Uin         int64
	PasswordMd5 [16]byte

	// option
	AllowSlider        bool
	UseFragmentMessage bool

	// account info
	Online        atomic.Bool
	Nickname      string
	Age           uint16
	Gender        uint16
	FriendList    []*FriendInfo
	GroupList     []*GroupInfo
	OnlineClients []*OtherClientInfo
	QiDian        *QiDianAccountInfo
	GuildService  *GuildService

	// protocol public field
	SequenceId  atomic.Int32
	SessionId   []byte
	TCP         *network.TCPClient // todo: combine other protocol state into one struct
	ConnectTime time.Time

	PrivateMessageEvent               EventHandle[*message.PrivateMessage]
	TempMessageEvent                  EventHandle[*TempMessageEvent]
	GroupMessageEvent                 EventHandle[*message.GroupMessage]
	SelfPrivateMessageEvent           EventHandle[*message.PrivateMessage]
	SelfGroupMessageEvent             EventHandle[*message.GroupMessage]
	GroupMuteEvent                    EventHandle[*GroupMuteEvent]
	GroupMessageRecalledEvent         EventHandle[*GroupMessageRecalledEvent]
	FriendMessageRecalledEvent        EventHandle[*FriendMessageRecalledEvent]
	GroupJoinEvent                    EventHandle[*GroupInfo]
	GroupLeaveEvent                   EventHandle[*GroupLeaveEvent]
	GroupMemberJoinEvent              EventHandle[*MemberJoinGroupEvent]
	GroupMemberLeaveEvent             EventHandle[*MemberLeaveGroupEvent]
	MemberCardUpdatedEvent            EventHandle[*MemberCardUpdatedEvent]
	GroupNameUpdatedEvent             EventHandle[*GroupNameUpdatedEvent]
	GroupMemberPermissionChangedEvent EventHandle[*MemberPermissionChangedEvent]
	GroupInvitedEvent                 EventHandle[*GroupInvitedRequest]
	UserWantJoinGroupEvent            EventHandle[*UserJoinGroupRequest]
	NewFriendEvent                    EventHandle[*NewFriendEvent]
	NewFriendRequestEvent             EventHandle[*NewFriendRequest]
	DisconnectedEvent                 EventHandle[*ClientDisconnectedEvent]
	GroupNotifyEvent                  EventHandle[INotifyEvent]
	FriendNotifyEvent                 EventHandle[INotifyEvent]
	MemberSpecialTitleUpdatedEvent    EventHandle[*MemberSpecialTitleUpdatedEvent]
	GroupDigestEvent                  EventHandle[*GroupDigestEvent]
	OtherClientStatusChangedEvent     EventHandle[*OtherClientStatusChangedEvent]
	OfflineFileEvent                  EventHandle[*OfflineFileEvent]
	GroupDisbandEvent                 EventHandle[*GroupDisbandEvent]
	DeleteFriendEvent                 EventHandle[*DeleteFriendEvent]
	// contains filtered or unexported fields
}

func NewClient

func NewClient(uin int64, password string) *QQClient

NewClient create new qq client

func NewClientEmpty

func NewClientEmpty() *QQClient

func NewClientMd5

func NewClientMd5(uin int64, passwordMd5 [16]byte) *QQClient

func (*QQClient) AddGroupNoticeSimple

func (c *QQClient) AddGroupNoticeSimple(groupCode int64, text string) (noticeId string, err error)

AddGroupNoticeSimple 发群公告

func (*QQClient) AddGroupNoticeWithPic

func (c *QQClient) AddGroupNoticeWithPic(groupCode int64, text string, pic []byte) (noticeId string, err error)

AddGroupNoticeWithPic 发群公告带图片

func (*QQClient) CheckUrlSafely

func (c *QQClient) CheckUrlSafely(url string) UrlSecurityLevel

CheckUrlSafely 通过TX服务器检查URL安全性

func (*QQClient) ConnectionQualityTest

func (c *QQClient) ConnectionQualityTest() *ConnectionQualityInfo

func (*QQClient) DelGroupNotice

func (c *QQClient) DelGroupNotice(groupCode int64, fid string) error

func (*QQClient) DeleteEssenceMessage

func (c *QQClient) DeleteEssenceMessage(groupCode int64, msgID, msgInternalId int32) error

DeleteEssenceMessage 移出群精华消息

func (*QQClient) DeleteFriend

func (c *QQClient) DeleteFriend(uin int64) error

func (*QQClient) DeleteUnidirectionalFriend

func (c *QQClient) DeleteUnidirectionalFriend(uin int64) error

func (*QQClient) Device

func (c *QQClient) Device() *DeviceInfo

func (*QQClient) Disconnect

func (c *QQClient) Disconnect()

Disconnect 中断连接, 不释放资源

func (*QQClient) DownloadForwardMessage

func (c *QQClient) DownloadForwardMessage(resId string) *message.ForwardElement

func (*QQClient) FetchQRCode

func (c *QQClient) FetchQRCode() (*QRCodeLoginResponse, error)

func (*QQClient) FetchQRCodeCustomSize

func (c *QQClient) FetchQRCodeCustomSize(size, margin, ecLevel uint32) (*QRCodeLoginResponse, error)

func (*QQClient) FindFriend

func (c *QQClient) FindFriend(uin int64) *FriendInfo

func (*QQClient) FindGroup

func (c *QQClient) FindGroup(code int64) *GroupInfo

func (*QQClient) FindGroupByUin

func (c *QQClient) FindGroupByUin(uin int64) *GroupInfo

func (*QQClient) GenToken

func (c *QQClient) GenToken() []byte

func (*QQClient) GetAllowedClients

func (c *QQClient) GetAllowedClients() ([]*OtherClientInfo, error)

GetAllowedClients 获取已允许的其他客户端

func (*QQClient) GetAtAllRemain

func (c *QQClient) GetAtAllRemain(groupCode int64) (*AtAllRemainInfo, error)

func (*QQClient) GetCustomFaces

func (c *QQClient) GetCustomFaces() ([]*CustomFace, error)

func (*QQClient) GetForwardMessage

func (c *QQClient) GetForwardMessage(resID string) *message.ForwardMessage

func (*QQClient) GetFriendList

func (c *QQClient) GetFriendList() (*FriendListResponse, error)

GetFriendList 当使用普通QQ时: 请求好友列表 当使用企点QQ时: 请求外部联系人列表

func (*QQClient) GetGroupEssenceMsgList

func (c *QQClient) GetGroupEssenceMsgList(groupCode int64) ([]GroupDigest, error)

GetGroupEssenceMsgList 获取群精华消息列表

func (*QQClient) GetGroupFileSystem

func (c *QQClient) GetGroupFileSystem(groupCode int64) (fs *GroupFileSystem, err error)

func (*QQClient) GetGroupFileUrl

func (c *QQClient) GetGroupFileUrl(groupCode int64, fileId string, busId int32) string

func (*QQClient) GetGroupHonorInfo

func (c *QQClient) GetGroupHonorInfo(groupCode int64, honorType HonorType) (*GroupHonorInfo, error)

func (*QQClient) GetGroupImageDownloadUrl

func (c *QQClient) GetGroupImageDownloadUrl(fileId, groupCode int64, fileMd5 []byte) (string, error)

func (*QQClient) GetGroupInfo

func (c *QQClient) GetGroupInfo(groupCode int64) (*GroupInfo, error)

func (*QQClient) GetGroupList

func (c *QQClient) GetGroupList() ([]*GroupInfo, error)

func (*QQClient) GetGroupMembers

func (c *QQClient) GetGroupMembers(group *GroupInfo) ([]*GroupMemberInfo, error)

func (*QQClient) GetGroupMessages

func (c *QQClient) GetGroupMessages(groupCode, beginSeq, endSeq int64) ([]*message.GroupMessage, error)

GetGroupMessages 从服务器获取历史信息

func (*QQClient) GetGroupNotice

func (c *QQClient) GetGroupNotice(groupCode int64) (l []*GroupNoticeMessage, err error)

func (*QQClient) GetGroupSystemMessages

func (c *QQClient) GetGroupSystemMessages() (*GroupSystemMessages, error)

func (*QQClient) GetMemberInfo

func (c *QQClient) GetMemberInfo(groupCode, memberUin int64) (*GroupMemberInfo, error)

func (*QQClient) GetModelShow

func (c *QQClient) GetModelShow(modelName string) ([]*ModelVariant, error)

func (*QQClient) GetShortVideoUrl

func (c *QQClient) GetShortVideoUrl(uuid, md5 []byte) string

func (*QQClient) GetStatistics

func (c *QQClient) GetStatistics() *Statistics

func (*QQClient) GetSummaryInfo

func (c *QQClient) GetSummaryInfo(target int64) (*SummaryCardInfo, error)

func (*QQClient) GetTts

func (c *QQClient) GetTts(text string) ([]byte, error)

func (*QQClient) GetUnidirectionalFriendList

func (c *QQClient) GetUnidirectionalFriendList() (ret []*UnidirectionalFriendInfo, err error)

func (*QQClient) GetWordSegmentation

func (c *QQClient) GetWordSegmentation(text string) ([]string, error)

func (*QQClient) ImageOcr

func (c *QQClient) ImageOcr(img any) (*OcrResponse, error)

func (*QQClient) KickGroupMembers

func (c *QQClient) KickGroupMembers(groupCode int64, msg string, block bool, memberUins ...int64)

func (*QQClient) Login

func (c *QQClient) Login() (*LoginResponse, error)

Login send login request

func (*QQClient) MarkGroupMessageReaded

func (c *QQClient) MarkGroupMessageReaded(groupCode, seq int64)

MarkGroupMessageReaded 标记群消息已读, 适当调用应该能减少风控

func (*QQClient) MarkPrivateMessageReaded

func (c *QQClient) MarkPrivateMessageReaded(uin, time int64)

func (*QQClient) NewForwardMessageBuilder

func (c *QQClient) NewForwardMessageBuilder(groupCode int64) *ForwardMessageBuilder

func (*QQClient) OnServerUpdated

func (c *QQClient) OnServerUpdated(f func(*QQClient, *ServerUpdatedEvent) bool)

func (*QQClient) QRCodeLogin

func (c *QQClient) QRCodeLogin(info *QRCodeLoginInfo) (*LoginResponse, error)

func (*QQClient) QueryFriendImage

func (c *QQClient) QueryFriendImage(target int64, hash []byte, size int32) (*message.FriendImageElement, error)

func (*QQClient) QueryGroupImage

func (c *QQClient) QueryGroupImage(groupCode int64, hash []byte, size int32) (*message.GroupImageElement, error)

func (*QQClient) QueryQRCodeStatus

func (c *QQClient) QueryQRCodeStatus(sig []byte) (*QRCodeLoginResponse, error)

func (*QQClient) RecallGroupMessage

func (c *QQClient) RecallGroupMessage(groupCode int64, msgID, msgInternalId int32) error

func (*QQClient) RecallPrivateMessage

func (c *QQClient) RecallPrivateMessage(uin, ts int64, msgID, msgInternalId int32) error

func (*QQClient) RefreshStatus

func (c *QQClient) RefreshStatus() error

RefreshStatus 刷新客户端状态

func (*QQClient) Release

func (c *QQClient) Release()

func (*QQClient) ReloadFriendList

func (c *QQClient) ReloadFriendList() error

ReloadFriendList refresh QQClient.FriendList field via GetFriendList()

func (*QQClient) ReloadGroupList

func (c *QQClient) ReloadGroupList() error

func (*QQClient) RequestSMS

func (c *QQClient) RequestSMS() bool

func (*QQClient) SearchGroupByKeyword

func (c *QQClient) SearchGroupByKeyword(keyword string) ([]GroupSearchInfo, error)

SearchGroupByKeyword 通过关键词搜索陌生群组

func (*QQClient) SendFriendMusicShare

func (c *QQClient) SendFriendMusicShare(target int64, msg *message.MusicShareElement)

SendFriendMusicShare 发送好友音乐卡片

func (*QQClient) SendFriendPoke

func (c *QQClient) SendFriendPoke(target int64)

func (*QQClient) SendGroupForwardMessage

func (c *QQClient) SendGroupForwardMessage(groupCode int64, m *message.ForwardElement) *message.GroupMessage

SendGroupForwardMessage 发送群合并转发消息

func (*QQClient) SendGroupMessage

func (c *QQClient) SendGroupMessage(groupCode int64, m *message.SendingMessage) *message.GroupMessage

SendGroupMessage 发送群消息

func (*QQClient) SendGroupMusicShare

func (c *QQClient) SendGroupMusicShare(target int64, msg *message.MusicShareElement) (*message.GroupMessage, error)

SendGroupMusicShare 发送群聊音乐卡片

func (*QQClient) SendGroupPoke

func (c *QQClient) SendGroupPoke(groupCode, target int64)

func (*QQClient) SendGroupSign

func (c *QQClient) SendGroupSign(target int64)

SendGroupSign 发送群聊打卡消息

func (*QQClient) SendGroupTempMessage

func (c *QQClient) SendGroupTempMessage(groupCode, target int64, m *message.SendingMessage) *message.TempMessage

func (*QQClient) SendGuildMusicShare

func (c *QQClient) SendGuildMusicShare(guildID, channelID uint64, msg *message.MusicShareElement)

SendGuildMusicShare 发送频道音乐卡片

func (*QQClient) SendPrivateMessage

func (c *QQClient) SendPrivateMessage(target int64, m *message.SendingMessage) *message.PrivateMessage

func (*QQClient) SendSsoPacket

func (c *QQClient) SendSsoPacket(cmd string, body []byte) ([]byte, error)

SendSsoPacket 发送签名回调包给服务器并获取返回结果供提交

func (*QQClient) SetCustomServer

func (c *QQClient) SetCustomServer(servers []netip.AddrPort)

func (*QQClient) SetEssenceMessage

func (c *QQClient) SetEssenceMessage(groupCode int64, msgID, msgInternalId int32) error

SetEssenceMessage 设为群精华消息

func (*QQClient) SetLogger

func (c *QQClient) SetLogger(logger Logger)

func (*QQClient) SetModelShow

func (c *QQClient) SetModelShow(modelName string, modelShow string) error

func (*QQClient) SetOnlineStatus

func (c *QQClient) SetOnlineStatus(s UserOnlineStatus)

func (*QQClient) SolveFriendRequest

func (c *QQClient) SolveFriendRequest(req *NewFriendRequest, accept bool)

func (*QQClient) SolveGroupJoinRequest

func (c *QQClient) SolveGroupJoinRequest(i any, accept, block bool, reason string)

func (*QQClient) SubmitCaptcha

func (c *QQClient) SubmitCaptcha(result string, sign []byte) (*LoginResponse, error)

SubmitCaptcha send captcha to server

func (*QQClient) SubmitSMS

func (c *QQClient) SubmitSMS(code string) (*LoginResponse, error)

func (*QQClient) SubmitTicket

func (c *QQClient) SubmitTicket(ticket string) (*LoginResponse, error)

func (*QQClient) SubscribeEventHandler

func (c *QQClient) SubscribeEventHandler(handler any)

func (*QQClient) SyncSessions

func (c *QQClient) SyncSessions() (*SessionSyncResponse, error)

SyncSessions 同步会话列表

func (*QQClient) TokenLogin

func (c *QQClient) TokenLogin(token []byte) error

func (*QQClient) Translate

func (c *QQClient) Translate(src, dst, text string) (string, error)

func (*QQClient) UpdateProfile

func (c *QQClient) UpdateProfile(profile ProfileDetailUpdate)

UpdateProfile 修改个人资料

func (*QQClient) UploadFile

func (c *QQClient) UploadFile(target message.Source, file *LocalFile) error

func (*QQClient) UploadImage

func (c *QQClient) UploadImage(target message.Source, img io.ReadSeeker) (message.IMessageElement, error)

func (*QQClient) UploadShortVideo

func (c *QQClient) UploadShortVideo(target message.Source, video, thumb io.ReadSeeker) (*message.ShortVideoElement, error)

UploadShortVideo 将视频和封面上传到服务器, 返回 message.ShortVideoElement 可直接发送

func (*QQClient) UploadVoice

func (c *QQClient) UploadVoice(target message.Source, voice io.ReadSeeker) (*message.GroupVoiceElement, error)

UploadVoice 将语音数据使用群语音通道上传到服务器, 返回 message.GroupVoiceElement 可直接发送

func (*QQClient) UseDevice

func (c *QQClient) UseDevice(info *auth.Device)

type QRCodeLoginInfo

type QRCodeLoginInfo struct {
	// contains filtered or unexported fields
}

type QRCodeLoginResponse

type QRCodeLoginResponse struct {
	State QRCodeLoginState

	ImageData []byte
	Sig       []byte

	LoginInfo *QRCodeLoginInfo
}

type QRCodeLoginState

type QRCodeLoginState int

type QiDianAccountInfo

type QiDianAccountInfo struct {
	MasterUin  int64
	ExtName    string
	CreateTime int64
	// contains filtered or unexported fields
}

type ServerUpdatedEvent

type ServerUpdatedEvent struct {
	Servers []jce.SsoServerInfo
}

type SessionSyncResponse

type SessionSyncResponse struct {
	GroupSessions []*GroupSessionInfo
}

SessionSyncResponse 会话同步结果

type Statistics

type Statistics struct {
	PacketReceived  atomic.Uint64
	PacketSent      atomic.Uint64
	PacketLost      atomic.Uint64
	MessageReceived atomic.Uint64
	MessageSent     atomic.Uint64
	LastMessageTime atomic.Int64
	DisconnectTimes atomic.Uint32
	LostTimes       atomic.Uint32
}

func (*Statistics) MarshalJSON

func (m *Statistics) MarshalJSON() ([]byte, error)

MarshalJSON encodes the wrapped statistics into JSON.

type SummaryCardInfo

type SummaryCardInfo struct {
	Uin       int64
	Sex       byte
	Age       uint8
	Nickname  string
	Level     int32
	City      string
	Sign      string
	Mobile    string
	LoginDays int64
	Qid       string
	VipLevel  string
}

type TempMessageEvent

type TempMessageEvent struct {
	Message *message.TempMessage
	Session *TempSessionInfo
}

type TempSessionInfo

type TempSessionInfo struct {
	Source    TempSessionSource
	GroupCode int64
	Sender    int64
	// contains filtered or unexported fields
}

func (*TempSessionInfo) SendMessage

type TempSessionSource

type TempSessionSource int
const (
	GroupSource         TempSessionSource = iota // 来自群聊
	ConsultingSource                             // 来自QQ咨询
	SearchSource                                 // 来自查找
	MovieSource                                  // 来自QQ电影
	HotChatSource                                // 来自热聊
	SystemMessageSource                          // 来自验证消息
	MultiChatSource                              // 来自多人聊天
	DateSource                                   // 来自约会
	AddressBookSource                            // 来自通讯录
)

type TextDetection

type TextDetection struct {
	Text        string        `json:"text"`
	Confidence  int32         `json:"confidence"`
	Coordinates []*Coordinate `json:"coordinates"`
}

type UnidirectionalFriendInfo

type UnidirectionalFriendInfo struct {
	Uin      int64
	Nickname string
	Age      uint32
	Source   string
}

type UrlSecurityLevel

type UrlSecurityLevel int
const (
	Safe UrlSecurityLevel = iota + 1
	Unknown
	Danger
)

type UserJoinGroupRequest

type UserJoinGroupRequest struct {
	RequestId     int64  `json:"request_id"`
	Message       string `json:"message"`
	RequesterUin  int64  `json:"requester_uin"`
	RequesterNick string `json:"requester_nick"`
	GroupCode     int64  `json:"group_id"`
	GroupName     string `json:"group_name"`
	ActionUinNick string `json:"action_uin_nick"`
	ActionUin     int64  `json:"action_uin"`

	Checked    bool  `json:"checked"`
	Actor      int64 `json:"actor"`
	Suspicious bool  `json:"suspicious"`
	// contains filtered or unexported fields
}

func (*UserJoinGroupRequest) Accept

func (r *UserJoinGroupRequest) Accept()

func (*UserJoinGroupRequest) Reject

func (r *UserJoinGroupRequest) Reject(block bool, reason string)

type UserOnlineStatus

type UserOnlineStatus int

type Version

type Version = auth.OSVersion

Jump to

Keyboard shortcuts

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