client

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: AGPL-3.0 Imports: 47 Imported by: 0

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

	Owner MemberPermission = iota
	Administrator
	Member

	AndroidPhone ClientProtocol = 1
	IPad         ClientProtocol = 2
	AndroidWatch ClientProtocol = 3
	MacOS        ClientProtocol = 4
)

Variables

View Source
var (
	ErrAlreadyOnline  = errors.New("already online")
	ErrMemberNotFound = errors.New("member not found")
	ErrNotExists      = errors.New("not exists")
)
View Source
var EmptyBytes = []byte{}
View Source
var NumberRange = "0123456789"

Functions

func NewUinFilterPrivate

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

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 ClientDisconnectedEvent

type ClientDisconnectedEvent struct {
	Message string
}

type ClientProtocol

type ClientProtocol int

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 DeviceInfo

type DeviceInfo struct {
	Display     []byte
	Product     []byte
	Device      []byte
	Board       []byte
	Brand       []byte
	Model       []byte
	Bootloader  []byte
	FingerPrint []byte
	BootId      []byte
	ProcVersion []byte
	BaseBand    []byte
	SimInfo     []byte
	OSType      []byte
	MacAddress  []byte
	IpAddress   []byte
	WifiBSSID   []byte
	WifiSSID    []byte
	IMSIMd5     []byte
	IMEI        string
	AndroidId   []byte
	APN         []byte
	Guid        []byte
	TgtgtKey    []byte
	Protocol    ClientProtocol
	Version     *Version
}

func GenRandomDevice

func GenRandomDevice(p ClientProtocol) *DeviceInfo

func (*DeviceInfo) GenDeviceInfoData

func (info *DeviceInfo) GenDeviceInfoData() []byte

func (*DeviceInfo) GenNewGuid

func (info *DeviceInfo) GenNewGuid()

func (*DeviceInfo) GenNewTgtgtKey

func (info *DeviceInfo) GenNewTgtgtKey()

func (*DeviceInfo) Init

func (info *DeviceInfo) Init()

func (*DeviceInfo) ReadJson

func (info *DeviceInfo) ReadJson(d []byte) error

func (*DeviceInfo) ToJson

func (info *DeviceInfo) ToJson() []byte

type DeviceInfoFile

type DeviceInfoFile struct {
	Display     string `json:"display"`
	Product     string `json:"product"`
	Device      string `json:"device"`
	Board       string `json:"board"`
	Model       string `json:"model"`
	FingerPrint string `json:"finger_print"`
	BootId      string `json:"boot_id"`
	ProcVersion string `json:"proc_version"`
	Protocol    int    `json:"protocol"` // 0: Pad 1: Phone 2: Watch
	IMEI        string `json:"imei"`
}

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 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) DeleteFile

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

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

func (*GroupFileSystem) GetDownloadUrl

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

func (*GroupFileSystem) GetFilesByFolder

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

func (*GroupFileSystem) Root

func (fs *GroupFileSystem) Root() ([]*GroupFile, []*GroupFolder, 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
	Memo           string
	OwnerUin       int64
	MemberCount    uint16
	MaxMemberCount uint16
	Members        []*GroupMemberInfo
	// 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) interface{}) interface{}

func (*GroupInfo) SelfPermission

func (g *GroupInfo) SelfPermission() MemberPermission

func (*GroupInfo) Update

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

func (*GroupInfo) UpdateGroupHeadPortrait

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

func (*GroupInfo) UpdateMemo

func (g *GroupInfo) UpdateMemo(newMemo string)

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
	Gender                 byte
	Nickname               string
	CardName               string
	Level                  uint16
	JoinTime               int64
	LastSpeakTime          int64
	SpecialTitle           string
	SpecialTitleExpireTime int64
	Permission             MemberPermission
}

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)

func (*GroupMemberInfo) Manageable

func (m *GroupMemberInfo) Manageable() bool

func (*GroupMemberInfo) Mute

func (m *GroupMemberInfo) Mute(time uint32)

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 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 GroupSystemMessages

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

type HandlerMap

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

Map is like a Go map[interface{}]interface{} but is safe for concurrent use by multiple goroutines without additional locking or coordination. Loads, stores, and deletes run in amortized constant time.

The Map type is specialized. Most code should use a plain Go map instead, with separate locking or coordination, for better type safety and to make it easier to maintain other invariants along with the map content.

The Map type is optimized for two common use cases: (1) when the entry for a given key is only ever written once but read many times, as in caches that only grow, or (2) when multiple goroutines read, write, and overwrite entries for disjoint sets of keys. In these two cases, use of a Map may significantly reduce lock contention compared to a Go map paired with a separate Mutex or RWMutex.

The zero Map is empty and ready for use. A Map must not be copied after first use.

func (*HandlerMap) Delete

func (m *HandlerMap) Delete(key uint16)

Delete deletes the value for a key.

func (*HandlerMap) Load

func (m *HandlerMap) Load(key uint16) (value func(i interface{}, err error,

), ok bool)

Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.

func (*HandlerMap) LoadAndDelete

func (m *HandlerMap) LoadAndDelete(key uint16) (value func(i interface{}, err error,

), loaded bool)

LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present.

func (*HandlerMap) LoadOrStore

func (m *HandlerMap) LoadOrStore(key uint16, value func(i interface{}, err error,

)) (actual func(i interface{}, err error,

), loaded bool)

LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.

func (*HandlerMap) Range

func (m *HandlerMap) Range(f func(key uint16, value func(i interface{}, err error,

)) bool)

Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.

Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.

Range may be O(N) with the number of elements in the map even if f returns false after a constant number of calls.

func (*HandlerMap) Store

func (m *HandlerMap) Store(key uint16, value func(i interface{}, err error,

))

Store sets the value for a key.

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 LogEvent

type LogEvent struct {
	Type    string
	Message string
}

type LoginError

type LoginError int

type LoginResponse

type LoginResponse struct {
	Success bool
	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 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 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 QQClient

type QQClient struct {
	Uin         int64
	PasswordMd5 [16]byte
	AllowSlider bool
	DeviceInfo  *DeviceInfo
	Nickname    string
	Age         uint16
	Gender      uint16
	FriendList  []*FriendInfo
	GroupList   []*GroupInfo
	Online      bool
	NetLooping  bool

	SequenceId              int32
	OutGoingPacketSessionId []byte
	RandomKey               []byte
	Conn                    net.Conn
	ConnectTime             time.Time
	// contains filtered or unexported fields
}

func NewClient

func NewClient(uin int64, password string, info *DeviceInfo) *QQClient

NewClient create new qq client

func NewClientMd5

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

func (*QQClient) Debug

func (c *QQClient) Debug(msg string, args ...interface{})

func (*QQClient) Disconnect

func (c *QQClient) Disconnect()

func (*QQClient) DownloadForwardMessage

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

func (*QQClient) Error

func (c *QQClient) Error(msg string, args ...interface{})

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) GetAtAllRemain

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

func (*QQClient) GetForwardMessage

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

func (*QQClient) GetFriendList

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

GetFriendList request friend list

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) 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) GetGroupSystemMessages

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

func (*QQClient) GetQzoneKeys

func (c *QQClient) GetQzoneKeys() QzoneKeys

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) GetVipInfo

func (c *QQClient) GetVipInfo(target int64) (*VipInfo, error)

func (*QQClient) GetWordSegmentation

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

func (*QQClient) ImageOcr

func (c *QQClient) ImageOcr(img interface{}) (*OcrResponse, error)

func (*QQClient) Info

func (c *QQClient) Info(msg string, args ...interface{})

func (*QQClient) Login

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

Login send login request

func (*QQClient) OnDisconnected

func (c *QQClient) OnDisconnected(f func(*QQClient, *ClientDisconnectedEvent))

func (*QQClient) OnFriendMessageRecalled

func (c *QQClient) OnFriendMessageRecalled(f func(*QQClient, *FriendMessageRecalledEvent))

func (*QQClient) OnFriendNotify

func (c *QQClient) OnFriendNotify(f func(*QQClient, INotifyEvent))

func (*QQClient) OnGroupInvited

func (c *QQClient) OnGroupInvited(f func(*QQClient, *GroupInvitedRequest))

func (*QQClient) OnGroupMemberCardUpdated

func (c *QQClient) OnGroupMemberCardUpdated(f func(*QQClient, *MemberCardUpdatedEvent))

func (*QQClient) OnGroupMemberJoined

func (c *QQClient) OnGroupMemberJoined(f func(*QQClient, *MemberJoinGroupEvent))

func (*QQClient) OnGroupMemberLeaved

func (c *QQClient) OnGroupMemberLeaved(f func(*QQClient, *MemberLeaveGroupEvent))

func (*QQClient) OnGroupMemberPermissionChanged

func (c *QQClient) OnGroupMemberPermissionChanged(f func(*QQClient, *MemberPermissionChangedEvent))

func (*QQClient) OnGroupMessage

func (c *QQClient) OnGroupMessage(f func(*QQClient, *message.GroupMessage))

func (*QQClient) OnGroupMessageRecalled

func (c *QQClient) OnGroupMessageRecalled(f func(*QQClient, *GroupMessageRecalledEvent))

func (*QQClient) OnGroupMuted

func (c *QQClient) OnGroupMuted(f func(*QQClient, *GroupMuteEvent))

func (*QQClient) OnGroupNotify

func (c *QQClient) OnGroupNotify(f func(*QQClient, INotifyEvent))

func (*QQClient) OnJoinGroup

func (c *QQClient) OnJoinGroup(f func(*QQClient, *GroupInfo))

func (*QQClient) OnLeaveGroup

func (c *QQClient) OnLeaveGroup(f func(*QQClient, *GroupLeaveEvent))

func (*QQClient) OnLog

func (c *QQClient) OnLog(f func(*QQClient, *LogEvent))

func (*QQClient) OnNewFriendAdded

func (c *QQClient) OnNewFriendAdded(f func(*QQClient, *NewFriendEvent))

func (*QQClient) OnNewFriendRequest

func (c *QQClient) OnNewFriendRequest(f func(*QQClient, *NewFriendRequest))

