Documentation
¶
Index ¶
- Constants
- Variables
- type Api
- func (api *Api) AddFavFromImage(wxId string, imagePath string) error
- func (api *Api) AddFavFromMsg(msgId string) error
- func (api *Api) AddMemberToChatRoom(chatRoomId string, members ...string) error
- func (api *Api) CheckLogin() (bool, error)
- func (api *Api) Close() error
- func (api *Api) ConfirmFriendRequest(encryptUsername, ticket string, permission int) error
- func (api *Api) DecodeImage(src, storeDir string) error
- func (api *Api) DelMemberFromChatRoom(chatRoomId string, members ...string) error
- func (api *Api) DownloadAttach(msgId string) error
- func (api *Api) ExecSql(dbHandle int64, sql string) ([][]string, error)
- func (api *Api) ForwardMsg(wxid, msgId string) error
- func (api *Api) ForwardPublicMsg(appName, userName, title, url, thumbUrl, digest, wxid string) error
- func (api *Api) ForwardPublicMsgByMsgId(wxId string, msgId string) error
- func (api *Api) GetAvatars(wxids []string) (map[string]string, error)
- func (api *Api) GetChatRoomDetailInfo(chatRoomId string) (*proto.ChatroomDetail, error)
- func (api *Api) GetContactList() ([]proto.ContactInfo, error)
- func (api *Api) GetContactNickname(wxidOrGroupId string) (string, error)
- func (api *Api) GetContactProfile(wxid string) (*proto.ContactProfile, error)
- func (api *Api) GetDBInfo() ([]*proto.DbInfo, error)
- func (api *Api) GetMemberFromChatRoom(chatRoomId string, decryptNickname bool) (*proto.ChatroomMember, error)
- func (api *Api) GetNicknameFromChatRoom(chatRoomId, memberId string) (string, error)
- func (api *Api) GetSNSNextPage() error
- func (api *Api) GetSnsFirstPage() error
- func (api *Api) GetUserInfo() (*proto.WxUserInfo, error)
- func (api *Api) GetVoiceByMsgId(msgId, storeDir string) error
- func (api *Api) HookMsg(port int) error
- func (api *Api) InviteMemberToChatRoom(chatRoomId string, members ...string) error
- func (api *Api) ModifyChatroomNickname(chatRoomId, wxid, nickName string) error
- func (api *Api) Ocr(imagePath string) (string, error)
- func (api *Api) RemoveTopMsg(chatRoomId, msgId string) error
- func (api *Api) SendApplet(req *proto.SendAppletMsgReq) error
- func (api *Api) SendAtAllText(chatRoomId string, msg string) error
- func (api *Api) SendAtText(chatRoomId string, msg string, wxids ...string) error
- func (api *Api) SendCustomEmotion(wxid, filePath string) error
- func (api *Api) SendFileMsg(wxid, filePath string) error
- func (api *Api) SendImagesMsg(wxid, imagePath string) error
- func (api *Api) SendPatMsg(wxid string, receiver string) error
- func (api *Api) SendTextMsg(wxid, msg string) error
- func (api *Api) SetMsgCallback(callback func(bs []byte)) error
- func (api *Api) TopMsg(msgId string) error
- func (api *Api) UnHookMsg() error
- type ApiUrl
- type ApiVersion
- type MsgListenServer
Constants ¶
View Source
const ( CheckLoginUrl = iota UserInfoUrl SendTextMsgUrl SendAtTextUrl SendImagesMsgUrl SendFileMsgUrl SendCustomEmotionUrl SendAppletUrl SendPatMsgUrl SearchFriend FriendRequest ConfirmFriendRequest OcrUrl ForwardMsgUrl HookSyncMsgUrl UnHookSyncMsgUrl HookAudioMsgUrl UnHookAudioMsgUrl GetContactListUrl GetContactProfileUrl GetContactNicknameUrl //转账相关 ConfirmTransfer // db操作 GetDBInfoUrl ExecSqlUrl // 公众号相关 ForwardPublicMsgByMsgIdUrl ForwardPublicMsgUrl // 群操作 GetChatRoomDetailInfoUrl GetMemberFromChatRoomUrl GetNicknameFromChatRoomUrl AddMemberToChatRoomUrl ModifyNicknameUrl DelMemberFromChatRoomUrl TopMsgUrl RemoveTopMsgUrl InviteMemberToChatRoomUrl // 朋友圈相关,朋友圈首页,前置条件需先调用hook消息接口成功,具体内容会在hook消息里返回,格式如下: /** { "data":[ { "content": "", "createTime': 1691125287, "senderId': "", "snsId': 123, "xml':"" } ] } */ GetSNSFirstPageUrl GetSNSNextPageUrl // 收藏相关 AddFavFromMsgUrl AddFavFromImageUrl // 附件相关 DownloadAttachUrl DecodeImageUrl GetVoiceByMsgIdUrl )
Variables ¶
View Source
var (
ErrMethodNotImplement = errors.New("方法未实现")
)
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct { BaseUrl string ApiVersion ApiVersion MsgListenInstance *MsgListenServer }
func NewApi ¶
func NewApi(apiVersion ApiVersion, baseUrl string) *Api
func (*Api) AddFavFromMsg ¶
func (*Api) AddMemberToChatRoom ¶
func (*Api) CheckLogin ¶
func (*Api) ConfirmFriendRequest ¶
ConfirmFriendRequest permission 好友权限,0.全部 8.仅聊天。(好友超过5000人后,会验证权限,传8即可)
func (*Api) DecodeImage ¶
func (*Api) DelMemberFromChatRoom ¶
func (*Api) DownloadAttach ¶
下载附件,保存在微信文件目录下 wxid_xxx/wxhelper 目录下
func (*Api) ForwardMsg ¶
func (*Api) ForwardPublicMsg ¶
func (api *Api) ForwardPublicMsg(appName, userName, title, url, thumbUrl, digest, wxid string) error
appName string 公众号id,消息内容里的appname userName string 公众号昵称,消息内容里的username title string 链接地址,消息内容里的title url string 链接地址,消息内容里的url thumbUrl string 缩略图地址,消息内容里的thumburl digest string 摘要,消息内容里的digest wxid string wxid
func (*Api) ForwardPublicMsgByMsgId ¶
func (*Api) GetChatRoomDetailInfo ¶
func (api *Api) GetChatRoomDetailInfo(chatRoomId string) (*proto.ChatroomDetail, error)
GetChatRoomDetailInfoUrl param chatRoomId: "12222@chatroom"
func (*Api) GetContactList ¶
func (api *Api) GetContactList() ([]proto.ContactInfo, error)
func (*Api) GetContactNickname ¶
func (*Api) GetContactProfile ¶
func (api *Api) GetContactProfile(wxid string) (*proto.ContactProfile, error)
func (*Api) GetMemberFromChatRoom ¶
func (*Api) GetNicknameFromChatRoom ¶
func (*Api) GetSNSNextPage ¶
func (*Api) GetSnsFirstPage ¶
func (*Api) GetUserInfo ¶
func (api *Api) GetUserInfo() (*proto.WxUserInfo, error)
func (*Api) GetVoiceByMsgId ¶
func (*Api) InviteMemberToChatRoom ¶
func (*Api) ModifyChatroomNickname ¶
func (*Api) RemoveTopMsg ¶
func (*Api) SendApplet ¶
func (api *Api) SendApplet(req *proto.SendAppletMsgReq) error
发送小程序(待完善,不稳定),相关参数可以参考示例的滴滴小程序的内容自行组装。
func (*Api) SendAtText ¶
func (*Api) SendCustomEmotion ¶
表情路径,可以直接查询CustomEmotion表的MD5字段 "filePath":"C:\\wechatDir\\WeChat Files\\wxid_123\\FileStorage\\CustomEmotion\\8F\\8F6423BC2E69188DCAC797E279C81DE9"
func (*Api) SendFileMsg ¶
func (*Api) SendImagesMsg ¶
func (*Api) SendPatMsg ¶
wxid string 被拍人id receiver string 接收人id,可以是自己wxid,私聊好友wxid,群id
func (*Api) SendTextMsg ¶
func (*Api) SetMsgCallback ¶
type ApiVersion ¶
type ApiVersion int
const ( ApiVersionV1 ApiVersion = 1 ApiVersionV2 ApiVersion = 2 )
Click to show internal directories.
Click to hide internal directories.