client

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: AGPL-3.0 Imports: 59 Imported by: 5

Documentation

Index

Constants

View Source
const TimeLayout = "2006-01-02 15:04:05"

Variables

View Source
var (
	ErrAlreadyOnline  = errors.New("already online")
	ErrMemberNotFound = errors.New("member not found")
	ErrNotExists      = errors.New("not exists")
)

Functions

func GTK added in v0.0.19

func GTK(s string) int

Types

type ClientDisconnectedEvent

type ClientDisconnectedEvent struct {
	Message string
}

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 Cookies added in v0.0.18

type Cookies struct {
	SKey  string
	PsKey string
	// contains filtered or unexported fields
}

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 GroupAlbum added in v0.0.19

type GroupAlbum struct {
	GroupUin       uint32
	Name           string
	ID             string
	Description    string
	CoverUrl       string
	CreateNickname string
	CreateUin      uint32
	CreateTime     int64
}

type GroupAlbumElem added in v0.0.25

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

type GroupAlbumElemUserInfo added in v0.0.25

type GroupAlbumElemUserInfo struct {
	UserNickName string
	UserUin      string
}

type GroupAlbumUploadParam added in v0.0.25

type GroupAlbumUploadParam struct {
	ResourceType
	GroupUin                     uint32
	FileName, AlbumId, AlbumName string
	ImageFile
	VideoFile
}

type GroupPhoto added in v0.0.19

type GroupPhoto struct {
	ID  string
	Url string
}

type GroupVideo added in v0.0.25

type GroupVideo struct {
	ID  string
	Url string
}

type ImageFile added in v0.0.25

type ImageFile struct {
	Image io.ReadSeeker
}

type QQClient

type QQClient struct {
	Uin uint32

	Online atomic.Bool

	UA string

	TCP         network.TCPClient // todo: combine other protocol state into one struct
	ConnectTime time.Time

	// event handles
	GroupMessageEvent   EventHandle[*message.GroupMessage]
	PrivateMessageEvent EventHandle[*message.PrivateMessage]
	TempMessageEvent    EventHandle[*message.TempMessage]

	SelfGroupMessageEvent   EventHandle[*message.GroupMessage]
	SelfPrivateMessageEvent EventHandle[*message.PrivateMessage]
	SelfTempMessageEvent    EventHandle[*message.TempMessage]

	GroupJoinEvent  EventHandle[*event.GroupMemberIncrease] // bot进群
	GroupLeaveEvent EventHandle[*event.GroupMemberDecrease] // bot 退群

	GroupInvitedEvent                 EventHandle[*event.GroupInvite]            // 被邀请入群
	GroupMemberJoinRequestEvent       EventHandle[*event.GroupMemberJoinRequest] // 加群申请
	GroupMemberJoinEvent              EventHandle[*event.GroupMemberIncrease]    // 成员入群
	GroupMemberLeaveEvent             EventHandle[*event.GroupMemberDecrease]    // 成员退群
	GroupMuteEvent                    EventHandle[*event.GroupMute]
	GroupDigestEvent                  EventHandle[*event.GroupDigestEvent] // 精华消息
	GroupRecallEvent                  EventHandle[*event.GroupRecall]
	GroupMemberPermissionChangedEvent EventHandle[*event.GroupMemberPermissionChanged]
	GroupNameUpdatedEvent             EventHandle[*event.GroupNameUpdated]
	GroupReactionEvent                EventHandle[*event.GroupReactionEvent]
	MemberSpecialTitleUpdatedEvent    EventHandle[*event.MemberSpecialTitleUpdated]
	NewFriendRequestEvent             EventHandle[*event.NewFriendRequest] // 好友申请
	FriendRecallEvent                 EventHandle[*event.FriendRecall]
	RenameEvent                       EventHandle[*event.Rename]
	FriendNotifyEvent                 EventHandle[event.INotifyEvent]
	GroupNotifyEvent                  EventHandle[event.INotifyEvent]

	DisconnectedEvent EventHandle[*ClientDisconnectedEvent]
	// contains filtered or unexported fields
}

