WeChatFerry/SDK/sdk.h

39 lines
1.1 KiB
C
Raw Normal View History

2022-08-06 21:44:26 +08:00
#pragma once
2021-02-12 23:21:57 +08:00
#include <functional>
#include <map>
#include <string>
using namespace std;
typedef struct WxMessage {
int self; // 是否自己发的消息0=否1=是
int type; // 消息类型
int source; // 消息来源0=好友消息1=群消息
wstring id; // 消息ID
wstring xml; // 群其他消息
wstring wxId; // 发送人微信ID
wstring roomId; // 群ID
wstring content; // 消息内容MAC版最大16384即16KB
} WxMessage_t;
2021-08-28 08:33:24 +08:00
typedef struct WxContact {
wstring wxId;
wstring wxCode;
wstring wxName;
wstring wxCountry;
wstring wxProvince;
wstring wxCity;
wstring wxGender;
} WxContact_t;
2021-02-12 23:21:57 +08:00
typedef map<int, wstring> MsgTypesMap_t;
2021-08-28 08:33:24 +08:00
typedef map<wstring, WxContact_t> ContactMap_t;
2021-02-12 23:21:57 +08:00
int WxInitSDK();
int WxSetTextMsgCb(const std::function<int(WxMessage_t)> &onMsg);
int WxSendTextMsg(wstring wxid, wstring at_wxid, wstring msg);
2021-08-22 21:57:16 +08:00
int WxSendImageMsg(wstring wxid, wstring path);
2021-08-28 08:33:24 +08:00
ContactMap_t WxGetContacts();
2021-02-12 23:21:57 +08:00
MsgTypesMap_t WxGetMsgTypes();