Documentation ¶
Index ¶
- Constants
- Variables
- func GTK(s string) int
- type ConnectionQualityInfo
- type Cookies
- type DisconnectedEvent
- type EventHandle
- type GroupAlbum
- type GroupAlbumElem
- type GroupAlbumElemUserInfo
- type GroupAlbumUploadParam
- type GroupPhoto
- type GroupVideo
- type ImageFile
- type LoginError
- type LoginResponse
- type NTNewDeviceQrCodeQuery
- type NTNewDeviceQrCodeRequest
- type NTNewDeviceQrCodeResponse
- type QQClient
- func (c *QQClient) AddGroupNoticeSimple(groupUin uint32, text string) (noticeID string, err error)
- func (c *QQClient) AddGroupNoticeWithPic(groupUin uint32, text string, pic []byte) (noticeID string, err error)
- func (c *QQClient) AddSignHeader(header map[string]string)
- func (c *QQClient) AddSignServer(signServers ...string)
- func (c *QQClient) BuildFakeMessage(msgElems []*message2.ForwardNode) []*message.PushMsgBody
- func (c *QQClient) CheckURLSafely(url string) (oidb2.URLSecurityLevel, error)
- func (c *QQClient) CreateGroupFolder(groupUin uint32, targetDirectory string, folderName string) error
- func (c *QQClient) DelGroupNotice(groupUin uint32, fid string) error
- func (c *QQClient) DeleteFriend(uin uint32, block bool) error
- func (c *QQClient) DeleteGroupFile(groupUin uint32, fileID string) error
- func (c *QQClient) DeleteGroupFolder(groupUin uint32, folderID string) error
- func (c *QQClient) DeleteUnidirectionalFriend(uin uint32) error
- func (c *QQClient) Device() *auth.DeviceInfo
- func (c *QQClient) Disconnect()
- func (c *QQClient) FastLogin() error
- func (c *QQClient) FetchClientKey() (string, error)
- func (c *QQClient) FetchCookies(domains []string) ([]string, error)
- func (c *QQClient) FetchEssenceMessage(groupUin uint32) ([]*message2.GroupEssenceMessage, error)
- func (c *QQClient) FetchForwardMsg(resID string) (msg *message2.ForwardMessage, err error)
- func (c *QQClient) FetchFriends(token uint32) ([]*entity.User, uint32, error)
- func (c *QQClient) FetchGroupInfo(groupUin uint32, isStrange bool) (*entity.Group, error)
- func (c *QQClient) FetchGroupMember(groupUin, memberUin uint32) (*entity.GroupMember, error)
- func (c *QQClient) FetchGroupMembers(groupUin uint32, token string) ([]*entity.GroupMember, string, error)
- func (c *QQClient) FetchGroups() ([]*entity.Group, error)
- func (c *QQClient) FetchQRCode(size, margin, ecLevel uint32) ([]byte, string, error)
- func (c *QQClient) FetchQRCodeDefault() ([]byte, string, error)
- func (c *QQClient) FetchRkey() (entity.RKeyMap, error)
- func (c *QQClient) FetchUserInfo(uid string) (*entity.User, error)
- func (c *QQClient) FetchUserInfoUin(uin uint32) (*entity.User, error)
- func (c *QQClient) FriendPoke(uin uint32) error
- func (c *QQClient) GetAllGroupsInfo() (map[uint32]*entity.Group, error)
- func (c *QQClient) GetAllGroupsMembersData() (map[uint32]map[uint32]*entity.GroupMember, error)
- func (c *QQClient) GetAtAllRemain(uin, groupUin uint32) (*oidb2.AtAllRemainInfo, error)
- func (c *QQClient) GetCachedAllFriendsInfo() map[uint32]*entity.User
- func (c *QQClient) GetCachedAllGroupsInfo() map[uint32]*entity.Group
- func (c *QQClient) GetCachedFriendInfo(uin uint32) *entity.User
- func (c *QQClient) GetCachedGroupInfo(groupUin uint32) *entity.Group
- func (c *QQClient) GetCachedMemberInfo(uin, groupUin uint32) *entity.GroupMember
- func (c *QQClient) GetCachedMembersInfo(groupUin uint32) map[uint32]*entity.GroupMember
- func (c *QQClient) GetCachedRkeyInfo(rkeyType entity.RKeyType) *entity.RKeyInfo
- func (c *QQClient) GetCachedRkeyInfos() map[entity.RKeyType]*entity.RKeyInfo
- func (c *QQClient) GetCookies(domain string) (*Cookies, error)
- func (c *QQClient) GetCsrfToken() (int, error)
- func (c *QQClient) GetFriendsData() (map[uint32]*entity.User, error)
- func (c *QQClient) GetGroupAlbum(groupUin uint32) ([]*GroupAlbum, error)
- func (c *QQClient) GetGroupAlbumElem(ab *GroupAlbum) ([]*GroupAlbumElem, error)
- func (c *QQClient) GetGroupFileSystemInfo(groupUin uint32) (*entity.GroupFileSystemInfo, error)
- func (c *QQClient) GetGroupFileURL(groupUin uint32, fileID string) (string, error)
- func (c *QQClient) GetGroupHonorInfo(groupUin uint32, honorType entity.HonorType) (*entity.GroupHonorInfo, error)
- func (c *QQClient) GetGroupImageURL(groupUin uint32, node *oidb.IndexNode) (string, error)
- func (c *QQClient) GetGroupMembersData(groupUin uint32) (map[uint32]*entity.GroupMember, error)
- func (c *QQClient) GetGroupMessages(groupUin, startSeq, endSeq uint32) ([]*message2.GroupMessage, error)
- func (c *QQClient) GetGroupNotice(groupUin uint32) (l []*entity.GroupNoticeFeed, err error)
- func (c *QQClient) GetGroupRecordURL(groupUin uint32, node *oidb.IndexNode) (string, error)
- func (c *QQClient) GetGroupSystemMessages(isFiltered bool, count uint32, groupUin ...uint32) (*entity.GroupSystemMessages, error)
- func (c *QQClient) GetNewDeviceVerifyURL() (string, error)
- func (c *QQClient) GetPrivateFileURL(fileUUID string, fileHash string) (string, error)
- func (c *QQClient) GetPrivateImageURL(node *oidb.IndexNode) (string, error)
- func (c *QQClient) GetPrivateMessages(uin, timestamp, count uint32) ([]*message2.PrivateMessage, error)
- func (c *QQClient) GetPrivateRecordURL(node *oidb.IndexNode) (string, error)
- func (c *QQClient) GetQRCodeResult() (qrcodestate.State, error)
- func (c *QQClient) GetSkey() (string, error)
- func (c *QQClient) GetStatistics() *Statistics
- func (c *QQClient) GetUID(uin uint32, groupUin ...uint32) string
- func (c *QQClient) GetUin(uid string, groupUin ...uint32) uint32
- func (c *QQClient) GetUnidirectionalFriendList() ([]*entity.User, error)
- func (c *QQClient) GetVideoURL(isGroup bool, uuid string) (string, error)
- func (c *QQClient) GroupPoke(groupUin, uin uint32) error
- func (c *QQClient) ImageOcr(url string) (*oidb2.OcrResponse, error)
- func (c *QQClient) KickGroupMember(groupUin, uin uint32, rejectAddRequest bool) error
- func (c *QQClient) ListGroupFilesByFolder(groupUin uint32, targetDirectory string) ([]*entity.GroupFile, []*entity.GroupFolder, error)
- func (c *QQClient) ListGroupRootFiles(groupUin uint32) ([]*entity.GroupFile, []*entity.GroupFolder, error)
- func (c *QQClient) MarkGroupMessageReaded(groupUin, startSeq uint32) error
- func (c *QQClient) MarkPrivateMessageReaded(uin, timestamp, startSeq uint32) error
- func (c *QQClient) MoveGroupFile(groupUin uint32, fileID string, parentFolder string, targetFolderID string) error
- func (c *QQClient) NewDeviceVerify(verifyURL string) error
- func (c *QQClient) NickName() string
- func (c *QQClient) PasswordLogin() (*LoginResponse, error)
- func (c *QQClient) PreprocessGroupMessageEvent(msg *msgConverter.GroupMessage)
- func (c *QQClient) PreprocessPrivateMessageEvent(msg *msgConverter.PrivateMessage)
- func (c *QQClient) QRCodeLogin() (*LoginResponse, error)
- func (c *QQClient) QueryFriendImage(md5 []byte, fileUUID string) (*message2.ImageElement, error)
- func (c *QQClient) QueryGroupImage(md5 []byte, fileUUID string) (*message2.ImageElement, error)
- func (c *QQClient) RecallFriendMessage(uin, seq, random, clientSeq, timestamp uint32) error
- func (c *QQClient) RecallGroupMessage(groupUin, seq uint32) error
- func (c *QQClient) RefreshAllGroupMembersCache() error
- func (c *QQClient) RefreshAllGroupsInfo() error
- func (c *QQClient) RefreshAllRkeyInfoCache() error
- func (c *QQClient) RefreshFriendCache() error
- func (c *QQClient) RefreshGroupMemberCache(groupUin, memberUin uint32) error
- func (c *QQClient) RefreshGroupMembersCache(groupUin uint32) error
- func (c *QQClient) Release()
- func (c *QQClient) RenameGroupFile(groupUin uint32, fileID string, parentFolder string, newFileName string) error
- func (c *QQClient) RenameGroupFolder(groupUin uint32, folderID string, newFolderName string) error
- func (c *QQClient) ResolveUin(g eventConverter.Iuid2uin) error
- func (c *QQClient) SendFriendLike(uin uint32, count uint32) error
- func (c *QQClient) SendGroupFile(groupUin uint32, localFilePath, filename, targetDirectory string) error
- func (c *QQClient) SendGroupMessage(groupUin uint32, elements []message2.IMessageElement, needPreprocess ...bool) (*message2.GroupMessage, error)
- func (c *QQClient) SendGroupSign(groupUin uint32) (*oidb2.BotGroupClockInResult, error)
- func (c *QQClient) SendPrivateFile(targetUin uint32, localFilePath, filename string) error
- func (c *QQClient) SendPrivateMessage(uin uint32, elements []message2.IMessageElement, needPreprocess ...bool) (*message2.PrivateMessage, error)
- func (c *QQClient) SendRawMessage(route *message.RoutingHead, body *message.MessageBody, random uint32) (*action.SendMessageResponse, uint32, error)
- func (c *QQClient) SendRequestWithCookie(request *http.Request) (*http.Response, error)
- func (c *QQClient) SendSsoPacket(cmd string, body []byte) ([]byte, error)
- func (c *QQClient) SendTempMessage(groupUin uint32, uin uint32, elements []message2.IMessageElement) (*message2.TempMessage, error)
- func (c *QQClient) SetAvatar(avatar io.ReadSeeker) error
- func (c *QQClient) SetCustomServer(servers []netip.AddrPort)
- func (c *QQClient) SetEssenceMessage(groupUin, seq, random uint32, isSet bool) error
- func (c *QQClient) SetFriendRequest(accept bool, targetUID string) error
- func (c *QQClient) SetGroupAdmin(groupUin, uin uint32, isAdmin bool) error
- func (c *QQClient) SetGroupAvatar(groupUin uint32, avatar io.ReadSeeker) error
- func (c *QQClient) SetGroupGlobalMute(groupUin uint32, isMute bool) error
- func (c *QQClient) SetGroupLeave(groupUin uint32) error
- func (c *QQClient) SetGroupMemberMute(groupUin, uin, duration uint32) error
- func (c *QQClient) SetGroupMemberName(groupUin, uin uint32, name string) error
- func (c *QQClient) SetGroupMemberSpecialTitle(groupUin, uin uint32, title string) error
- func (c *QQClient) SetGroupName(groupUin uint32, name string) error
- func (c *QQClient) SetGroupReaction(groupUin, sequence uint32, code string, isAdd bool) error
- func (c *QQClient) SetGroupRemark(groupUin uint32, remark string) error
- func (c *QQClient) SetGroupRequest(isFiltered bool, accept bool, sequence uint64, typ uint32, groupUin uint32, ...) error
- func (c *QQClient) SetLogger(logger log.Logger)
- func (c *QQClient) SetOnlineStatus(status, ext, battery uint32) error
- func (c *QQClient) Sig() *auth.SigInfo
- func (c *QQClient) SubmitCaptcha(ticket, randStr, aid string) (*LoginResponse, error)
- func (c *QQClient) SubscribeEventHandler(handler any)
- func (c *QQClient) TokenLogin() (*LoginResponse, error)
- func (c *QQClient) UploadForwardMsg(forward *message2.ForwardMessage, groupUin uint32) (*message2.ForwardMessage, error)
- func (c *QQClient) UploadGroupAlbumPhoto(parms *GroupAlbumUploadParam) (*GroupPhoto, error)
- func (c *QQClient) UploadGroupAlbumVideo(parms *GroupAlbumUploadParam) (*GroupVideo, error)
- func (c *QQClient) UploadGroupFile(groupUin uint32, file *message.FileElement, targetDirectory string) (*message.FileElement, error)
- func (c *QQClient) UploadGroupImage(groupUin uint32, image *message.ImageElement) (*message.ImageElement, error)
- func (c *QQClient) UploadGroupRecord(groupUin uint32, record *message.VoiceElement) (*message.VoiceElement, error)
- func (c *QQClient) UploadGroupVideo(groupUin uint32, video *message.ShortVideoElement) (*message.ShortVideoElement, error)
- func (c *QQClient) UploadImage(target message.Source, image *message.ImageElement) (*message.ImageElement, error)
- func (c *QQClient) UploadPrivateFile(targetUID string, file *message.FileElement) (*message.FileElement, error)
- func (c *QQClient) UploadPrivateImage(targetUID string, image *message.ImageElement) (*message.ImageElement, error)
- func (c *QQClient) UploadPrivateRecord(targetUID string, record *message.VoiceElement) (*message.VoiceElement, error)
- func (c *QQClient) UploadPrivateVideo(targetUID string, video *message.ShortVideoElement) (*message.ShortVideoElement, error)
- func (c *QQClient) UploadRecord(target message.Source, voice *message.VoiceElement) (*message.VoiceElement, error)
- func (c *QQClient) UploadShortVideo(target message.Source, video *message.ShortVideoElement) (*message.ShortVideoElement, error)
- func (c *QQClient) UseDevice(d *auth.DeviceInfo)
- func (c *QQClient) UseSig(s auth.SigInfo)
- func (c *QQClient) UseVersion(app *auth.AppInfo)
- type ResourceType
- type Statistics
- type TicketService
- type VideoFile
Constants ¶
const TimeLayout = "2006-01-02 15:04:05"
Variables ¶
Functions ¶
Types ¶
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 DisconnectedEvent ¶ added in v0.1.1
type DisconnectedEvent struct {
Message string
}
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 ¶
type GroupAlbumElem ¶
type GroupAlbumElem struct {
// contains filtered or unexported fields
}
type GroupAlbumElemUserInfo ¶
type GroupAlbumUploadParam ¶
type GroupAlbumUploadParam struct { ResourceType GroupUin uint32 FileName, AlbumID, AlbumName string ImageFile VideoFile }
type GroupPhoto ¶
type GroupVideo ¶
type ImageFile ¶
type ImageFile struct {
Image io.ReadSeeker
}
type LoginError ¶ added in v0.1.2
type LoginError int
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 )
func (LoginError) String ¶ added in v0.1.2
func (i LoginError) String() string
type LoginResponse ¶ added in v0.1.2
type NTNewDeviceQrCodeQuery ¶ added in v0.1.2
type NTNewDeviceQrCodeRequest ¶ added in v0.1.2
type NTNewDeviceQrCodeResponse ¶ added in v0.1.2
type QQClient ¶
type QQClient struct { Uin uint32 Online atomic.Bool PasswordMD5 [16]byte 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[*DisconnectedEvent] // contains filtered or unexported fields }
func NewClientEmpty ¶ added in v0.1.2
func NewClientEmpty() *QQClient
func NewClientMD5 ¶ added in v0.1.2
func (*QQClient) AddGroupNoticeSimple ¶
AddGroupNoticeSimple 发群公告
func (*QQClient) AddGroupNoticeWithPic ¶
func (c *QQClient) AddGroupNoticeWithPic(groupUin uint32, text string, pic []byte) (noticeID string, err error)
AddGroupNoticeWithPic 发群公告带图片
func (*QQClient) AddSignHeader ¶ added in v0.1.2
AddSignHeader 设置签名服务器签名时的额外http header
func (*QQClient) AddSignServer ¶ added in v0.1.2
AddSignServer 设置签名服务器url
func (*QQClient) BuildFakeMessage ¶
func (c *QQClient) BuildFakeMessage(msgElems []*message2.ForwardNode) []*message.PushMsgBody
BuildFakeMessage make a fake message
func (*QQClient) CheckURLSafely ¶ added in v0.1.2
func (c *QQClient) CheckURLSafely(url string) (oidb2.URLSecurityLevel, error)
CheckURLSafely 通过TX服务器检查URL安全性 ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/security.go#L24
func (*QQClient) CreateGroupFolder ¶
func (c *QQClient) CreateGroupFolder(groupUin uint32, targetDirectory string, folderName string) error
CreateGroupFolder 创建群文件夹
func (*QQClient) DelGroupNotice ¶
DelGroupNotice 删除群公告
func (*QQClient) DeleteFriend ¶ added in v0.1.2
DeleteFriend 删除好友
func (*QQClient) DeleteGroupFile ¶
DeleteGroupFile 删除群文件
func (*QQClient) DeleteGroupFolder ¶
DeleteGroupFolder 删除群文件夹
func (*QQClient) DeleteUnidirectionalFriend ¶ added in v0.1.2
DeleteUnidirectionalFriend 删除单向好友 ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/web.go#L62
func (*QQClient) Device ¶
func (c *QQClient) Device() *auth.DeviceInfo
func (*QQClient) FetchClientKey ¶
FetchClientKey 获取ClientKey
func (*QQClient) FetchCookies ¶
FetchCookies 获取cookies
func (*QQClient) FetchEssenceMessage ¶
func (c *QQClient) FetchEssenceMessage(groupUin uint32) ([]*message2.GroupEssenceMessage, error)
FetchEssenceMessage 获取精华消息
func (*QQClient) FetchForwardMsg ¶
func (c *QQClient) FetchForwardMsg(resID string) (msg *message2.ForwardMessage, err error)
FetchForwardMsg 获取合并转发消息
func (*QQClient) FetchFriends ¶
FetchFriends 获取好友列表信息,使用token可以获取下一页的群成员信息
func (*QQClient) FetchGroupInfo ¶ added in v0.1.1
FetchGroupInfo 获取群信息 isStrange是否陌生群聊
func (*QQClient) FetchGroupMember ¶
func (c *QQClient) FetchGroupMember(groupUin, memberUin uint32) (*entity.GroupMember, error)
FetchGroupMember 获取对应群的群成员信息
func (*QQClient) FetchGroupMembers ¶
func (c *QQClient) FetchGroupMembers(groupUin uint32, token string) ([]*entity.GroupMember, string, error)
FetchGroupMembers 获取对应群的所有群成员信息,使用token可以获取下一页的群成员信息
func (*QQClient) FetchGroups ¶
FetchGroups 获取所有已加入的群的信息
func (*QQClient) FetchQRCode ¶
func (*QQClient) FetchQRCodeDefault ¶
func (*QQClient) FetchUserInfo ¶
FetchUserInfo 获取用户信息
func (*QQClient) FetchUserInfoUin ¶
FetchUserInfoUin 通过uin获取用户信息
func (*QQClient) GetAllGroupsInfo ¶
func (*QQClient) GetAllGroupsMembersData ¶
GetAllGroupsMembersData 获取所有群的群成员信息
func (*QQClient) GetAtAllRemain ¶ added in v0.1.2
func (c *QQClient) GetAtAllRemain(uin, groupUin uint32) (*oidb2.AtAllRemainInfo, error)
GetAtAllRemain 获取剩余@全员次数 ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/group_msg.go#L68
func (*QQClient) GetCachedAllFriendsInfo ¶
GetCachedAllFriendsInfo 获取所有好友信息(缓存)
func (*QQClient) GetCachedAllGroupsInfo ¶
GetCachedAllGroupsInfo 获取所有群信息(缓存)
func (*QQClient) GetCachedFriendInfo ¶
GetCachedFriendInfo 获取好友信息(缓存)
func (*QQClient) GetCachedGroupInfo ¶
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 ¶
GetCachedRkeyInfo 获取指定类型的RKey信息(缓存)
func (*QQClient) GetCachedRkeyInfos ¶
GetCachedRkeyInfos 获取所有RKey信息(缓存)
func (*QQClient) GetCsrfToken ¶
func (*QQClient) GetFriendsData ¶
GetFriendsData 获取好友列表数据
func (*QQClient) GetGroupAlbum ¶
func (c *QQClient) GetGroupAlbum(groupUin uint32) ([]*GroupAlbum, error)
func (*QQClient) GetGroupAlbumElem ¶
func (c *QQClient) GetGroupAlbumElem(ab *GroupAlbum) ([]*GroupAlbumElem, error)
func (*QQClient) GetGroupFileSystemInfo ¶
func (c *QQClient) GetGroupFileSystemInfo(groupUin uint32) (*entity.GroupFileSystemInfo, error)
GetGroupFileSystemInfo 获取群文件系统信息
func (*QQClient) GetGroupFileURL ¶ added in v0.1.1
GetGroupFileURL 获取群文件下载链接
func (*QQClient) GetGroupHonorInfo ¶
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.1.1
GetGroupImageURL 获取群聊图片下载url
func (*QQClient) GetGroupMembersData ¶
GetGroupMembersData 获取指定群所有成员信息
func (*QQClient) GetGroupMessages ¶ added in v0.1.1
func (c *QQClient) GetGroupMessages(groupUin, startSeq, endSeq uint32) ([]*message2.GroupMessage, error)
GetGroupMessages 获取群聊历史消息
func (*QQClient) GetGroupNotice ¶
func (c *QQClient) GetGroupNotice(groupUin uint32) (l []*entity.GroupNoticeFeed, err error)
GetGroupNotice 获取群公告
func (*QQClient) GetGroupRecordURL ¶ added in v0.1.1
GetGroupRecordURL 获取群聊语音下载url
func (*QQClient) GetGroupSystemMessages ¶
func (c *QQClient) GetGroupSystemMessages(isFiltered bool, count uint32, groupUin ...uint32) (*entity.GroupSystemMessages, error)
GetGroupSystemMessages 获取加群请求信息
func (*QQClient) GetNewDeviceVerifyURL ¶ added in v0.1.2
func (*QQClient) GetPrivateFileURL ¶ added in v0.1.1
GetPrivateFileURL 获取私聊文件下载链接
func (*QQClient) GetPrivateImageURL ¶ added in v0.1.1
GetPrivateImageURL 获取私聊图片下载url
func (*QQClient) GetPrivateMessages ¶ added in v0.1.2
func (c *QQClient) GetPrivateMessages(uin, timestamp, count uint32) ([]*message2.PrivateMessage, error)
func (*QQClient) GetPrivateRecordURL ¶ added in v0.1.1
GetPrivateRecordURL 获取私聊语音下载url
func (*QQClient) GetQRCodeResult ¶
func (c *QQClient) GetQRCodeResult() (qrcodestate.State, error)
func (*QQClient) GetStatistics ¶
func (c *QQClient) GetStatistics() *Statistics
func (*QQClient) GetUnidirectionalFriendList ¶ added in v0.1.2
GetUnidirectionalFriendList 获取单向好友列表 ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/web.go#L23
func (*QQClient) GetVideoURL ¶ added in v0.1.1
GetVideoURL 获取视频下载链接
func (*QQClient) ImageOcr ¶ added in v0.1.2
func (c *QQClient) ImageOcr(url string) (*oidb2.OcrResponse, error)
ImageOcr 图片识别 有些域名的图可能无法识别,需要重新上传到tx服务器并获取图片下载链接
func (*QQClient) KickGroupMember ¶ added in v0.1.2
KickGroupMember 踢出群成员,可选是否拒绝加群请求
func (*QQClient) ListGroupFilesByFolder ¶
func (c *QQClient) ListGroupFilesByFolder(groupUin uint32, targetDirectory string) ([]*entity.GroupFile, []*entity.GroupFolder, error)
ListGroupFilesByFolder 获取群目录指定文件夹列表
func (*QQClient) ListGroupRootFiles ¶
func (c *QQClient) ListGroupRootFiles(groupUin uint32) ([]*entity.GroupFile, []*entity.GroupFolder, error)
ListGroupRootFiles 获取群根目录文件列表
func (*QQClient) MarkGroupMessageReaded ¶ added in v0.1.2
MarkGroupMessageReaded 标记群消息已读
func (*QQClient) MarkPrivateMessageReaded ¶ added in v0.1.2
MarkPrivateMessageReaded 标记私聊消息已读
func (*QQClient) MoveGroupFile ¶
func (c *QQClient) MoveGroupFile(groupUin uint32, fileID string, parentFolder string, targetFolderID string) error
MoveGroupFile 移动群文件
func (*QQClient) NewDeviceVerify ¶ added in v0.1.2
func (*QQClient) PasswordLogin ¶
func (c *QQClient) PasswordLogin() (*LoginResponse, error)
func (*QQClient) PreprocessGroupMessageEvent ¶
func (c *QQClient) PreprocessGroupMessageEvent(msg *msgConverter.GroupMessage)
func (*QQClient) PreprocessPrivateMessageEvent ¶
func (c *QQClient) PreprocessPrivateMessageEvent(msg *msgConverter.PrivateMessage)
func (*QQClient) QRCodeLogin ¶
func (c *QQClient) QRCodeLogin() (*LoginResponse, error)
func (*QQClient) QueryFriendImage ¶
QueryFriendImage 获取私聊图片
func (*QQClient) QueryGroupImage ¶
QueryGroupImage 获取群图片
func (*QQClient) RecallFriendMessage ¶
RecallFriendMessage 撤回私聊消息
func (*QQClient) RecallGroupMessage ¶
RecallGroupMessage 撤回群聊消息
func (*QQClient) RefreshAllGroupMembersCache ¶
RefreshAllGroupMembersCache 刷新所有群的群成员缓存
func (*QQClient) RefreshAllGroupsInfo ¶
RefreshAllGroupsInfo 刷新所有群信息缓存
func (*QQClient) RefreshAllRkeyInfoCache ¶
RefreshAllRkeyInfoCache 刷新RKey缓存
func (*QQClient) RefreshFriendCache ¶
RefreshFriendCache 刷新好友缓存
func (*QQClient) RefreshGroupMemberCache ¶
RefreshGroupMemberCache 刷新一个群的指定群成员缓存
func (*QQClient) RefreshGroupMembersCache ¶
RefreshGroupMembersCache 刷新指定群的所有群成员缓存
func (*QQClient) RenameGroupFile ¶
func (c *QQClient) RenameGroupFile(groupUin uint32, fileID string, parentFolder string, newFileName string) error
RenameGroupFile 重命名群文件
func (*QQClient) RenameGroupFolder ¶
RenameGroupFolder 重命名群文件夹
func (*QQClient) ResolveUin ¶ added in v0.1.2
func (c *QQClient) ResolveUin(g eventConverter.Iuid2uin) error
func (*QQClient) SendFriendLike ¶ added in v0.1.1
SendFriendLike 给好友点赞
func (*QQClient) SendGroupFile ¶ added in v0.1.2
func (c *QQClient) SendGroupFile(groupUin uint32, localFilePath, filename, targetDirectory string) error
SendGroupFile 发送群文件
func (*QQClient) SendGroupMessage ¶
func (c *QQClient) SendGroupMessage(groupUin uint32, elements []message2.IMessageElement, needPreprocess ...bool) (*message2.GroupMessage, error)
SendGroupMessage 发送群聊消息,默认会对消息进行预处理
func (*QQClient) SendGroupSign ¶ added in v0.1.2
func (c *QQClient) SendGroupSign(groupUin uint32) (*oidb2.BotGroupClockInResult, error)
SendGroupSign 发送群聊打卡消息
func (*QQClient) SendPrivateFile ¶ added in v0.1.2
SendPrivateFile 发送私聊文件
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 ¶
func (*QQClient) SendSsoPacket ¶
SendSsoPacket 发送签名回调包给服务器并获取返回结果供提交
func (*QQClient) SendTempMessage ¶
func (c *QQClient) SendTempMessage(groupUin uint32, uin uint32, elements []message2.IMessageElement) (*message2.TempMessage, error)
func (*QQClient) SetAvatar ¶
func (c *QQClient) SetAvatar(avatar io.ReadSeeker) error
SetAvatar 设置头像
func (*QQClient) SetCustomServer ¶ added in v0.1.2
func (*QQClient) SetEssenceMessage ¶
SetEssenceMessage 设置群聊精华消息
func (*QQClient) SetFriendRequest ¶
SetFriendRequest 处理好友请求
func (*QQClient) SetGroupAdmin ¶ added in v0.1.2
SetGroupAdmin 设置群管理员
func (*QQClient) SetGroupAvatar ¶
func (c *QQClient) SetGroupAvatar(groupUin uint32, avatar io.ReadSeeker) error
SetGroupAvatar 设置群头像
func (*QQClient) SetGroupGlobalMute ¶ added in v0.1.2
SetGroupGlobalMute 群全员禁言
func (*QQClient) SetGroupLeave ¶ added in v0.1.2
SetGroupLeave 退出群聊
func (*QQClient) SetGroupMemberMute ¶ added in v0.1.2
SetGroupMemberMute 禁言群成员
func (*QQClient) SetGroupMemberName ¶ added in v0.1.2
SetGroupMemberName 设置群成员昵称
func (*QQClient) SetGroupMemberSpecialTitle ¶ added in v0.1.2
SetGroupMemberSpecialTitle 设置群成员专属头衔
func (*QQClient) SetGroupName ¶ added in v0.1.2
SetGroupName 设置群聊名称
func (*QQClient) SetGroupReaction ¶ added in v0.1.2
SetGroupReaction 设置群消息表态
func (*QQClient) SetGroupRemark ¶ added in v0.1.2
SetGroupRemark 设置群聊备注
func (*QQClient) SetGroupRequest ¶
func (c *QQClient) SetGroupRequest(isFiltered bool, accept bool, sequence uint64, typ uint32, groupUin uint32, message string) error
SetGroupRequest 处理加群请求
func (*QQClient) SetOnlineStatus ¶
SetOnlineStatus 设置在线状态
func (*QQClient) SubmitCaptcha ¶ added in v0.1.2
func (c *QQClient) SubmitCaptcha(ticket, randStr, aid string) (*LoginResponse, error)
func (*QQClient) SubscribeEventHandler ¶
func (*QQClient) TokenLogin ¶
func (c *QQClient) TokenLogin() (*LoginResponse, error)
func (*QQClient) UploadForwardMsg ¶
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 ¶
func (c *QQClient) UploadGroupAlbumPhoto(parms *GroupAlbumUploadParam) (*GroupPhoto, error)
func (*QQClient) UploadGroupAlbumVideo ¶
func (c *QQClient) UploadGroupAlbumVideo(parms *GroupAlbumUploadParam) (*GroupVideo, error)
func (*QQClient) UploadGroupFile ¶
func (c *QQClient) UploadGroupFile(groupUin uint32, file *message.FileElement, targetDirectory string) (*message.FileElement, error)
func (*QQClient) UploadGroupImage ¶ added in v0.1.2
func (c *QQClient) UploadGroupImage(groupUin uint32, image *message.ImageElement) (*message.ImageElement, error)
func (*QQClient) UploadGroupRecord ¶ added in v0.1.2
func (c *QQClient) UploadGroupRecord(groupUin uint32, record *message.VoiceElement) (*message.VoiceElement, error)
func (*QQClient) UploadGroupVideo ¶ added in v0.1.2
func (c *QQClient) UploadGroupVideo(groupUin uint32, video *message.ShortVideoElement) (*message.ShortVideoElement, error)
func (*QQClient) UploadImage ¶
func (c *QQClient) UploadImage(target message.Source, image *message.ImageElement) (*message.ImageElement, error)
func (*QQClient) UploadPrivateFile ¶
func (c *QQClient) UploadPrivateFile(targetUID string, file *message.FileElement) (*message.FileElement, error)
func (*QQClient) UploadPrivateImage ¶ added in v0.1.2
func (c *QQClient) UploadPrivateImage(targetUID string, image *message.ImageElement) (*message.ImageElement, error)
func (*QQClient) UploadPrivateRecord ¶ added in v0.1.2
func (c *QQClient) UploadPrivateRecord(targetUID string, record *message.VoiceElement) (*message.VoiceElement, error)
func (*QQClient) UploadPrivateVideo ¶ added in v0.1.2
func (c *QQClient) UploadPrivateVideo(targetUID string, video *message.ShortVideoElement) (*message.ShortVideoElement, error)
func (*QQClient) UploadRecord ¶
func (c *QQClient) UploadRecord(target message.Source, voice *message.VoiceElement) (*message.VoiceElement, error)
func (*QQClient) UploadShortVideo ¶
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) UseVersion ¶ added in v0.1.2
type ResourceType ¶
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 ¶
type TicketService struct {
// contains filtered or unexported fields
}
type VideoFile ¶
type VideoFile struct { Thumbnail io.ReadSeeker Video io.ReadSeeker }