func NewClient

func NewClient(uin uint32, appInfo *auth.AppInfo, signUrl ...string) *QQClient

NewClient 创建一个新的 QQ Client

func (*QQClient) AddGroupNoticeSimple added in v0.0.26

func (c *QQClient) AddGroupNoticeSimple(groupUin uint32, text string) (noticeId string, err error)

AddGroupNoticeSimple 发群公告

func (*QQClient) AddGroupNoticeWithPic added in v0.0.26

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

AddGroupNoticeWithPic 发群公告带图片

func (*QQClient) BuildFakeMessage added in v0.0.25

func (c *QQClient) BuildFakeMessage(msgElems []*message2.ForwardNode) []*message.PushMsgBody

BuildFakeMessage make a fake message

func (*QQClient) CreateGroupFolder added in v0.0.19

func (c *QQClient) CreateGroupFolder(groupUin uint32, targetDirectory string, folderName string) error

CreateGroupFolder 创建群文件夹

func (*QQClient) DelGroupNotice added in v0.0.26

func (c *QQClient) DelGroupNotice(groupUin uint32, fid string) error

DelGroupNotice 删除群公告

func (*QQClient) DeleteGroupFile added in v0.0.19

func (c *QQClient) DeleteGroupFile(groupUin uint32, fileID string) error

DeleteGroupFile 删除群文件

func (*QQClient) DeleteGroupFolder added in v0.0.19

func (c *QQClient) DeleteGroupFolder(groupUin uint32, folderID string) error

DeleteGroupFolder 删除群文件夹

func (*QQClient) Device

func (c *QQClient) Device() *auth.DeviceInfo

func (*QQClient) Disconnect

func (c *QQClient) Disconnect()

Disconnect 中断连接, 不释放资源

func (*QQClient) FastLogin added in v0.0.11

func (c *QQClient) FastLogin(sig *auth.SigInfo) error

func (*QQClient) FetchClientKey added in v0.0.15

func (c *QQClient) FetchClientKey() (string, error)

FetchClientKey 获取ClientKey

func (*QQClient) FetchCookies added in v0.0.15

func (c *QQClient) FetchCookies(domains []string) ([]string, error)

FetchCookies 获取cookies

func (*QQClient) FetchEssenceMessage added in v0.0.26

func (c *QQClient) FetchEssenceMessage(groupUin uint32) ([]*message2.GroupEssenceMessage, error)

FetchEssenceMessage 获取精华消息

func (*QQClient) FetchForwardMsg added in v0.0.25

func (c *QQClient) FetchForwardMsg(resId string) (msg *message2.ForwardMessage, err error)

FetchForwardMsg 获取合并转发消息

func (*QQClient) FetchFriends

func (c *QQClient) FetchFriends(token uint32) ([]*entity.Friend, uint32, error)

FetchFriends 获取好友列表信息,使用token可以获取下一页的群成员信息

func (*QQClient) FetchGroupMember

func (c *QQClient) FetchGroupMember(groupUin, memberUin uint32) (*entity.GroupMember, error)

FetchGroupMember 获取对应群的群成员信息

func (*QQClient) FetchGroupMembers added in v0.0.11

func (c *QQClient) FetchGroupMembers(groupUin uint32, token string) ([]*entity.GroupMember, string, error)

FetchGroupMembers 获取对应群的所有群成员信息,使用token可以获取下一页的群成员信息

func (*QQClient) FetchGroups

func (c *QQClient) FetchGroups() ([]*entity.Group, error)

FetchGroups 获取所有已加入的群的信息

func (*QQClient) FetchQRCode added in v0.0.11

func (c *QQClient) FetchQRCode(size, margin, ecLevel uint32) ([]byte, string, error)

func (*QQClient) FetchQRCodeDefault added in v0.0.11

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

func (*QQClient) FetchRkey added in v0.0.25

