PHP Wechaty Starter Project Template that Works Out-of-the-Box
Wechaty is a RPA SDK for Wechat Individual Account that can help you create a chatbot in 8 lines of PHP.
$wechaty = \IO\Github\Wechaty\Wechaty::getInstance($token, $endPoint);
$wechaty->onScan(function($qrcode, $status, $data) {
$qr = \IO\Github\Wechaty\Util\QrcodeUtils::getQr($qrcode);
echo "$qr\n\nOnline Image: https://wechaty.github.io/qrcode/$qrcode\n";
})->onLogin(function(\IO\Github\Wechaty\User\ContactSelf $user) {
})->onMessage(function(\IO\Github\Wechaty\User\Message $message) {
$message->say("hello from PHP7.4");
})->start();
# Install make sure php is 7.4+
sudo yum install php-pecl-grpc
sudo yum install php-pecl-protobuf
sudo yum install php-xml
# curl -sS https://getcomposer.org/installer | php
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer
make install
export WECHATY_PUPPET_HOSTIE_TOKEN=your_token_at_here
make bot
- TypeScript Wechaty Getting Started
- Python Wechaty Getting Started
- Java Wechaty Getting Started
- Go Wechaty Getting Started
- PHP Wechaty Getting Started
- .NET(C#) Wechaty Getting Started
[![Wechaty in PHP](https://img.shields.io/badge/Wechaty-PHP-blue)](https://github.com/wechaty/php-wechaty)
- Code & Docs © 2020 Wechaty Contributors https://github.com/wechaty
- Code released under the Apache-2.0 License
- Docs released under Creative Commons