func (*QQClient) OnPrivateMessage

func (c *QQClient) OnPrivateMessage(f func(*QQClient, *message.PrivateMessage))

func (*QQClient) OnPrivateMessageF

func (c *QQClient) OnPrivateMessageF(filter func(*message.PrivateMessage) bool, f func(*QQClient, *message.PrivateMessage))

func (*QQClient) OnReceivedOfflineFile

func (c *QQClient) OnReceivedOfflineFile(f func(*QQClient, *OfflineFileEvent))

func (*QQClient) OnServerUpdated

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

func (*QQClient) OnTempMessage

func (c *QQClient) OnTempMessage(f func(*QQClient, *message.TempMessage))

func (*QQClient) OnUserWantJoinGroup

func (c *QQClient) OnUserWantJoinGroup(f func(*QQClient, *UserJoinGroupRequest))

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) 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) 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) SendFriendPoke

func (c *QQClient) SendFriendPoke(target int64)

func (*QQClient) SendFriendRichMessage

func (c *QQClient) SendFriendRichMessage(target, appId int64, appType, msgStyle uint32, client RichClientInfo, msg *message.RichMessage)

func (*QQClient) SendGroupForwardMessage

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

SendGroupForwardMessage 发送群合并转发消息

func (*QQClient) SendGroupGift

func (c *QQClient) SendGroupGift(groupCode, uin uint64, gift message.GroupGift)

func (*QQClient) SendGroupMessage

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

SendGroupMessage 发送群消息

func (*QQClient) SendGroupRichMessage

func (c *QQClient) SendGroupRichMessage(target, appId int64, appType, msgStyle uint32, client RichClientInfo, msg *message.RichMessage) (*message.GroupMessage, error)

func (*QQClient) SendPrivateMessage

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

func (*QQClient) SendTempMessage

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

func (*QQClient) SetCustomServer

func (c *QQClient) SetCustomServer(servers []*net.TCPAddr)

func (*QQClient) SolveFriendRequest

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

func (*QQClient) SolveGroupJoinRequest

func (c *QQClient) SolveGroupJoinRequest(i interface{}, 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) Trace

func (c *QQClient) Trace(msg string, args ...interface{})

func (*QQClient) Translate

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

func (*QQClient) UploadGroupForwardMessage

func (c *QQClient) UploadGroupForwardMessage(groupCode int64, m *message.ForwardMessage) *message.ForwardElement

func (*QQClient) UploadGroupImage

func (c *QQClient) UploadGroupImage(groupCode int64, img io.ReadSeeker) (*message.GroupImageElement, error)

func (*QQClient) UploadGroupImageByFile

func (c *QQClient) UploadGroupImageByFile(groupCode int64, path string) (*message.GroupImageElement, error)

func (*QQClient) UploadGroupPtt

func (c *QQClient) UploadGroupPtt(groupCode int64, voice io.ReadSeeker) (*message.GroupVoiceElement, error)

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

func (*QQClient) UploadPrivateImage

func (c *QQClient) UploadPrivateImage(target int64, img io.ReadSeeker) (*message.FriendImageElement, error)

func (*QQClient) UploadPrivatePtt

func (c *QQClient) UploadPrivatePtt(target int64, voice []byte) (*message.PrivateVoiceElement, error)

UploadPrivatePtt 将语音数据使用好友语音通道上传到服务器, 返回 message.PrivateVoiceElement 可直接发送

func (*QQClient) Warning

func (c *QQClient) Warning(msg string, args ...interface{})

type QzoneKeys

type QzoneKeys struct {
	Pskeys   map[string]string `json:"pskeys"`
	Sid      string            `json:"sid"`
	Skey     string            `json:"skey"`
	Superkey string            `json:"superkey"`
	Uin      int64             `json:"uin"`
}

type RichClientInfo

type RichClientInfo struct {
	Platform    uint32
	SdkVersion  string
	PackageName string
	Signature   string
}

type ServerUpdatedEvent

type ServerUpdatedEvent struct {
	Servers []jce.SsoServerInfo
}

type Statistics

type Statistics struct {
	PacketReceived  uint64 `json:"packet_received"`
	PacketSent      uint64 `json:"packet_sent"`
	PacketLost      uint32 `json:"packet_lost"`
	MessageReceived uint64 `json:"message_received"`
	MessageSent     uint64 `json:"message_sent"`
	DisconnectTimes uint32 `json:"disconnect_times"`
	LostTimes       uint32 `json:"lost_times"`
	// contains filtered or unexported fields
}

type SummaryCardInfo

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

type TextDetection

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

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"`

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

func (*UserJoinGroupRequest) Accept

func (r *UserJoinGroupRequest) Accept()

func (*UserJoinGroupRequest) Reject

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

type Version

type Version struct {
	Incremental []byte
	Release     []byte
	CodeName    []byte
	Sdk         uint32
}

type VipInfo

type VipInfo struct {
	Uin            int64
	Name           string
	Level          int
	LevelSpeed     float64
	VipLevel       string
	VipGrowthSpeed int
	VipGrowthTotal int
}

Directories

Path Synopsis
pb
msg

Jump to

Keyboard shortcuts

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