func (c *QQClient) FetchRkey() (entity.RKeyMap, error)

FetchRkey 获取Rkey

func (*QQClient) FetchUserInfo added in v0.0.13

func (c *QQClient) FetchUserInfo(uid string) (*entity.Friend, error)

FetchUserInfo 获取用户信息

func (*QQClient) FetchUserInfoUin added in v0.0.15

func (c *QQClient) FetchUserInfoUin(uin uint32) (*entity.Friend, error)

FetchUserInfoUin 通过uin获取用户信息

func (*QQClient) FileUploadGroup added in v0.0.17

func (c *QQClient) FileUploadGroup(groupUin uint32, file *message.FileElement, targetDirectory string) (*message.FileElement, error)

func (*QQClient) FileUploadPrivate added in v0.0.17

func (c *QQClient) FileUploadPrivate(targetUid string, file *message.FileElement) (*message.FileElement, error)

func (*QQClient) FriendPoke

func (c *QQClient) FriendPoke(uin uint32) error

FriendPoke 戳一戳好友

func (*QQClient) GetAllGroupsInfo

func (c *QQClient) GetAllGroupsInfo() (map[uint32]*entity.Group, error)

func (*QQClient) GetAllGroupsMembersData

func (c *QQClient) GetAllGroupsMembersData() (map[uint32]map[uint32]*entity.GroupMember, error)

GetAllGroupsMembersData 获取所有群的群成员信息

func (*QQClient) GetCachedAllFriendsInfo added in v0.0.11

func (c *QQClient) GetCachedAllFriendsInfo() map[uint32]*entity.Friend

GetCachedAllFriendsInfo 获取所有好友信息(缓存)

func (*QQClient) GetCachedAllGroupsInfo

func (c *QQClient) GetCachedAllGroupsInfo() map[uint32]*entity.Group

GetCachedAllGroupsInfo 获取所有群信息(缓存)

func (*QQClient) GetCachedFriendInfo

func (c *QQClient) GetCachedFriendInfo(uin uint32) *entity.Friend

GetCachedFriendInfo 获取好友信息(缓存)

func (*QQClient) GetCachedGroupInfo

func (c *QQClient) GetCachedGroupInfo(groupUin uint32) *entity.Group

GetCachedGroupInfo 获取群信息(缓存)

func (*QQClient) GetCachedMemberInfo

func (c *QQClient) GetCachedMemberInfo(uin, groupUin uint32) *entity.GroupMember

GetCachedMemberInfo 获取群成员信息(缓存)

func (*QQClient) GetCachedMembersInfo

func (c *QQClient) GetCachedMembersInfo(groupUin uint32) map[uint32]*entity.GroupMember

GetCachedMembersInfo 获取指定群所有群成员信息(缓存)

func (*QQClient) GetCachedRkeyInfo added in v0.0.25

func (c *QQClient) GetCachedRkeyInfo(rkeyType entity.RKeyType) *entity.RKeyInfo

GetCachedRkeyInfo 获取指定类型的RKey信息(缓存)

func (*QQClient) GetCachedRkeyInfos added in v0.0.25

func (c *QQClient) GetCachedRkeyInfos() map[entity.RKeyType]*entity.RKeyInfo

GetCachedRkeyInfos 获取所有RKey信息(缓存)

func (*QQClient) GetCookies added in v0.0.15

func (c *QQClient) GetCookies(domain string) (*Cookies, error)

func (*QQClient) GetCsrfToken added in v0.0.15

func (c *QQClient) GetCsrfToken() (int, error)

func (*QQClient) GetFriendsData

func (c *QQClient) GetFriendsData() (map[uint32]*entity.Friend, error)

GetFriendsData 获取好友列表数据

func (*QQClient) GetGroupAlbum added in v0.0.19

func (c *QQClient) GetGroupAlbum(groupUin uint32) ([]*GroupAlbum, error)

func (*QQClient) GetGroupAlbumElem added in v0.0.25

