-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into what-can-you-do-with-wechaty
- Loading branch information
Showing
43 changed files
with
729 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## Classes | ||
|
||
### Wechaty | ||
|
||
Wechaty is the main bot class. | ||
|
||
A `Bot` is a wechat client that depends on which type of puppet is used. The form the Bot takes is widely divided into 3 main categories- | ||
|
||
* **web-wechat** - when Puppet-Puppeteer or Puppet-wechat4u is used | ||
* **ipad-wechat** - when Puppet-padchat is used | ||
* **ios-wechat** - when Puppet-ioscat is used | ||
|
||
To understand puppet and its uses do visit the below link- | ||
|
||
### [What is a Puppet in Wechaty](https://github.com/wechaty/wechaty-getting-started/wiki/FAQ-EN#31-what-is-a-puppet-in-wechaty)? | ||
|
||
> If you want to know how to send message, see Message | ||
> If you want to know how to get contact, see Contact |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,30 +6,41 @@ sidebar_label: .NET | |
|
||
[![.NET Wechaty](https://img.shields.io/badge/Wechaty-.NET-blueviolet)](https://github.com/wechaty/dotnet-wechaty) | ||
|
||
- GitHub Repo <https://github.com/wechaty/dotnet-wechaty> | ||
- Getting Started Template Repo <https://github.com/wechaty/dotnet-wechaty-getting-started> | ||
.NET Wechaty is the translation of the TypeScript version of Wechaty using .Net Core. As .Net Core supports cross-platform, so .NET Wechaty also supports cross-platform. It has been tested and passed under different operating systems like Windows, Centos, Ubuntu, and has not been tested on the MacOs yet. For more information on .NET Wechaty you can visit the [.NET Wechaty Getting started](https://github.com/wechaty/dotnet-wechaty-getting-started) and to check out the code structure you can visit its [Github repo](https://github.com/wechaty/dotnet-wechaty). | ||
|
||
## Getting Started | ||
|
||
Template Repo: <https://github.com/wechaty/dotnet-wechaty-getting-started> | ||
You can run the below commands for starting the. NET-Wechaty. | ||
|
||
```sh | ||
git clone [email protected]:wechaty/dotnet-wechaty-getting-started.git | ||
cd dotnet-wechaty-getting-started | ||
make install | ||
make bot | ||
# install Nuget Package | ||
nuget restore | ||
# Set token for your bot open appsettings.json set wechaty configuration | ||
"WECHATY_PUPPET": "wechaty-puppet-hostie", | ||
"WECHATY_PUPPET_HOSTIE_TOKEN": "token" | ||
# Run the bot as | ||
visual studio F5 | ||
# or | ||
dotnet run | ||
``` | ||
|
||
## Blogs | ||
## Translation of TypeScript to .NET | ||
|
||
Read blogs with the `dotnet` tag at <https://wechaty.js.org/tags.html#dotnet> | ||
There is a hundred (100) lines class named Image in charge of downloading the WeChat image to different sizes. Below are the links to the Image class for both TypeScript and .NET for a better understanding of the code and the translation. | ||
|
||
TypeScript: <https://github.com/wechaty/wechaty/blob/master/src/user/image.ts> | ||
C#: <https://github.com/wechaty/dotnet-wechaty/blob/master/src/Wechaty/User/Image.cs> | ||
|
||
## History | ||
|
||
- [.NET Wechaty如何使用PadLocal Puppet Service, Darren, Jan 28, 2021](https://wechaty.js.org/2021/01/28/csharp-wechaty-for-padlocal-puppet-service/) | ||
- [.NET Wechaty Getting Start, Darren, Dec 31, 2020](https://wechaty.js.org/2020/12/31/dotnet-wechaty-getting-start/) | ||
For more information on the. NET-Wechaty releases and history, visit the link below. | ||
|
||
* [How .NET Wechaty uses PadLocal Puppet Service, Darren, Jan 28, 2021](https://wechaty.js.org/2021/01/28/csharp-wechaty-for-padlocal-puppet-service/) | ||
* [.NET Wechaty Getting Start, Darren, Dec 31, 2020](https://wechaty.js.org/2020/12/31/dotnet-wechaty-getting-start/) | ||
|
||
## Maintainers | ||
|
||
- [@echofool](https://github.com/echofool) | ||
- [@jesn](https://wechaty.js.org/contributors/jesn) | ||
* [@echofool](https://github.com/echofool) | ||
* [@jesn](https://wechaty.js.org/contributors/jesn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,28 +6,39 @@ sidebar_label: PHP | |
|
||
[![PHP Wechaty](https://img.shields.io/badge/Wechaty-PHP-7de)](https://github.com/wechaty/php-wechaty) | ||
|
||
- GitHub Repo <https://github.com/wechaty/php-wechaty> | ||
- Getting Started Template Repo <https://github.com/wechaty/php-wechaty-getting-started> | ||
PHP-Wechaty is a PHP programming client derived from the Wechaty ecosystem.PHP is a server scripting language and a powerful tool for making dynamic and interactive Web pages. You can find more information on PHP-Wechaty [here](https://github.com/wechaty/php-wechaty). The [General Architecture Diagram](https://wechaty.js.org/docs/polyglot/diy/) illustrates how the PHP-Wechaty can be implemented on the already existing TypeScript Wechaty ecosystem. | ||
The World's shortest PHP chatbot is PHP-Wechaty, which can be very easily implemented and used as shown below: | ||
|
||
```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(); | ||
``` | ||
|
||
## Getting Started | ||
|
||
Template Repo: <https://github.com/wechaty/php-wechaty-getting-started> | ||
Run the below commands for starting the PHP-Wechaty bot. For further information, also you can visit [Template repo](https://github.com/wechaty/php-wechaty-getting-started). | ||
|
||
```sh | ||
git clone [email protected]:wechaty/php-wechaty-getting-started.git | ||
cd php-wechaty-getting-started | ||
# Install php 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 | ||
make bot | ||
export WECHATY_PUPPET_HOSTIE_TOKEN=your_token_at_here | ||
make bot # to run the bot | ||
``` | ||
|
||
## Blogs | ||
|
||
Read blogs with the `php` tag at <https://wechaty.js.org/tags.html#php> | ||
|
||
## History | ||
|
||
- [PHP Wechaty, @zhangchunsheng, Aug 5, 2020](https://github.com/wechaty/php-wechaty/) | ||
|
||
## Maintainers | ||
|
||
- [@zhangchunsheng](https://github.com/zhangchunsheng) | ||
* [@zhangchunsheng](https://github.com/zhangchunsheng) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,22 @@ sidebar_label: Python | |
|
||
[![Python Wechaty](https://img.shields.io/badge/Wechaty-Python-blue)](https://github.com/wechaty/python-wechaty) | ||
|
||
- GitHub Repo <https://github.com/wechaty/python-wechaty> | ||
- Getting Started Template Repo <https://github.com/wechaty/python-wechaty-getting-started> | ||
Python-wechaty is a Python programming language client derived from the Wechaty ecosystem, allowing developers to connect to various instant messaging software platforms with a small amount of code.Python-wechaty has been committed to improve code robustness, add community out-of-the-box tools, and improve the software development documentation. | ||
|
||
## Features of Python-Wechaty | ||
|
||
* Send and receive messages. | ||
* Accept friendship from contact. | ||
* Create rooms and invites members. | ||
* Support Wechaty-plugin system. | ||
* Provides powerful sample code library for robots. | ||
* Easy to implement. | ||
|
||
You can find more information on [Python-Wechaty-getting started](https://github.com/wechaty/python-wechaty-getting-started).The [General Architecture Diagram](https://wechaty.js.org/docs/polyglot/diy/) illustrates on how the Python-Wechaty can be implemented on the existing TypeScript Wechaty ecosystem. | ||
|
||
## Getting Started | ||
|
||
Template Repo: <https://github.com/wechaty/python-wechaty-getting-started> | ||
You can run the below commands for starting the Wechaty-Python. | ||
|
||
```sh | ||
git clone [email protected]:wechaty/python-wechaty-getting-started.git | ||
|
@@ -20,18 +30,28 @@ make install | |
make bot | ||
``` | ||
|
||
## Translation of TypeScript to Python | ||
|
||
As the basic ecosystem of Wechaty is in TypeScript, we only need to translate it to Python. There is a hundred (100) lines of code in class named Image in charge of downloading the WeChat image to different sizes. | ||
Below are the links to `Image` class for both TypeScript and Python for better understanding of the code and the translation. | ||
|
||
* TypeScript: <https://github.com/wechaty/wechaty/blob/master/src/user/image.ts> | ||
* Python: <https://github.com/wechaty/python-wechaty/blob/master/src/wechaty/user/image.py> | ||
|
||
## History | ||
|
||
- [Python Wechaty Beta Released: A Simple Bot, wj-Mcat, Jun 17, 2020](https://wechaty.js.org/2020/06/17/python-wechaty-beta-released/) | ||
For more information on the Python-Wechaty releases and history, visit the link below. | ||
|
||
* [Python Wechaty Beta Released: A Simple Bot, wj-Mcat, Jun 17, 2020](https://wechaty.js.org/2020/06/17/python-wechaty-beta-released/) | ||
|
||
## Blogs | ||
|
||
- [教你用python-wecahty和web协议开发机器人, @wj-Mcat, Apr 17, 2021](https://wechaty.js.org/2021/04/17/python-wechaty-use-web/) | ||
- [Python-wechaty & wechaty-puppet-padlocal的初探, iivveess, Mar 8, 2021](https://wechaty.js.org/2021/03/08/python-wechaty-and-wechaty-puppet-padlocal/) | ||
- [Python Wechaty如何使用PadLocal Puppet Service, Biofer, Feb, 3, 2021](https://wechaty.js.org/2021/02/03/python-wechaty-for-padlocal-puppet-service/) | ||
The blogs related to Python-Wechaty are also listed below. | ||
|
||
Read more blogs with the `Python` tag at <https://wechaty.js.org/tags.html#python> | ||
* [教你用python-wecahty和web协议开发机器人, @wj-Mcat, Apr 17, 2021](https://wechaty.js.org/2021/04/17/python-wechaty-use-web/) | ||
* [Python-wechaty & wechaty-puppet-padlocal的初探, iivveess, Mar 8, 2021](https://wechaty.js.org/2021/03/08/python-wechaty-and-wechaty-puppet-padlocal/) | ||
* [Python Wechaty如何使用PadLocal Puppet Service, Biofer, Feb, 3, 2021](https://wechaty.js.org/2021/02/03/python-wechaty-for-padlocal-puppet-service/) | ||
|
||
## Maintainers | ||
|
||
- [@wj-Mcat](https://wechaty.js.org/contributors/wj-mcat) | ||
* [@wj-Mcat](https://wechaty.js.org/contributors/wj-mcat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.