之前做了一個淘寶客返利微信公眾號,后來很多人提到過微信返利機(jī)器人,現(xiàn)在微信助手開發(fā)好了,可以通過微信助手接口功能實現(xiàn)微信返利機(jī)器人。
流程如下:

下面是c#實現(xiàn)返利接口的部分代碼:
[HttpPost]
public async TaskActionResult> FanliAsync(string appkey)
{
WeixinTBKConfigEntity configEntity = GetConfigEntity(appkey);
if (configEntity == null)
{
LogHelper.WriteLog(typeof(OtherWechatController), "appkey接口驗證時,appkey不存在");
return Content("驗證失敗。appkey接口驗證時,appkey不存在");
}
Request.InputStream.Position = 0;
Stream stream = Request.InputStream;
string json = string.Empty;
if (stream.Length != 0)
{
StreamReader streamreader = new StreamReader(stream);
json = streamreader.ReadToEnd();
}
WeChatToolMessage responseMsg = new WeChatToolMessage();
if (string.IsNullOrEmpty(json))
{
return Json(responseMsg);
}
WeChatToolMessage msg = JsonConvert.DeserializeObjectWeChatToolMessage>(json);
if (string.IsNullOrEmpty(msg.wxid) || string.IsNullOrEmpty(msg.content))
{
return Json(responseMsg);
}
string content = msg.content;
string responseStr = string.Empty;
if (content.Contains("yangkeduo.com"))
{
//訪問拼多多接口
responseStr = await GetPddCouponAsync(configEntity, msg);
}
else if (content.Contains("jd.com"))
{
if (!string.IsNullOrEmpty(configEntity.JdPID))
{
//訪問京東聯(lián)盟接口
responseStr = GetJdCoupon(configEntity, msg);
}
}
else
{
//訪問淘寶聯(lián)盟接口
responseStr = GetTBKCouponByPassword(configEntity, msg.content);
}
responseMsg.wxid = msg.wxid;
responseMsg.content = responseStr;
return Json(responseMsg);
}
發(fā)布接口之后將接口地址填入微信助手“自動回復(fù)”菜單url輸入框中,如下圖所示:

下面就可以開始查券了,是不是很簡單。


微信助手可以到這里下載:http://blog.yshizi.cn/104.html
需要返利接口請加微信znana2019
總結(jié)
以上所述是小編給大家介紹的使用微信助手搭建微信返利機(jī)器人流程,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
如果你覺得本文對你有幫助,歡迎轉(zhuǎn)載,煩請注明出處,謝謝!
您可能感興趣的文章:- python實現(xiàn)微信機(jī)器人: 登錄微信、消息接收、自動回復(fù)功能
- 手把手教你使用Python創(chuàng)建微信機(jī)器人
- 詳解用python自制微信機(jī)器人,定時發(fā)送天氣預(yù)報
- 教你用Python創(chuàng)建微信聊天機(jī)器人
- python使用itchat庫實現(xiàn)微信機(jī)器人(好友聊天、群聊天)
- 快速實現(xiàn)基于Python的微信聊天機(jī)器人示例代碼
- python基于itchat實現(xiàn)微信群消息同步機(jī)器人
- 使用圖靈api創(chuàng)建微信聊天機(jī)器人