func (c *QQClient) GetGroupAlbumElem(ab *GroupAlbum) ([]*GroupAlbumElem, error)

func (*QQClient) GetGroupFileSystemInfo added in v0.0.19

func (c *QQClient) GetGroupFileSystemInfo(groupUin uint32) (*entity.GroupFileSystemInfo, error)

GetGroupFileSystemInfo 获取群文件系统信息

func (*QQClient) GetGroupFileUrl added in v0.0.15

func (c *QQClient) GetGroupFileUrl(groupUin uint32, fileID string) (string, error)

func (*QQClient) GetGroupHonorInfo added in v0.0.26

func (c *QQClient) GetGroupHonorInfo(groupUin uint32, honorType entity.HonorType) (*entity.GroupHonorInfo, error)

GetGroupHonorInfo 获取群荣誉信息 reference https://github.com/Mrs4s/MiraiGo/blob/master/client/http_api.go

func (*QQClient) GetGroupImageUrl added in v0.0.15

func (c *QQClient) GetGroupImageUrl(groupUin uint32, node *oidb.IndexNode) (string, error)

GetGroupImageUrl 获取群聊图片下载url

func (*QQClient) GetGroupMembersData

func (c *QQClient) GetGroupMembersData(groupUin uint32) (map[uint32]*entity.GroupMember, error)

GetGroupMembersData 获取指定群所有成员信息

func (*QQClient) GetGroupNotice added in v0.0.26

func (c *QQClient) GetGroupNotice(groupUin uint32) (l []*entity.GroupNoticeFeed, err error)

GetGroupNotice 获取群公告

func (*QQClient) GetGroupRecordUrl added in v0.0.11

func (c *QQClient) GetGroupRecordUrl(groupUin uint32, node *oidb.IndexNode) (string, error)

GetGroupRecordUrl 获取群聊语音下载url

func (*QQClient) GetGroupSystemMessages added in v0.0.13

func (c *QQClient) GetGroupSystemMessages(isFiltered bool, count uint32, groupUin ...uint32) ([]*entity.GroupJoinRequest, error)

GetGroupSystemMessages 获取加群请求信息

func (*QQClient) GetPrivateFileUrl added in v0.0.15

func (c *QQClient) GetPrivateFileUrl(fileUUID string, fileHash string) (string, error)

func (*QQClient) GetPrivateImageUrl added in v0.0.15

func (c *QQClient) GetPrivateImageUrl(node *oidb.IndexNode) (string, error)

GetPrivateImageUrl 获取私聊图片下载url

func (*QQClient) GetPrivateRecordUrl added in v0.0.11

func (c *QQClient) GetPrivateRecordUrl(node *oidb.IndexNode) (string, error)

GetPrivateRecordUrl 获取私聊语音下载url

func (*QQClient) GetQRCodeResult

func (c *QQClient) GetQRCodeResult() (qrcodeState.State, error)

func (*QQClient) GetSkey added in v0.0.15

func (c *QQClient) GetSkey() (string, error)

func (*QQClient) GetStatistics

func (c *QQClient) GetStatistics() *Statistics

func (*QQClient) GetUid

func (c *QQClient) GetUid(uin uint32, groupUin ...uint32) string

GetUid 获取缓存中对应uin的uid

func (*QQClient) GetUin

func (c *QQClient) GetUin(uid string, groupUin ...uint32) uint32

GetUin 获取缓存中对应的uin

func (*QQClient) GetVideoUrl added in v0.0.25

func (c *QQClient) GetVideoUrl(isGroup bool, video *message2.ShortVideoElement) (string, error)

func (*QQClient) GroupKickMember

func (c *QQClient) GroupKickMember(groupUin, uin uint32, rejectAddRequest bool) error

GroupKickMember 踢出群成员,可选是否拒绝加群请求

func (*QQClient) GroupLeave

func (c *QQClient) GroupLeave(groupUin uint32) error

GroupLeave 退出群聊

func (*QQClient) GroupMuteGlobal

