c/c++语言开发共享使用微信助手搭建微信返利机器人

之前做了一个淘宝客返利微信公众号,后来很多人提到过微信返利机器人,现在微信助手开发好了,可以通过微信助手接口功能实现微信返利机器人。 流程如下: 下面是c 实现返利接口的部分代码: [HttpPost] public async Task FanliAsync(string appkey) { We …

之前做了一个淘宝客返利微信公众号,后来很多人提到过微信返利机器人,现在微信助手开发好了,可以通过微信助手接口功能实现微信返利机器人。
流程如下:
使用微信助手搭建微信返利机器人

下面是c#实现返利接口的部分代码:

    [httppost]     public async task<actionresult> 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.deserializeobject<wechattoolmessage>(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))             {                 //访问京东联盟接口                 responsestr = getjdcoupon(configentity, msg);             }               }          else         {             //访问淘宝联盟接口             responsestr = gettbkcouponbypassword(configentity, msg.content);         }          responsemsg.wxid = msg.wxid;         responsemsg.content = responsestr;          return json(responsemsg);     }

发布接口之后将接口地址填入微信助手“自动回复”菜单url输入框中,如下图所示:
使用微信助手搭建微信返利机器人

下面就可以开始查券了,是不是很简单。

使用微信助手搭建微信返利机器人
使用微信助手搭建微信返利机器人

微信助手可以到这里下载:
需要返利接口请加微信znana2019

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/c-cdevelopment/601851.html

(0)
上一篇 2021年5月11日
下一篇 2021年5月11日

精彩推荐