Commit b4bba072 by HanSon

设计模块

1 parent b3458256
* Groups 群组 (group_list & group_user)
* Public 公众号
* Special 特殊账号
* Contact (公众号 & 联系人)
\ No newline at end of file
# Created by .ignore support plugin (hsz.mobi)
......@@ -119,6 +119,8 @@ class Robot
$this->log('[INFO] 获取 ' . count($this->contactList) . ' 个联系人');
$this->log('[INFO] 开始获取信息');
$this->processMsg();
}
/**
......@@ -403,12 +405,14 @@ class Robot
if(in_array($retCode, ['1100', '1101'])){ # 微信客户端上登出或者其他设备登录
break;
}elseif ($retCode == '0'){
if($selector == 2){
$msg = $this->sync();
if($msg !== null){
$this->handleMsg($msg);
}
}
// if($selector == 2){
// $msg = $this->sync();
// if($msg !== null){
// $this->handleMsg($msg);
// }
// }
$msg = $this->sync();
$this->log('[MSG]' . json_encode($msg));
}
}
}
......@@ -618,7 +622,11 @@ class Robot
$msgPrefix = isset($msgContent['user']) ? $msgContent['user']['name'] . ':' : '';
if($msg['MsgType'] == 1){
if(strstr($content, 'http://weixin.qq.com/cgi-bin/redirectforward?args=') !== false){
}
}
}
public function getGroupMemberPreferName($name)
......
......@@ -8,7 +8,26 @@
require_once __DIR__ . './../vendor/autoload.php';
$robot = new \Hanson\Robot\Robot(['tmp' => realpath('./tmp') . '/']);
echo $robot->run();
$robot = new \Hanson\Robot\Robot([
'tmp' => realpath('./tmp') . '/',
'debug' => true,
'tuling' => true,
'tuling_key' => ''
]);
$robot->setMessageHandler(function($message){
if($message->type === 'text'){
}elseif ($message->type === 'location'){
return Message::make();
}
if($message->FromUserName === ''){
# do something;
}
});
$robot->run();
echo 'finish';
//echo $robot->uuid;
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!