hanson / vbot Goto Github PK
View Code? Open in Web Editor NEW微信,企微,机器人,企业微信,企微机器人,微信机器人,小红书,美团,美团爬虫,聚合聊天,RPA,协议,hook,逆向,群发,自动回复,chatgpt,API对接,稳定防封全语言通用,企业定制/SCRM/SAAS专用
License: MIT License
微信,企微,机器人,企业微信,企微机器人,微信机器人,小红书,美团,美团爬虫,聚合聊天,RPA,协议,hook,逆向,群发,自动回复,chatgpt,API对接,稳定防封全语言通用,企业定制/SCRM/SAAS专用
License: MIT License
大致原因是因为刚刚添加的好友,在好友列表中不存在,如果重新登录才能获取到这个好友的信息。
这个项目挺好玩的。希望可以做一些改善让其变得更加实用。
比如,写开放API,将vbot做成一个服务——这个服务只负责收发微信消息。这样做的好处是与业务代码彻底分离,便于业务的独立编写。业务独立后,也更加自由。比如说我写一个web端的管理系统,当想推送微信消息的时候直接调用vbot 的api,而不需要引进vbot的代码进我的业务代码里,也不需要命令行里执行php
有人知道要如何读取红包里的信息吗 ?
gif文件夹存了300多个表情以后 发表情回表情就不工作了。
在index里 直接call Emoticon::sendRandom($message->from['UserName']); 都不工作了。。。
public static function sendRandom($username)
{
$path = static::getPath(static::$folder);
if(is_dir($path)){
$files = scandir($path);
unset($files[0], $files[1]);
if(count($files)){
$msgId = $files[array_rand($files)];
static::send($username, $path . $msgId);
}
}
}
运行php vendor/bin/vbot run:example --session=vbot
的时候直接报错怎么办?
⚡ root@mrcong# php vendor/bin/vbot run:example --session=vbot
dir=$(d=${0%[/\\]*}; cd "$d"; cd '../hanson/vbot/bin' && pwd)
# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
# Cygwin paths start with /cygdrive/ which will break windows PHP,
# so we need to translate the dir path to windows format. However
# we could be using cygwin PHP which does not require this, so we
# test if the path to PHP starts with /cygdrive/ rather than /usr/bin
if [[ $(which php) == /cygdrive/* ]]; then
dir=$(cygpath -m "$dir");
fi
fi
dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/vbot" "$@"
托管一段时间后(几个小时后,或几天后),会自动掉线。你遇到过这种问题吗?
\Hanson\Vbot\Support\Console::log($message->from['NickName'] . ' 改名为 ' . $message->rename);
获取的两边名称一致;
请问那个函数可以做到, 把A群某个人说的话, 转到B群? 如何制定发送信息的目的地.
谢谢
文件: Hanson\Vbot\Message Text.php
$isMatch = preg_match('/@(.+?)\s(.+)/', $content, $match);
return $isMatch ? $match[2] : $this->message;
这一行代码,当$content包含有换行符时,$match[2]的内容会从换行符处截断。。
建议修改成
preg_match('/^@(.+?)\s([\s\S]*)/', $content, $match);
问题描述:手机直接拍摄小视频发送成功,可以在服务器端接受到视频。如果是从手机中选择视频或者是转发的视频,在tmp内无法下载到视频。
在群里有大概聊可能的原因, 这里也记录下. 还没深究, 建议:
以下是相关信息, 上传 github 不顺畅就直接贴图片链接了
setRemarkName($username, $remarkName):bool
$remarkName
的长度只能是 16 个字节。
https://github.com/HanSon/vbot/wiki/%E8%81%94%E7%B3%BB%E4%BA%BAContact
问题重现
在微信群里发信息,比如【你好】然后撤销【你好】,返回信息之后,再次撤销返回的信息就报错了
`Argument 2 passed to Hanson\Vbot\Message\Entity\Text::send() must be an instance of Hanson\Vbot\Message\Entity\string, string given, called in /Users//www/wx/vendor/hanson/vbot/src/Core/MessageHandler.php on line 181 and defined in /Users//www/wx/vendor/hanson/vbot/src/Message/Entity/Text.php on line 34
PHP Stack trace:
PHP 1. {main}() /Users//www/wx/index.php:0
PHP 2. Hanson\Vbot\Core\Server->run() /Users//www/wx/index.php:187
PHP 3. Hanson\Vbot\Core\MessageHandler->listen() /Users//www/wx/vendor/hanson/vbot/src/Core/Server.php:93
PHP 4. Hanson\Vbot\Core\MessageHandler->handlerMessage($selector = '2') /Users//www/wx/vendor/hanson/vbot/src/Core/MessageHandler.php:139
PHP 5. Hanson\Vbot\Message\Entity\Text::send($username = '@a930e571ef678d32344169d5b0269f40', $word = '334') /Users/*****/www/wx/vendor/hanson/vbot/src/Core/MessageHandler.php:181
Catchable fatal error: Argument 2 passed to Hanson\Vbot\Message\Entity\Text::send() must be an instance of Hanson\Vbot\Message\Entity\string, string given, called in /Users//www/wx/vendor/hanson/vbot/src/Core/MessageHandler.php on line 181 and defined in /Users//www/wx/vendor/hanson/vbot/src/Message/Entity/Text.php on line 34
Call Stack:
0.0007 280008 1. {main}() /Users//www/wx/index.php:0
0.0172 1687072 2. Hanson\Vbot\Core\Server->run() /Users//www/wx/index.php:187
15.0523 6784608 3. Hanson\Vbot\Core\MessageHandler->listen() /Users//www/wx/vendor/hanson/vbot/src/Core/Server.php:93
30.0403 6794464 4. Hanson\Vbot\Core\MessageHandler->handlerMessage(string(1)) /Users//www/wx/vendor/hanson/vbot/src/Core/MessageHandler.php:139
31.5447 7003424 5. Hanson\Vbot\Message\Entity\Text::send(string(33), string(3)) /Users/*****/www/wx/vendor/hanson/vbot/src/Core/MessageHandler.php:181`
1 有木有提供杀死进程的方法,目前用同一个session 执行两次我看后台进程并不会杀死之前的进程 ,只能通过sh脚本控制么
2 如果要用swoole api 的话能否用同一个端口 根据session 区分 哪个用户 ,可以通过修改哪些文件实现这个功能呢
比如想给某个联系人发个文字消息,想直接命令行搞定
Can u support?
$app = new App();
$robot->server->setMessageHandler([$app, 'onReceiveMessage']);
RT
试了试 Text::send只支持发送文字消息
处理消息时可能因为接受了公众号的推送,回调消息方法后出现发送消息失败的情况
使用Swoole API进行主动推送消息时, 能否将消息发送到指定的群?
随着群的增多,好友增多,变的不太稳定了,一会就自动退了,目测是腾讯有限制了,希望能有自动退群,删好友的功能
@Hanson 貌似微信网页版的username 在退出微信重进以后会变 对于群来说有什么微信识别的字段
我在digitalocean的vps运行的。。。 是因为美西的vps延迟问题吗? 还是怎么回事。。。
PHP Fatal error: Uncaught RuntimeException: Error creating resource: [message] fopen(http://www.tuling123.com/openapi/api): failed to open stream: Connection timed out
[file] /root/vendor/hanson/vbot/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
[line] 322 in /root/vendor/hanson/vbot/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php:252
Stack trace:
#0 /root/vendor/hanson/vbot/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(333): GuzzleHttp\Handler\StreamHandler->createResource(Object(Closure))
#1 /root/vendor/hanson/vbot/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(52): GuzzleHttp\Handler\StreamHandler->createStream(Object(GuzzleHttp\Psr7\Request), Array)
#2 /root/vendor/hanson/vbot/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(72): GuzzleHttp\Handler\StreamHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#3 /root/vendor/hanson/vbot/vendor/guzzlehttp/guzzle/src/Middleware.php(36): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#4 /root/vendo in /root/vendor/hanson/vbot/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 52
rt,控制台输出都是乱码,请问怎么解决?
比如我在其他的地方使用Text::send(); 实现发送消息
需要增加分段获取用户
Array
(
[BaseResponse] => Array
(
[Ret] => 1100
[ErrMsg] =>
)
[MediaId] =>
[StartPos] => 0
[CDNThumbImgHeight] => 0
[CDNThumbImgWidth] => 0
)
[2017-03-24 10:53:40][WARNING] 表情 /webroot/src/vbot/tmp/@caabae28c2663172d198f72676b065bf/gif/82602446872838730.gif 上传失败
php example/run.php --session=vbot
错误
PHP Warning: require(/root/vbot/vendor/hanson/vbot/example/../vendor/autoload.php): failed to open stream: No such file or directory in /root/vbot/vendor/hanson/vbot/example/run.php on line 5
PHP Fatal error: require(): Failed opening required '/root/vbot/vendor/hanson/vbot/example/../vendor/autoload.php' (include_path='.:/usr/local/php/lib/php') in /root/vbot/vendor/hanson/vbot/example/run.php on line 5
如何 @ 群里的其他人,还有如何把群里的某些成员T 掉, 在文档中没看到, 麻烦告知下,谢谢
自己也写过,到上传文件的时候就卡住了。。
一个机器人号设置了加好友无需验证,这样加好友后,无双方发消息是没问题的,但是机器人号通讯录里却没有对方账号,如果对方给机器人号转账就会提示“你不是收款方的好友”
希望程序运行在服务器,做群管理,当ssh关闭时希望程序不会结束
你好, hanson, 这个能获取订阅号吗?
再通过订阅号的【查看历史】,获取里头的文章吗?
你的接口文档可以发给我看下吗
打印:Console::log((int)($message instanceof RedPacket));
一直是 0
你有跑通过吗?
只有小视频能正常下载, 其他视频都出错
[WARNING] 下载视频失败
[2017-03-30 15:59:50][INFO] url:https://web.wechat.com/cgi-bin/mmwebwx-bin/webwxgetvideo?msgid=796246198686881572&skey=@crypt_471ab47b_af00ae41bcee839e169266ffcb87c209
[2017-03-30 15:59:50][MESSAGE] [796246198686881572] [视频]
'''
vbot.ERROR: Undefined index: skey [] []
PHP Fatal error: Uncaught ErrorException: Undefined index: skey in /xxxx/vbot/src/Core/Server.php:191
Stack trace:
#0 /xxxx/vbot/src/Core/Server.php(191): Hanson\Vbot\Foundation\ExceptionHandler->handleError(8, 'Undefined index...', '/data/wwwroot/d...', 191, Array)
#1 /xxxx/vbot/src/Core/Server.php(91): Hanson\Vbot\Core\Server->getLogin()
#2 /xxxx/vbot/src/Core/Server.php(34): Hanson\Vbot\Core\Server->login()
#3 /xxxx/vbot/example/Example.php(36): Hanson\Vbot\Core\Server->serve()
#4 /xxxx/vbot/example/run.php(9): Hanson\Vbot\Example\Example->run()
#5 {main}
thrown in /xxxx/vbot/src/Core/Server.php on line 191
Fatal error: Uncaught ErrorException: Undefined index: skey in /xxxx/vbot/src/Core/Server.php:191
Stack trace:
#0 /xxxx/vbot/src/Core/Server.php(191): Hanson\Vbot\Foundation\ExceptionHandler->handleError(8, 'Undefined index...', '/data/wwwroot/d...', 191, Array)
#1 /xxxx/vbot/src/Core/Server.php(91): Hanson\Vbot\Core\Server->getLogin()
#2 /xxxx/vbot/src/Core/Server.php(34): Hanson\Vbot\Core\Server->login()
#3 /xxxx/vbot/example/Example.php(36): Hanson\Vbot\Core\Server->serve()
#4 /xxxx/vbot/example/run.php(9): Hanson\Vbot\Example\Example->run()
#5 {main}
thrown in /xxxx/vbot/src/Core/Server.php on line 191
[2017-06-03 12:53:02] vbot.ERROR: Uncaught ErrorException: Undefined index: skey in /xxxx/vbot/src/Core/Server.php:191 Stack trace: #0 /xxxx/vbot/src/Core/Server.php(191): Hanson\Vbot\Foundation\ExceptionHandler->handleError(8, 'Undefined index...', '/data/wwwroot/d...', 191, Array) #1 /xxxx/vbot/src/Core/Server.php(91): Hanson\Vbot\Core\Server->getLogin() #2 /xxxx/vbot/src/Core/Server.php(34): Hanson\Vbot\Core\Server->login() #3 /xxxx/vbot/example/Example.php(36): Hanson\Vbot\Core\Server->serve() #4 /xxxx/vbot/example/run.php(9): Hanson\Vbot\Example\Example->run() #5 {main} thrown [] []
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalErrorException: Uncaught ErrorException: Undefined index: skey in /xxxx/vbot/src/Core/Server.php:191
Stack trace:
#0 /xxxx/vbot/src/Core/Server.php(191): Hanson\Vbot\Foundation\ExceptionHandler->handleError(8, 'Undefined index...', '/data/wwwroot/d...', 191, Array)
#1 /xxxx/vbot/src/Core/Server.php(91): Hanson\Vbot\Core\Server->getLogin()
#2 /xxxx/vbot/src/Core/Server.php(34): Hanson\Vbot\Core\Server->login()
#3 /xxxx/vbot/example/Example.php(36): Hanson\Vbot\Core\Server->serve()
#4 /xxxx/vbot/example/run.php(9): Hanson\Vbot\Example\Example->run()
#5 {main}
thrown in /xxxx/vbot/src/Core/Server.php:191
Stack trace:
#0 {main}
thrown in /xxxx/vbot/src/Core/Server.php on line 191
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalErrorException: Uncaught ErrorException: Undefined index: skey in /xxxx/vbot/src/Core/Server.php:191
Stack trace:
#0 /xxxx/vbot/src/Core/Server.php(191): Hanson\Vbot\Foundation\ExceptionHandler->handleError(8, 'Undefined index...', '/data/wwwroot/d...', 191, Array)
#1 /xxxx/vbot/src/Core/Server.php(91): Hanson\Vbot\Core\Server->getLogin()
#2 /xxxx/vbot/src/Core/Server.php(34): Hanson\Vbot\Core\Server->login()
#3 /xxxx/vbot/example/Example.php(36): Hanson\Vbot\Core\Server->serve()
#4 /xxxx/vbot/example/run.php(9): Hanson\Vbot\Example\Example->run()
#5 {main}
thrown in /xxxx/vbot/src/Core/Server.php:191
Stack trace:
#0 {main}
thrown in /xxxx/vbot/src/Core/Server.php on line 191
'''
如题,vbot
函数检测存在为 app
,是专为 laravel 设计的?意义在哪里?
use Hanson\Vbot\Foundation\Vbot;
if (!function_exists('app')) {
/**
* Get the available container instance.
*
* @param string $abstract
* @param array $parameters
*
* @return mixed|Vbot
*/
function vbot($abstract = null, array $parameters = [])
{
if (is_null($abstract)) {
return Vbot::getInstance();
}
return empty($parameters)
? Vbot::getInstance()->make($abstract)
: Vbot::getInstance()->makeWith($abstract, $parameters);
}
}
我用小号登录,然后扫描。可以成功。
但是手机一旦退出切换到主号,服务端这边也退出了。
有办法让服务端一直在线而不退出吗
[2017-03-29 09:39:58][INFO] 请扫描二维码登录
[2017-03-29 09:40:04][INFO] 请点击确认登录微信
PHP Fatal error: Uncaught Error: Call to undefined function Hanson\Vbot\Core\simplexml_load_string() in /root/vendor/hanson/vbot/src/Core/Server.php:243
Stack trace:
#0 /root/vendor/hanson/vbot/src/Core/Server.php(139): Hanson\Vbot\Core\Server->login()
#1 /root/vendor/hanson/vbot/src/Core/Server.php(81): Hanson\Vbot\Core\Server->prepare()
#2 /root/vendor/hanson/vbot/example/index.php(213): Hanson\Vbot\Core\Server->run()
#3 {main}
thrown in /root/vendor/hanson/vbot/src/Core/Server.php on line 243
root@ubuntu:~/vendor/hanson/vbot#
看着一些淘客群能每隔10分钟自动发送一条优惠信息。
[abc] [2017-05-11 11:03:06][INFO] 请扫描二维码登录
[abc] [2017-05-11 11:03:16][INFO] 请点击确认登录微信
[abc] [2017-05-11 11:03:18][INFO] 登录成功
[abc] [2017-05-11 11:03:19][INFO] 当前用户昵称:Peter总监
[abc] [2017-05-11 11:03:19][INFO] 当前用户ID:@35fe2a5c5be8beb827cec814dd462791420fce694dfbad693b6952b826b6ef96
[abc] [2017-05-11 11:03:19][INFO] 当前用户UIN:298635220
[abc] [2017-05-11 11:03:24][INFO] 初始化成功
[abc] [2017-05-11 11:03:24][INFO] 当前session:abc
[abc] [2017-05-11 11:03:24][INFO] 开始初始化联系人
[abc] [2017-05-11 11:03:29][INFO] 初始化联系人成功
[abc] [2017-05-11 11:03:29][INFO] 群数量: 4
[abc] [2017-05-11 11:03:29][INFO] 联系人数量: 110
[abc] [2017-05-11 11:03:29][INFO] 公众号数量: 3
[abc] [2017-05-11 11:03:30][INFO] ret:1101
[abc] [2017-05-11 11:03:30][INFO] ret:1101
[abc] [2017-05-11 11:03:31][INFO] ret:1101
[abc] [2017-05-11 11:03:31][INFO] ret:1101
[abc] [2017-05-11 11:03:31][INFO] ret:1101
[abc] [2017-05-11 11:03:32][INFO] ret:1101
[abc] [2017-05-11 11:03:32][INFO] ret:1101
[abc] [2017-05-11 11:03:33][INFO] ret:1101
[abc] [2017-05-11 11:03:33][INFO] ret:1101
[abc] [2017-05-11 11:03:33][INFO] ret:1101
[abc] [2017-05-11 11:03:34][INFO] ret:1101
[abc] [2017-05-11 11:03:34][INFO] ret:1101
[abc] [2017-05-11 11:03:35][INFO] ret:1101
[abc] [2017-05-11 11:03:35][INFO] ret:1101
[abc] [2017-05-11 11:03:35][INFO] ret:1101
[abc] [2017-05-11 11:03:36][INFO] ret:1101
[abc] [2017-05-11 11:03:36][INFO] ret:1101
[abc] [2017-05-11 11:03:36][INFO] ret:1101
[abc] [2017-05-11 11:03:37][INFO] ret:1101
谁知道这是为什么?
直接请求 HeadImgUrl无法获取头像,还需要加什么请求头吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.