func (c *QQClient) GroupMuteGlobal(groupUin uint32, isMute bool) error

GroupMuteGlobal 群全员禁言

func (*QQClient) GroupMuteMember

func (c *QQClient) GroupMuteMember(groupUin, uin, duration uint32) error

GroupMuteMember 禁言群成员

func (*QQClient) GroupPoke

func (c *QQClient) GroupPoke(groupUin, uin uint32) error

GroupPoke 戳一戳群友

func (*QQClient) GroupRemark

func (c *QQClient) GroupRemark(groupUin uint32, remark string) error

GroupRemark 设置群聊备注

func (*QQClient) GroupRename

func (c *QQClient) GroupRename(groupUin uint32, name string) error

GroupRename 设置群聊名称

func (*QQClient) GroupRenameMember

func (c *QQClient) GroupRenameMember(groupUin, uin uint32, name string) error

GroupRenameMember 设置群成员昵称

func (*QQClient) GroupSetAdmin

func (c *QQClient) GroupSetAdmin(groupUin, uin uint32, isAdmin bool) error

GroupSetAdmin 设置群管理员

func (*QQClient) GroupSetReaction added in v0.0.25

func (c *QQClient) GroupSetReaction(groupUin, sequence uint32, code string, isAdd bool) error

func (*QQClient) GroupSetSpecialTitle

func (c *QQClient) GroupSetSpecialTitle(groupUin, uin uint32, title string) error

GroupSetSpecialTitle 设置群成员专属头衔

func (*QQClient) ImageUploadGroup

func (c *QQClient) ImageUploadGroup(groupUin uint32, image *message.ImageElement) (*message.ImageElement, error)

func (*QQClient) ImageUploadPrivate

func (c *QQClient) ImageUploadPrivate(targetUid string, image *message.ImageElement) (*message.ImageElement, error)

func (*QQClient) ListGroupFilesByFolder added in v0.0.19

func (c *QQClient) ListGroupFilesByFolder(groupUin uint32, targetDirectory string) ([]*entity.GroupFile, []*entity.GroupFolder, error)

ListGroupFilesByFolder 获取群目录指定文件夹列表

func (*QQClient) ListGroupRootFiles added in v0.0.19

func (c *QQClient) ListGroupRootFiles(groupUin uint32) ([]*entity.GroupFile, []*entity.GroupFolder, error)

ListGroupRootFiles 获取群根目录文件列表

func (*QQClient) Login

func (c *QQClient) Login(password, qrcodePath string) error

func (*QQClient) MoveGroupFile added in v0.0.19

func (c *QQClient) MoveGroupFile(groupUin uint32, fileID string, parentFolder string, targetFolderID string) error

MoveGroupFile 移动群文件

func (*QQClient) NickName

func (c *QQClient) NickName() string

func (*QQClient) PasswordLogin

func (c *QQClient) PasswordLogin(password string) (loginState.State, error)

func (*QQClient) PreprocessGroupMessageEvent added in v0.0.11

func (c *QQClient) PreprocessGroupMessageEvent(msg *msgConverter.GroupMessage)

func (*QQClient) PreprocessOther added in v0.0.11

func (c *QQClient) PreprocessOther(g eventConverter.CanPreprocess) error

func (*QQClient) PreprocessPrivateMessageEvent added in v0.0.11

func (c *QQClient) PreprocessPrivateMessageEvent(msg *msgConverter.PrivateMessage)

func (*QQClient) QRCodeConfirmed

func (c *QQClient) QRCodeConfirmed() error

func (*QQClient) QRCodeLogin

func (c *QQClient) QRCodeLogin(refreshInterval int) error

func (*QQClient) QueryFriendImage added in v0.0.25

func (c *QQClient) QueryFriendImage(md5 []byte, fileUUID string) (*message2.ImageElement, error)

func (*QQClient) QueryGroupImage added in v0.0.25

func (c *QQClient) QueryGroupImage(md5 []byte, fileUUID string) (*message2.ImageElement, error)

