Documentation
¶
Index ¶
- Constants
- Variables
- func GenEncryptPassword(uin uint64, passwd_md5 string) (epwd string)
- type Account
- type Birthday
- type Card
- type Cface
- type ClientType
- type Content
- type ContentModel
- type CustomFaceJar
- type DiscuId
- type Event
- type EventAvRefuse
- type EventBuddiesStatusChange
- type EventDiscuMessage
- type EventFileMessage
- type EventFileSrvTransfer
- type EventGroupMessage
- type EventGroupWebMessage
- type EventInputNotify
- type EventMessage
- type EventPushOffFile
- type EventShakeMessage
- type EventSysGroupMessage
- type EventSystemMessage
- type Font
- type Friend
- type FriendInfo
- type FriendJar
- type FrientdCategorie
- type FrientdInfo
- type GCode
- type GroupId
- type GroupInfo
- type GroupJar
- type GroupName
- type LevelDbFriendJar
- type MarkName
- type Member
- type MemberInfo
- type MemberStat
- type OfflinePicJar
- type Offpic
- type RawEvent
- type Result
- type ResultAllowInfo
- type ResultBatchGetVipInfo
- type ResultC2CMsgSig
- type ResultCreateDiscu
- type ResultDiscuInfo
- type ResultDiscusList
- type ResultFriendInfo
- type ResultFriendUin
- type ResultGfaceSig
- type ResultGroupInfo
- type ResultGroupInfoExt
- type ResultGroupMemberStat
- type ResultGroupNameListMask
- type ResultLogin2
- type ResultOfflinePic
- type ResultOfflinePicDl
- type ResultOnlineBuddies
- type ResultPoll
- type ResultQQLevel
- type ResultRecentList
- type ResultSelfBusinessCard
- type ResultSingleLongNick
- type ResultStrangerInfo
- type ResultUserFrientds
- type SysGroupMessageType
- type SystemMessageType
- type Uin
- type VipInfo
- type WebQQ
- func (this *WebQQ) Login() (err error)
- func (this *WebQQ) SendQun(to Uin, m ContentModel) (err error)
- func (this *WebQQ) SendSingle(to Uin, m ContentModel) (err error)
- func (this *WebQQ) Start() <-chan Event
- func (this *WebQQ) UploadCustomFace(pic io.Reader) (v string, err error)
- func (this *WebQQ) UploadOfflinePic(peeruin Uin, pic io.Reader) (v *ResultOfflinePic, err error)
- type WebQQCustomPic
- type WebQQGroup
- type WebQQSingle
Constants ¶
const ( ClientTypePC ClientType = 1 ClientTypePC1 = 2 ClientTypePC2 = 3 ClientTypePC3 = 4 ClientTypePC4 = 5 ClientTypePC5 = 6 ClientTypePC6 = 10 ClientTypeMobile = 21 ClientTypeMobile1 = 22 ClientTypeMobile2 = 23 ClientTypeMobile3 = 24 ClientTypeWebQQ = 41 ClientTypePad = 42 )
客户端类型 (TODO:待补完)
const ( AddedBuddySig SystemMessageType = "added_buddy_sig" AddedBuddyNosig = "added_buddy_nosig" VerifyPassAdd = "verify_pass_add" VerifyPass = "verify_pass" VerifyRequired = "verify_required" VerifyRejected = "verify_rejected" )
const ( GroupJoin SysGroupMessageType = "group_join" GroupLeave = "group_leave" GroupRequestJoin = "group_request_join" GroupRequestJoinAgree = "group_request_join_agree" GroupRequestJoinDeny = "group_request_join_deny" GroupAdminOp = "group_admin_op" GroupCreate = "group_create" )
Variables ¶
var ( DefaultFont = Font{"微软雅黑", 10, []int{0, 0, 0}, "000000"} // 默认字体 DefaultServer = "112.90.78.75:0" )
Functions ¶
func GenEncryptPassword ¶
生成加密后的密码
Types ¶
type Birthday ¶
type Birthday struct {
Month uint32 `json:"month"`
Year uint32 `json:"year"`
Day uint32 `json:"day"`
}
生日
type Cface ¶
type Cface struct {
Name string `json:"name"`
FileId string `json:"file_id"`
Key string `json:"key"`
Server string `json:"server"`
}
自定义表情 {"file_id":4086436741,"key":"j9v3yUNifMrByvWC","name":"{DC854AD1-A1DB-0855-E267-2CC14D14345A}.gif","server":"112.90.78.75:0"}
type ClientType ¶
type ClientType uint32
type Content ¶
type Content []json.RawMessage
变态结构 [["font",{...}],["offpic",{...},],["cface",{...}],["face",100],"msg",["cface_idx",0]]
type ContentModel ¶
正常结构
type EventAvRefuse ¶
type EventAvRefuse struct {
FromUin Uin `json:"from_uin"`
ToUin Uin `json:"to_uin"`
MsgId uint32 `json:"msg_id"`
MsgId2 uint32 `json:"msg_id2"`
MsgType uint32 `json:"msg_type"`
ReplyIp uint32 `json:"reply_ip"`
Type uint32 `json:"type"`
SessionId uint32 `json:"session_id"`
Time uint32 `json:"time"`
Longconn string `json:"longconn"`
}
"poll_type": "av_refuse"
type EventBuddiesStatusChange ¶
type EventBuddiesStatusChange struct {
Uin Uin `json:"uin"`
Status uint32 `json:"status"`
ClientType uint32 `json:"client_type"`
}
"poll_type": "buddies_status_change"
type EventDiscuMessage ¶
type EventDiscuMessage struct {
FromUin Uin `json:"from_uin"`
ToUin Uin `json:"to_uin"`
MsgId uint32 `json:"msg_id"`
MsgId2 uint32 `json:"msg_id2"`
MsgType uint32 `json:"msg_type"`
ReplyIp uint32 `json:"reply_ip"`
DiscuId DiscuId `json:"did"`
SendUin Uin `json:"send_uin"`
Seq uint64 `json:"seq"`
Time uint64 `json:"time"`
InfoSeq uint64 `json:"info_seq"` // 讨论组号
Content Content `json:"content"`
}
"poll_type": "discu_message"
type EventFileMessage ¶
type EventFileMessage struct {
FromUin Uin `json:"from_uin"`
ToUin Uin `json:"to_uin"`
Mode string `json:"mode"`
MsgId uint32 `json:"msg_id"`
MsgId2 uint32 `json:"msg_id2"`
MsgType uint32 `json:"msg_type"`
ReplyIp uint32 `json:"reply_ip"`
Type uint32 `json:"type"`
SessionId uint32 `json:"session_id"`
Time uint32 `json:"time"`
InetIp uint32 `json:"inet_ip"`
}
"poll_type": "file_message"
type EventFileSrvTransfer ¶
type EventFileSrvTransfer struct {
FromUin Uin `json:"from_uin"`
ToUin Uin `json:"to_uin"`
LcId uint32 `json:"lc_id"`
Type uint32 `json:"type"`
Operation uint32 `json:"operation"`
Now uint32 `json:"now"`
FileCount uint32 `json:"file_count"`
FileInfos struct {
FileName string `json:"file_name"`
ProId uint32 `json:"pro_id"`
FileStatus uint32 `json:"file_status"`
} `json:"file_infos"`
}
"poll_type": "filesrv_transfer"
type EventGroupMessage ¶
type EventGroupMessage struct {
FromUin Uin `json:"from_uin"`
ToUin Uin `json:"to_uin"`
MsgId uint32 `json:"msg_id"`
MsgId2 uint32 `json:"msg_id2"`
MsgType uint32 `json:"msg_type"`
ReplyIp uint32 `json:"reply_ip"`
GroupCode GCode `json:"group_code"`
SendUin Uin `json:"send_uin"`
Seq uint64 `json:"seq"`
Time uint64 `json:"time"`
InfoSeq uint64 `json:"info_seq"` // 群号
Content Content `json:"content"`
}
"poll_type": "group_message"
type EventGroupWebMessage ¶
type EventGroupWebMessage struct {
FromUin Uin `json:"from_uin"`
ToUin Uin `json:"to_uin"`
MsgId uint32 `json:"msg_id"`
MsgId2 uint32 `json:"msg_id2"`
MsgType uint32 `json:"msg_type"`
ReplyIp uint32 `json:"reply_ip"`
GroupType uint32 `json:"group_type"`
Ver uint32 `json:"ver"`
GroupCode GCode `json:"group_code"`
SendUin Uin `json:"send_uin"`
Xml string `json:"xml"`
}
"poll_type": "group_web_message"
type EventInputNotify ¶
type EventInputNotify struct {
FromUin Uin `json:"from_uin"`
ToUin Uin `json:"to_uin"`
MsgId uint32 `json:"msg_id"`
MsgId2 uint32 `json:"msg_id2"`
MsgType uint32 `json:"msg_type"`
ReplyIp uint32 `json:"reply_ip"`
}
"poll_type": "input_notify"
type EventMessage ¶
type EventMessage struct {
FromUin Uin `json:"from_uin"`
ToUin Uin `json:"to_uin"`
MsgId uint32 `json:"msg_id"`
MsgId2 uint32 `json:"msg_id2"`
MsgType uint32 `json:"msg_type"`
ReplyIp uint32 `json:"reply_ip"`
Time uint64 `json:"time"`
Content Content `json:"content"`
}
"poll_type": "message"
type EventPushOffFile ¶
type EventPushOffFile struct {
FromUin Uin `json:"from_uin"`
MsgId uint32 `json:"msg_id"`
Rkey string `json:"rkey"`
Name string `json:"name"`
Ip string `json:"ip"`
Port uint32 `json:"port"`
Size uint32 `json:"size"`
ExpireTime uint32 `json:"expire_time"`
Time uint32 `json:"time"`
}
"poll_type": "push_offfile"
type EventShakeMessage ¶
type EventShakeMessage struct {
FromUin Uin `json:"from_uin"`
ToUin Uin `json:"to_uin"`
MsgId uint32 `json:"msg_id"`
MsgId2 uint32 `json:"msg_id2"`
MsgType uint32 `json:"msg_type"`
ReplyIp uint32 `json:"reply_ip"`
}
"poll_type": "shake_message"
type EventSysGroupMessage ¶
type EventSysGroupMessage struct {
Type SysGroupMessageType `json:"type"`
NewMember string `json:"new_member"`
OldMember string `json:"old_member"`
GCode GCode `json:"gcode"`
RequestUin Uin `json:"request_uin"`
OpType string `json:"op_type"` // 0,2:取消管理员 3:成为管理员 255:群主(转让)
}
"poll_type": "sys_g_msg"
type EventSystemMessage ¶
type EventSystemMessage struct {
Type SystemMessageType `json:"type"`
FromUin Uin `json:"from_uin"`
Stat uint32 `json:"stat"`
ClientType ClientType `json:"client_type"`
GroupId GCode `json:"group_id"`
Msg string `json:"msg"`
Account Account `json:"account"`
Uiuin Uin `json:"uiuin"`
}
"poll_type": "system_message"
type Font ¶
type Font struct {
Name string `json:"name"`
Size uint32 `json:"size"`
Style []int `json:"style"`
Color string `json:"color"`
}
字体 {"name":"宋体","size":"10","style":[0,0,0],"color":"000000"}
type Friend ¶
type Friend struct {
Uin Uin `json:"uin"`
Flag int32 `json:"flag"`
Categories int32 `json:"categories"`
}
好友信息子结构
type FriendInfo ¶
type FriendInfo struct {
Uin Uin `json:"uin"`
Face uint32 `json:"face"`
Allow uint32 `json:"allow"`
Constel uint32 `json:"constel"`
Blood uint32 `json:"blood"`
Stat uint32 `json:"stat"`
VipInfo uint32 `json:"vip_info"`
Shengxiao uint32 `json:"shengxiao"`
ClientType uint32 `json:"client_type"`
Birthday Birthday `json:"birthday"`
Occupation string `json:"occupation"`
Phone string `json:"phone"`
College string `json:"college"`
Homepage string `json:"homepage"`
Country string `json:"country"`
City string `json:"city"`
Personal string `json:"personal"`
Nick string `json:"nick"`
Email string `json:"email"`
Province string `json:"province"`
Gender string `json:"gender"`
Mobile string `json:"mobile"`
}
用户信息
type FriendJar ¶
type FriendJar interface {
GetByUin(uin Uin) *FriendInfo
GetByAccount(acc Account) *FriendInfo
All() []*FriendInfo
Put(model *FriendInfo)
Detele(uin Uin)
}
储存好友信息的容器
type FrientdCategorie ¶
type FrientdCategorie struct {
Index uint32 `json:"index"`
Sort uint32 `json:"sort"`
Name string `json:"name"`
}
好友分类子结构
type FrientdInfo ¶
type FrientdInfo struct {
Uin Uin `json:"uin"`
Face uint32 `json:"face"`
Flag uint32 `json:"flag"`
Nick string `json:"nick"`
}
用户简单信息
type GroupInfo ¶
type GroupInfo struct {
Face uint32 `json:"face"`
Class uint32 `json:"class"`
Memo string `json:"memo"`
Fingermemo string `json:"fingermemo"`
Code GCode `json:"code"` // 群的信息ID gcode
Createtime uint64 `json:"createtime"`
Flag uint32 `json:"flag"`
Level uint32 `json:"level"`
Name string `json:"name"` // 群名
Gid Uin `json:"gid"` // 群的消息Uin group_uin
Owner Uin `json:"owner"` // 群主Uin
Members string `json:"members"`
}
群详细信息
type GroupJar ¶
type GroupJar interface {
GetByGin(gin GroupId) *GroupInfo
GetByGroupId(gid GroupId) *GroupInfo
All() []*GroupInfo
Detele(gin GCode)
// contains filtered or unexported methods
}
储存群信息的容器
type GroupName ¶
type GroupName struct {
Gid Uin `json:"gid"`
Code GCode `json:"code"`
Flag uint32 `json:"flag"`
Name string `json:"name"`
}
群名
type LevelDbFriendJar ¶
type LevelDbFriendJar struct {
FriendJar
// contains filtered or unexported fields
}
the implementation of FriendJar
func NewLevelDbFriendJar ¶
func NewLevelDbFriendJar(filename string) (this *LevelDbFriendJar)
func (*LevelDbFriendJar) Get ¶
func (this *LevelDbFriendJar) Get()
func (*LevelDbFriendJar) Put ¶
func (this *LevelDbFriendJar) Put()
type MemberInfo ¶
type MemberInfo struct {
Nick string `json:"nick"`
Province string `json:"province"`
Gender string `json:"gender"`
Uin Uin `json:"uin"`
Country string `json:"country"`
City string `json:"city"`
}
群成员信息
type MemberStat ¶
type MemberStat struct {
Uin Uin `json:"uin"`
ClientType ClientType `json:"client_type"`
Stat uint32 `json:"stat"`
}
群成员在线信息
type RawEvent ¶
type RawEvent json.RawMessage
type ResultAllowInfo ¶
type ResultAllowInfo struct {
Code int `json:"retcode"`
Result struct {
Allow uint32 `json:"allow"`
} `json:"result"`
}
好友验证类型 result结构
type ResultBatchGetVipInfo ¶
type ResultBatchGetVipInfo struct {
Code int `json:"retcode"`
Result struct {
VipInfo []VipInfo `json:"vipinfo"`
} `json:"result"`
}
获取VIP信息 result结构
type ResultC2CMsgSig ¶
type ResultC2CMsgSig struct {
Code int `json:"retcode"`
Result struct {
Type uint32 `json:"type"`
Value string `json:"value"`
Flags struct {
Text uint8 `json:"text"`
Pic uint8 `json:"pic"`
File uint8 `json:"file"`
Audio uint8 `json:"audio"`
Video uint8 `json:"video"`
} `json:"flags"`
} `json:"result"`
}
获取临时会话Sig result结构
type ResultCreateDiscu ¶
type ResultCreateDiscu struct {
Code int `json:"retcode"`
Result struct {
Result uint32 `json:"result"`
DiscuId DiscuId `json:"did"`
} `json:"result"`
}
创建讨论组 result结构
type ResultDiscuInfo ¶
type ResultDiscuInfo struct {
Code int `json:"retcode"`
Result struct {
Info struct {
DiscuId DiscuId `json:"did"`
DiscuOwner Uin `json:"discu_owner"`
DiscuName string `json:"discu_name"`
InfoSeq string `json:"info_seq"` // 信息序列号
MemberList []struct {
Uin Uin `json:"mem_uin"`
Account Account `json:"ruin"`
} `json:"mem_list"`
} `json:"info"`
MemberStatus []MemberStat `json:"mem_status"`
MemberInfo struct {
Uin Uin `json:"uin"`
Nick string `json:"nick"`
} `json:"mem_info"`
} `json:"result"`
}
获取讨论组信息 result结构
type ResultDiscusList ¶
type ResultDiscusList struct {
Code int `json:"retcode"`
Result struct {
Dnamelist []interface{} `json:"dnamelist"`
} `json:"result"`
}
讨论组列表 result结构
type ResultFriendInfo ¶
type ResultFriendInfo struct {
Code int `json:"retcode"`
Result FriendInfo `json:"result"`
}
获取好友信息 result结构
type ResultFriendUin ¶
type ResultFriendUin struct {
Code int `json:"retcode"`
Result struct {
Uin Uin `json:"uin"`
Account Account `json:"account"`
Uiuin string `json:"uiuin"`
} `json:"result"`
}
获取显示ID result结构
type ResultGfaceSig ¶
type ResultGfaceSig struct {
Code int `json:"retcode"`
Result struct {
Reply uint32 `json:"reply"`
GfaceKey string `json:"gface_key"`
GfaceSig string `json:"gface_sig"`
} `json:"result"`
}
发送群聊图片Sig result结构
type ResultGroupInfo ¶
type ResultGroupInfo struct {
Code int `json:"retcode"`
Result []struct {
Memo string `json:"memo"`
GCode GCode `json:"gcode"`
} `json:"result"`
}
群信息 result结构
type ResultGroupInfoExt ¶
type ResultGroupInfoExt struct {
Code int `json:"retcode"`
Result struct {
Stats []MemberStat `json:"stats"`
MemberInfos []MemberInfo `json:"minfo"`
GroupInfo GroupInfo `json:"ginfo"`
Cards []Card `json:"cards"`
VipInfo []VipInfo `json:"vipinfo"`
} `json:"result"`
}
群详细信息 result结构
type ResultGroupMemberStat ¶
type ResultGroupMemberStat struct {
Code int `json:"retcode"`
Result struct {
Stats []MemberStat
} `json:"result"`
}
群成员在线信息 result结构
type ResultGroupNameListMask ¶
type ResultGroupNameListMask struct {
Code int `json:"retcode"`
Result struct {
GroupMasks []interface{} `json:"gmasklist"` // TODO
GroupNames []GroupName `json:"gnamelist"`
GroupMarks []MarkName `json:"gmarklist"`
} `json:"result"`
}
群列表 result结构
type ResultLogin2 ¶
type ResultLogin2 struct {
Code int `json:"retcode"`
Msg string `json:"errmsg"`
Result struct {
Uin Uin `json:"uin"`
VerifyCode string `json:"vfwebqq"`
SessionId string `json:"psessionid"`
Status string `json:"status"`
} `json:"result"`
}
登录 返回值结构
type ResultOfflinePic ¶
type ResultOfflinePic struct {
Code int32 `json:"retcode"`
Result string `json:"result"`
Progress int32 `json:"progress"`
Filesize int32 `json:"filesize"`
Filename int32 `json:"filename"`
Filepath int32 `json:"filepath"`
}
上传离线图片 result结构
type ResultOfflinePicDl ¶
type ResultOfflinePicDl struct {
Code int `json:"retcode"`
Result struct {
Success uint32 `json:"success"`
FilePath string `json:"file_path"`
// contains filtered or unexported fields
} `json:"result"`
}
发送离线图片 result结构
type ResultOnlineBuddies ¶
type ResultOnlineBuddies struct {
Code int `json:"retcode"`
Result []struct {
Uin Uin `json:"uin"`
Status string `json:"status"`
ClientType uint32 `json:"client_type"`
} `json:"result"`
}
在线好友result结构
type ResultPoll ¶
type ResultPoll struct {
Code int `json:"retcode"`
Msg string `json:"errmsg"`
Result []struct {
Type string `json:"poll_type"`
Value json.RawMessage `json:"value"` // see WebQQ.event.go
} `json:"result"`
}
poll2 result结构
type ResultQQLevel ¶
type ResultQQLevel struct {
Code int `json:"retcode"`
Result struct {
Uin Uin `json:"tuin"`
Level uint32 `json:"level"`
Days uint32 `json:"days"`
Hours uint32 `json:"hours"`
RemainDays uint32 `json:"remainDays"`
} `json:"result"`
}
获取等级 result结构
type ResultRecentList ¶
type ResultRecentList struct {
Code int `json:"retcode"`
Result []struct {
Uin Uin `json:"uin"`
Type uint32 `json:"type"`
} `json:"result"`
}
当前聊天列表result结构
type ResultSelfBusinessCard ¶
type ResultSelfBusinessCard struct {
Code int `json:"retcode"`
Result struct {
} `json:"result"`
}
自己群名片 result结构
type ResultSingleLongNick ¶
type ResultSingleLongNick struct {
Code int `json:"retcode"`
Result []struct {
Uin Uin `json:"uin"`
LongNick string `json:"lnick"`
} `json:"result"`
}
获取签名 result结构
type ResultStrangerInfo ¶
type ResultStrangerInfo struct {
Code int `json:"retcode"`
Result FriendInfo `json:"result"`
}
获取陌生人信息 result结构
type ResultUserFrientds ¶
type ResultUserFrientds struct {
Code int `json:"retcode"`
Result struct {
Friends []Friend `json:"friends"`
Marknames []MarkName `json:"marknames"`
Categories []FrientdCategorie `json:"categories"`
VipInfo []VipInfo `json:"vipinfo"`
Info []FrientdInfo `json:"info"`
} `json:"result"`
}
获取好友列表 result结构
type SysGroupMessageType ¶
type SysGroupMessageType string
type SystemMessageType ¶
type SystemMessageType string
type VipInfo ¶
type VipInfo struct {
VipLevel string `json:"vip_level"`
Uin Uin `json:"u"`
IsVip string `json:"is_vip"`
}
会员信息
type WebQQ ¶
type WebQQ struct {
Id Account
Uin Uin
// 公有
Friends FriendJar
Groups GroupJar
CustomFaces CustomFaceJar
OfflinePics OfflinePicJar
// contains filtered or unexported fields
}
WebQQ对象
func (*WebQQ) SendSingle ¶
func (this *WebQQ) SendSingle(to Uin, m ContentModel) (err error)
给Uin发送消息
func (*WebQQ) UploadCustomFace ¶
上传自定义表情
func (*WebQQ) UploadOfflinePic ¶
上传离线图片
type WebQQCustomPic ¶
type WebQQCustomPic struct {
}
type WebQQGroup ¶
type WebQQGroup struct {
}