Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
hfpp2012
/
vbot
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 808ec627
authored
Mar 19, 2017
by
HanSon
Committed by
GitHub
Mar 19, 2017
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update README.md
1 parent
c4730bae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
11 deletions
README.md
README.md
View file @
808ec62
...
...
@@ -76,25 +76,16 @@ $robot = new Vbot([
'debug' => true # 用于是否输出用户组的json
]);
// 图灵自动回复
function reply($str){
return http()->post('http://www.tuling123.com/openapi/api', [
'key' => '1dce02aef026258eff69635a06b0ab7d',
'info' => $str
], true)['text'];
}
$robot->server->setMessageHandler(function($message){
// 文字信息
if ($message instanceof Text) {
/** @var $message Text */
// 联系人自动回复
if ($message->fromType === 'Contact') {
return
reply($message->content)
;
return
'hello vbot'
;
// 群组@我回复
} elseif ($message->fromType === 'Group' && $message->isAt) {
return
reply($message->content)
;
return
'hello everyone'
;
}
}
});
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment