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 ea0b5702
authored
Jan 20, 2017
by
HanSon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改获取路径
1 parent
11a8e84c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
README.md
composer.lock
example/index.php
src/Message/MediaTrait.php
README.md
View file @
ea0b570
...
...
@@ -15,9 +15,11 @@ composer require hanson/vbot
2、直接下载
[
release
](
https://github.com/HanSon/vbot/files/716645/vbot.zip
)
然后执行
``` php example/index.php ```
即可
然后执行
``` php example/index.php ```
*PS:警告!执行前请先查看`index.php`的代码,注释掉你认为不需要的代码,避免对其他人好友造成困扰*
PS:运行后二维码将保存于设置的缓存目录,命名为qr.png,控制台也会显示二维码,扫描即可
*警告!执行前请先查看`index.php`的代码,注释掉你认为不需要的代码,避免对其他人好友造成困扰*
# 文档
...
...
composer.lock
deleted
100644 → 0
View file @
11a8e84
This diff is collapsed.
Click to expand it.
example/index.php
View file @
ea0b570
...
...
@@ -79,7 +79,7 @@ $robot->server->setMessageHandler(function ($message) use ($path) {
// 语音消息
if
(
$message
instanceof
Voice
){
/** @var $message Voice */
return
'收到一条语音并下载在'
.
$message
->
getPath
(
$message
::
$folder
)
.
"/
{
$message
->
msg
[
'MsgId'
]
}
.mp3"
;
return
'收到一条语音并下载在'
.
$message
::
getPath
(
$message
::
$folder
)
.
"/
{
$message
->
msg
[
'MsgId'
]
}
.mp3"
;
}
// 撤回信息
...
...
src/Message/MediaTrait.php
View file @
ea0b570
...
...
@@ -17,7 +17,7 @@ namespace Hanson\Vbot\Message;
trait
MediaTrait
{
public
function
getPath
(
$folder
)
public
static
function
getPath
(
$folder
)
{
$path
=
server
()
->
config
[
'tmp'
]
.
$folder
;
...
...
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