之前做了一個(gè)淘寶客返利微信公眾號(hào),后來很多人提到過微信返利機(jī)器人,現(xiàn)在微信助手開發(fā)好了,可以通過微信助手接口功能實(shí)現(xiàn)微信返利機(jī)器人。
流程如下:
![](/d/20211017/42c276b2019f73637bdb8e1a6f5dad22.gif)
下面是c#實(shí)現(xiàn)返利接口的部分代碼:
[HttpPost]
public async TaskActionResult> FanliAsync(string appkey)
{
WeixinTBKConfigEntity configEntity = GetConfigEntity(appkey);
if (configEntity == null)
{
LogHelper.WriteLog(typeof(OtherWechatController), "appkey接口驗(yàn)證時(shí),appkey不存在");
return Content("驗(yàn)證失敗。appkey接口驗(yàn)證時(shí),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ā)布接口之后將接口地址填入微信助手“自動(dòng)回復(fù)”菜單url輸入框中,如下圖所示:
![](/d/20211017/a52581e75a4efb1acf157c050bfa0d0d.gif)
下面就可以開始查券了,是不是很簡(jiǎn)單。
![](/d/20211017/df07fe49ad0cc16a36777090bfb6291f.gif)
![](/d/20211017/f0dfefedab882dea1d8c3556f4cdfedf.gif)
微信助手可以到這里下載:http://blog.yshizi.cn/104.html
需要返利接口請(qǐng)加微信znana2019
總結(jié)
以上所述是小編給大家介紹的使用微信助手搭建微信返利機(jī)器人流程,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
如果你覺得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!
您可能感興趣的文章:- python實(shí)現(xiàn)微信機(jī)器人: 登錄微信、消息接收、自動(dòng)回復(fù)功能
- 手把手教你使用Python創(chuàng)建微信機(jī)器人
- 詳解用python自制微信機(jī)器人,定時(shí)發(fā)送天氣預(yù)報(bào)
- 教你用Python創(chuàng)建微信聊天機(jī)器人
- python使用itchat庫(kù)實(shí)現(xiàn)微信機(jī)器人(好友聊天、群聊天)
- 快速實(shí)現(xiàn)基于Python的微信聊天機(jī)器人示例代碼
- python基于itchat實(shí)現(xiàn)微信群消息同步機(jī)器人
- 使用圖靈api創(chuàng)建微信聊天機(jī)器人