func (*QQClient) RecallFriendMessage added in v0.0.25

func (c *QQClient) RecallFriendMessage(uin, seq, random, clientSeq, timestamp uint32) error

func (*QQClient) RecallGroupMessage

func (c *QQClient) RecallGroupMessage(GrpUin, seq uint32) error

RecallGroupMessage 撤回群聊消息

func (*QQClient) RecordUploadGroup added in v0.0.11

func (c *QQClient) RecordUploadGroup(groupUin uint32, record *message.VoiceElement) (*message.VoiceElement, error)

func (*QQClient) RecordUploadPrivate added in v0.0.11

func (c *QQClient) RecordUploadPrivate(targetUid string, record *message.VoiceElement) (*message.VoiceElement, error)

func (*QQClient) RefreshAllGroupMembersCache

func (c *QQClient) RefreshAllGroupMembersCache() error

RefreshAllGroupMembersCache 刷新所有群的群成员缓存

func (*QQClient) RefreshAllGroupsInfo

func (c *QQClient) RefreshAllGroupsInfo() error

RefreshAllGroupsInfo 刷新所有群信息缓存

func (*QQClient) RefreshAllRkeyInfoCache added in v0.0.25

func (c *QQClient) RefreshAllRkeyInfoCache() error

RefreshAllRkeyInfoCache 刷新RKey缓存

func (*QQClient) RefreshFriendCache

func (c *QQClient) RefreshFriendCache() error

RefreshFriendCache 刷新好友缓存

func (*QQClient) RefreshGroupMemberCache added in v0.0.13

func (c *QQClient) RefreshGroupMemberCache(groupUin, memberUin uint32) error

RefreshGroupMemberCache 刷新一个群的指定群成员缓存

func (*QQClient) RefreshGroupMembersCache

func (c *QQClient) RefreshGroupMembersCache(groupUin uint32) error

RefreshGroupMembersCache 刷新指定群的所有群成员缓存

func (*QQClient) Register added in v0.0.11

func (c *QQClient) Register() error

func (*QQClient) Release

func (c *QQClient) Release()

func (*QQClient) RenameGroupFile added in v0.0.19

func (c *QQClient) RenameGroupFile(groupUin uint32, fileID string, parentFolder string, newFileName string) error

RenameGroupFile 重命名群文件

func (*QQClient) RenameGroupFolder added in v0.0.19

func (c *QQClient) RenameGroupFolder(groupUin uint32, folderID string, newFolderName string) error

RenameGroupFolder 重命名群文件夹

func (*QQClient) SendGroupMessage

func (c *QQClient) SendGroupMessage(groupUin uint32, elements []message2.IMessageElement, needPreprocess ...bool) (*message2.GroupMessage, error)

SendGroupMessage 发送群聊消息,默认会对消息进行预处理

func (*QQClient) SendPrivateMessage

func (c *QQClient) SendPrivateMessage(uin uint32, elements []message2.IMessageElement, needPreprocess ...bool) (*message2.PrivateMessage, error)

SendPrivateMessage 发送群聊消息,默认会对消息进行预处理

func (*QQClient) SendRawMessage

func (c *QQClient) SendRawMessage(route *message.RoutingHead, body *message.MessageBody, random uint32) (*action.SendMessageResponse, uint32, error)

func (*QQClient) SendRequestWithCookie added in v0.0.18

func (c *QQClient) SendRequestWithCookie(request *http.Request) (*http.Response, error)

func (*QQClient) SendSsoPacket

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

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

func (*QQClient) SendTempMessage

func (c *QQClient) SendTempMessage(groupUin uint32, uin uint32, elements []message2.IMessageElement) (*message2.TempMessage, error)

func (*QQClient) SessionLogin added in v0.0.6

func (c *QQClient) SessionLogin() error

func (*QQClient) SetAvatar added in v0.0.26

func (c *QQClient) SetAvatar(avatar io.ReadSeeker) error

SetAvatar 设置头像

