Documentation
¶
Index ¶
- type ConfirmAuthEventData
- type Contact
- type ContactDeleteEventData
- type ContactModifyEventData
- type ContactType
- type ContactsInitEventData
- type Event
- type EventType
- type GenUuidEventData
- type InitEventData
- type ListenFailedEventData
- type LocationInfo
- type LoginEventData
- type MediaType
- type Member
- type MessageEventData
- type MessageType
- type Response
- type ScanCodeEventData
- type SenderUserInfo
- type WeChat
- func (weChat *WeChat) Login() error
- func (weChat *WeChat) Logout()
- func (weChat *WeChat) Run() error
- func (weChat *WeChat) SendAppMsg(toUserName string, mediaId string, filename string, fileSize int64, ext string) error
- func (weChat *WeChat) SendImgMsg(toUserFrom string, mediaId string) error
- func (weChat *WeChat) SendTextMsg(content string, to string) (bool, error)
- func (weChat *WeChat) SetListener(eventType EventType, listener func(Event))
- func (weChat *WeChat) UploadMedia(buf []byte, mediaType MediaType, fileType string, fileInfo os.FileInfo, ...) (string, error)
- func (weChat *WeChat) VerifyUser(userName string, ticket string, verifyUserContent string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contact ¶
type Contact struct {
Uin float64
UserName string
NickName string
HeadImgUrl string
ContactFlag float64
MemberCount float64
MemberList []*Member
MemberMap map[string]*Member
RemarkName string
HideInputBarFlag float64
Sex float64
Signature string
VerifyFlag float64
PYInitial string
PYQuanPin string
RemarkPYInitial string
RemarkPYQuanPin string
StarFriend float64
AppAccountFlag float64
Statues float64
AttrStatus float64
Province string
City string
Alias string
SnsFlag float64
UniFriend float64
DisplayName string
ChatRoomId float64
KeyWord string
EncryChatRoomId string
IsOwner float64
Type ContactType
}
联系人
type ContactType ¶
type ContactType int
联系人类型
const ( Official ContactType // 公众号 Friend // 好友 Group // 群组 )
type EventType ¶
type EventType int
事件类型
const ( GEN_UUID_EVENT EventType // 生成Uuid SCAN_CODE_EVENT // 已扫码,未确认 CONFIRM_AUTH_EVENT // 已确认授权登录 LOGIN_EVENT // 已登录 INIT_EVENT // 初始化完成 CONTACTS_INIT_EVENT // 联系人初始化完 LISTEN_FAILED_EVENT // 同步微信失败,可能为客户端已退出 | 被微信反爬虫 CONTACT_MODIFY_EVENT // 联系人改变了 CONTACT_DELETE_EVENT // 联系人删除事件 MESSAGE_EVENT // 消息 )
type ListenFailedEventData ¶
同步微信失败事件数据
type Member ¶
type Member struct {
Uin float64
UserName string
NickName string
AttrStatus float64
PYInitial string
PYQuanPin string
RemarkPYInitial string
RemarkPYQuanPin string
MemberStatus float64
DisplayName string
KeyWord string
}
群组成员
type MessageEventData ¶
type MessageEventData struct {
MessageType MessageType
IsGroupMessage bool
IsSendByMySelf bool
IsAtMe bool
MediaUrl string
Content string
FromUserName string
FromUserInfo Contact
SenderUserInfo SenderUserInfo
SenderUserId string // 根据SendUserName生成ID
ToUserName string
ToUserInfo Contact
RecommendInfo map[string]interface{}
LocationInfo LocationInfo
OriginalMsg map[string]interface{}
}
消息事件数据
type MessageType ¶
type MessageType int
消息类型
const ( TextMessage MessageType ImgMessage VoiceMessage VideoMessage CardMessage LocationMessage FriendReqMessage )
type WeChat ¶
type WeChat struct {
Uuid string
// contains filtered or unexported fields
}
func (*WeChat) SendAppMsg ¶
func (weChat *WeChat) SendAppMsg(toUserName string, mediaId string, filename string, fileSize int64, ext string) error
发送文件消息
func (*WeChat) SendImgMsg ¶
发送图片消息
func (*WeChat) SendTextMsg ¶
func (*WeChat) SetListener ¶
设置事件监听器
Source Files
¶
Click to show internal directories.
Click to hide internal directories.