ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
processor.php文件内 ~~~ $account_api = WeAccount::create(); $info = $account_api->fansQueryInfo($this->message['from']); $userinfo=mc_fansinfo($openid); 文本 $this->message = array( 'tousername' => 'toUser' 'fromusername' => 'fromUser' 'createtime' => '123456789' 'msgtype' => 'text' // string: 消息类型 'content' => // string: 文本消息内容 'redirection' => false, // bool: 是否是重定向 'source' => null // string: 消息来源, 消息二次分析(目前来源:qr,click, 将扫码等事件转换为 text 事件.) ) 图片 $this->message = array( 'tousername' => 'toUser' 'fromusername' => 'fromUser' 'createtime' => '123456789' 'msgtype' => 'image' // string: 消息类型 'picurl' => '' // string: 图片链接 'mediaid' => '' // long: 图片消息媒体id 'url' => '' ); 位置 $this->message = array( 'tousername' => 'toUser' 'fromusername' => 'fromUser' 'createtime' => '123456789' 'msgtype' => 'location' // string: 消息类型 'location_x' => '' // float: 地理位置纬度 'location_y' => '' // float: 地理位置经度 'scale' => '' // float: 地图缩放大小 'label' => '' // string: 地理位置信息 ) 菜单单机 $this->message = array( 'tousername' => 'toUser' 'fromusername' => 'fromUser' 'createtime' => '123456789' 'msgtype' => 'event' 'eventkey' => 'EVENTKEY' // string: 模拟的关键字 ) 上报位置 $this->message = array( 'tousername' => 'toUser' 'fromusername' => 'fromUser' 'createtime' => '123456789' 'msgtype' => 'event' 'latitude' => '' // string: 地理位置纬度 'longitude' => '' // string: 地理位置经度 'precision' => '' // string: 地理位置精度 'location_x' => ? ⇔ location_x // 原始值 'location_y' => ? ⇔ location_y // 原始值 ) 扫码 $this->message = array( 'tousername' => 'toUser' 'fromusername' => 'fromUser' 'createtime' => '123456789' 'msgtype' => 'event' 'eventkey' => '' // 事件KEY值,由开发者在创建菜单时设定 'scancodeinfo' => array( // 扫描信息 'scanresult' => '1' // 扫描结果,即二维码对应的字符串信息 'scantype' => 'qrcode' // 扫描类型,一般是qrcode 'eventkey' => ) ) 发图像相册拍照 $view_message = array( 'tousername' => 'toUser' 'fromusername' => 'fromUser' 'createtime' => '123456789' 'msgtype' => 'event' 'eventkey' => '' // 事件KEY值,由开发者在创建菜单时设定 'sendpicsinfo' => array( // 发送的图片信息 'count' => '1' // 发送的图片数量 'piclist' => array( // 图片列表 '0' => '' // 图片的MD5值,开发者若需要,可用于验证接收到图片 ) ) ) 配置获取 $this->module['config'] $this->respText($text); $news[] = [ 'title' =>'', 'description' =>'', 'picurl' =>tomedia(), 'url' =>$this->createMobileUrl('introduce', array('id' => $rid)) ] } $this->respNews($news); $arr =[ 'title' => $title, 'description' => $desc, 'musicurl' => $url1, 'hqmusicurl' => $url1, 'thumb' => '', ]; $this->respMusic($arr); $this->respImage($mid) ~~~ 信息 ~~~ [message] => stdClass Object ( [tousername] => gh_0c65a0b2e150 [fromusername] => oY8ebt8ALfZ9Rk_yGXgyOA0KzWW8 [createtime] => 1463687403 [msgtype] => location [location_x] => 33.143911 [location_y] => 106.704777 [scale] => 15 [label] => 汉中市勉县勉阳镇九龙新城南200米(旧仓路东) [msgid] => 6286489527858875403 [from] => oY8ebt8ALfZ9Rk_yGXgyOA0KzWW8 [to] => gh_0c65a0b2e150 [time] => 1463687403 [type] => location [event] => ) [message] => Array ( [tousername] => gh_0c65a0b2e150 [fromusername] => oY8ebt8ALfZ9Rk_yGXgyOA0KzWW8 [createtime] => 1479141525 [msgtype] => image [picurl] => http://mmbiz.qpic.cn/mmbiz_jpg/WAibKjHvK5nGI3Uibv58s94j6xsDpVMDcUNmGuN6TSpoGmRtzm7jEaVk262Lebw3mhTyEibjQrPibEHhDiakpRrb9bQ/0 [msgid] => 6352864476440140193 [mediaid] => LHBxI5GA10TnUqueuBpfc8Df4fsOboSZshdDQj9FNAfdD4mif-vtHYVPLGfjqWTh [from] => oY8ebt8ALfZ9Rk_yGXgyOA0KzWW8 [to] => gh_0c65a0b2e150 [time] => 1479141525 [type] => text [event] => pic_weixin [url] => http://mmbiz.qpic.cn/mmbiz_jpg/WAibKjHvK5nGI3Uibv58s94j6xsDpVMDcUNmGuN6TSpoGmRtzm7jEaVk262Lebw3mhTyEibjQrPibEHhDiakpRrb9bQ/0 [content] => 创建新相册 [eventkey] => 创建新相册 [redirection] => 1 [source] => pic_weixin ) [message] => Array ( [tousername] => gh_0c65a0b2e150 [fromusername] => oY8ebt8ALfZ9Rk_yGXgyOA0KzWW8 [createtime] => 1479141764 [msgtype] => image [picurl] => http://mmbiz.qpic.cn/mmbiz_jpg/WAibKjHvK5nGI3Uibv58s94j6xsDpVMDcUNmGuN6TSpoGmRtzm7jEaVk262Lebw3mhTyEibjQrPibEHhDiakpRrb9bQ/0 [msgid] => 6352865502937323979 [mediaid] => hsvoscAavkRQ3OM_fUHZt3-37vCjekY1BKr_MP7yB3Z9DO4fyfp65Z8TREgOPMOe [from] => oY8ebt8ALfZ9Rk_yGXgyOA0KzWW8 [to] => gh_0c65a0b2e150 [time] => 1479141764 [type] => text [event] => pic_photo_or_album [url] => http://mmbiz.qpic.cn/mmbiz_jpg/WAibKjHvK5nGI3Uibv58s94j6xsDpVMDcUNmGuN6TSpoGmRtzm7jEaVk262Lebw3mhTyEibjQrPibEHhDiakpRrb9bQ/0 [content] => 添加照片 [eventkey] => 添加照片 [redirection] => 1 [source] => pic_photo_or_album ) ~~~