func (*QQClient) SetEssenceMessage added in v0.0.26

func (c *QQClient) SetEssenceMessage(groupUin, seq, random uint32, isSet bool) error

func (*QQClient) SetFriendRequest added in v0.0.15

func (c *QQClient) SetFriendRequest(accept bool, targetUid string) error

SetFriendRequest 处理好友请求

func (*QQClient) SetGroupAvatar added in v0.0.26

func (c *QQClient) SetGroupAvatar(groupUin uint32, avatar io.ReadSeeker) error

func (*QQClient) SetGroupRequest added in v0.0.13

func (c *QQClient) SetGroupRequest(isFiltered bool, accept bool, sequence uint64, typ uint32, groupUin uint32, message string) error

SetGroupRequest 处理加群请求

func (*QQClient) SetLogger added in v0.0.9

func (c *QQClient) SetLogger(logger log.Logger)

func (*QQClient) SetOnlineStatus added in v0.0.26

func (c *QQClient) SetOnlineStatus(status, ext, battery uint32) error

func (*QQClient) Sig

func (c *QQClient) Sig() *auth.SigInfo

func (*QQClient) SubscribeEventHandler

func (c *QQClient) SubscribeEventHandler(handler any)

func (*QQClient) TokenLogin

func (c *QQClient) TokenLogin() (loginState.State, error)

func (*QQClient) UploadForwardMsg added in v0.0.25

func (c *QQClient) UploadForwardMsg(forward *message2.ForwardMessage, groupUin uint32) (*message2.ForwardMessage, error)

UploadForwardMsg 上传合并转发消息 groupUin should be the group number where the uploader is located or 0 (c2c)

func (*QQClient) UploadGroupAlbumPhoto added in v0.0.25

func (c *QQClient) UploadGroupAlbumPhoto(parms *GroupAlbumUploadParam) (*GroupPhoto, error)

func (*QQClient) UploadGroupAlbumVideo added in v0.0.25

func (c *QQClient) UploadGroupAlbumVideo(parms *GroupAlbumUploadParam) (*GroupVideo, error)

func (*QQClient) UploadGroupFile added in v0.0.17

func (c *QQClient) UploadGroupFile(groupUin uint32, localFilePath, filename, targetDirectory string) error

UploadGroupFile 上传群文件

func (*QQClient) UploadImage added in v0.0.25

func (c *QQClient) UploadImage(target message.Source, image *message.ImageElement) (*message.ImageElement, error)

func (*QQClient) UploadPrivateFile added in v0.0.17

func (c *QQClient) UploadPrivateFile(targetUin uint32, localFilePath, filename string) error

UploadPrivateFile 上传私聊文件

func (*QQClient) UploadRecord added in v0.0.25

func (c *QQClient) UploadRecord(target message.Source, voice *message.VoiceElement) (*message.VoiceElement, error)

func (*QQClient) UploadShortVideo added in v0.0.25

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

func (*QQClient) UseDevice

func (c *QQClient) UseDevice(d *auth.DeviceInfo)

func (*QQClient) UseSig

func (c *QQClient) UseSig(s auth.SigInfo)

func (*QQClient) VideoUploadGroup added in v0.0.25

func (c *QQClient) VideoUploadGroup(groupUin uint32, video *message.ShortVideoElement) (*message.ShortVideoElement, error)

func (*QQClient) VideoUploadPrivate added in v0.0.25

func (c *QQClient) VideoUploadPrivate(targetUid string, video *message.ShortVideoElement) (*message.ShortVideoElement, error)

type ResourceType added in v0.0.25

type ResourceType int
const (
	ResourceTypeUnknown ResourceType = iota
	ResourceTypePhoto
	ResourceTypeVideoThumbPhoto
	ResourceTypeVideo
)

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 TicketService added in v0.0.15

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

type VideoFile added in v0.0.25

type VideoFile struct {
	Thumbnail io.ReadSeeker
	Video     io.ReadSeeker
}

Jump to

Keyboard shortcuts

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